diff --git a/modules/console.cc b/modules/console.cc index c836fbc96..72fba0e33 100644 --- a/modules/console.cc +++ b/modules/console.cc @@ -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 //