mirror of
https://github.com/matrix-construct/construct
synced 2024-07-05 10:08:36 +02:00
modules/console: Start an ios cmd.
This commit is contained in:
parent
d37129ac03
commit
42d275d787
|
@ -800,6 +800,44 @@ console_cmd__env(opt &out, const string_view &line)
|
|||
return true;
|
||||
}
|
||||
|
||||
//
|
||||
// ios
|
||||
//
|
||||
|
||||
bool
|
||||
console_cmd__ios(opt &out, const string_view &line)
|
||||
{
|
||||
out << std::left << std::setw(3) << "ID"
|
||||
<< " " << std::left << std::setw(48) << "NAME"
|
||||
<< " " << std::right << std::setw(6) << "FAULTS"
|
||||
<< " " << std::right << std::setw(10) << "CALLS"
|
||||
<< " " << std::right << std::setw(10) << "ALLOCS"
|
||||
<< " " << std::right << std::setw(10) << "FREES"
|
||||
<< " " << std::right << std::setw(26) << "ALLOCATED"
|
||||
<< " " << std::right << std::setw(26) << "FREED"
|
||||
<< std::endl
|
||||
;
|
||||
|
||||
for(const auto *const &descriptor : ios::descriptor::list)
|
||||
{
|
||||
assert(descriptor);
|
||||
const auto &d(*descriptor);
|
||||
thread_local char pbuf[64];
|
||||
out << std::left << std::setw(3) << d.id
|
||||
<< " " << std::left << std::setw(48) << d.name
|
||||
<< " " << std::right << std::setw(6) << d.faults
|
||||
<< " " << std::right << std::setw(10) << d.calls
|
||||
<< " " << std::right << std::setw(10) << d.allocs
|
||||
<< " " << std::right << std::setw(10) << d.frees
|
||||
<< " " << std::right << std::setw(26) << pretty(iec(d.alloc_bytes))
|
||||
<< " " << std::right << std::setw(26) << pretty(iec(d.free_bytes))
|
||||
<< std::endl
|
||||
;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
//
|
||||
// aio
|
||||
//
|
||||
|
|
Loading…
Reference in a new issue