0
0
Fork 0
mirror of https://github.com/matrix-construct/construct synced 2025-01-14 16:46:50 +01:00

modules/console: Use pretty(iec(bytes)) for ctx list stack sizes.

This commit is contained in:
Jason Volk 2019-04-11 03:55:51 -07:00
parent 342ef74382
commit aa5055ced3

View file

@ -1544,27 +1544,27 @@ console_cmd__ctx__list(opt &out, const string_view &line)
<< std::setw(7)
<< "STATE"
<< " "
<< std::setw(8)
<< "YIELDS"
<< " "
<< std::setw(5)
<< "NOTES"
<< " "
<< std::setw(15)
<< "CYCLE COUNT"
<< " "
<< std::setw(6)
<< "PCT"
<< " "
<< std::setw(7)
<< std::setw(25)
<< "STACK"
<< " "
<< std::setw(7)
<< std::setw(25)
<< "LIMIT"
<< " "
<< std::setw(6)
<< "PCT"
<< " "
<< std::setw(8)
<< "YIELDS"
<< " "
<< std::setw(5)
<< "NOTES"
<< " "
<< ":NAME"
<< std::endl;
@ -1583,6 +1583,12 @@ console_cmd__ctx__list(opt &out, const string_view &line)
<< (running(ctx)? 'R' : '-')
;
out << " "
<< std::setw(8) << std::right << yields(ctx);
out << " "
<< std::setw(5) << std::right << notes(ctx);
out << " "
<< std::setw(15) << std::right << cycles(ctx);
@ -1596,11 +1602,12 @@ console_cmd__ctx__list(opt &out, const string_view &line)
<< std::setw(5) << std::right << std::fixed << std::setprecision(2) << (tsc_pct * 100)
<< "%";
thread_local char pbuf[32];
out << " "
<< std::setw(7) << std::right << stack_at(ctx);
<< std::setw(25) << std::right << pretty(pbuf, iec(stack_at(ctx)));
out << " "
<< std::setw(7) << std::right << stack_max(ctx);
<< std::setw(25) << std::right << pretty(pbuf, iec(stack_max(ctx)));
const auto stack_pct
{
@ -1611,12 +1618,6 @@ console_cmd__ctx__list(opt &out, const string_view &line)
<< std::setw(5) << std::right << std::fixed << std::setprecision(2) << (stack_pct * 100)
<< "%";
out << " "
<< std::setw(8) << std::right << yields(ctx);
out << " "
<< std::setw(5) << std::right << notes(ctx);
out << " :"
<< name(ctx);