mirror of
https://github.com/matrix-construct/construct
synced 2025-04-29 13:04:17 +02:00
modules/console: Add option for short mem info only; use stack buffers.
This commit is contained in:
parent
acd0b71ccc
commit
5d60e6b2d4
1 changed files with 6 additions and 2 deletions
|
@ -1045,14 +1045,18 @@ console_cmd__mem(opt &out, const string_view &line)
|
|||
ircd::allocator::profile::this_thread
|
||||
};
|
||||
|
||||
char pbuf[2][48];
|
||||
if(this_thread.alloc_count)
|
||||
out << "IRCd thread allocations:" << std::endl
|
||||
<< "alloc count: " << this_thread.alloc_count << std::endl
|
||||
<< "freed count: " << this_thread.free_count << std::endl
|
||||
<< "alloc bytes: " << pretty(iec(this_thread.alloc_bytes)) << std::endl
|
||||
<< "freed bytes: " << pretty(iec(this_thread.free_bytes)) << std::endl
|
||||
<< "alloc bytes: " << pretty(pbuf[0], iec(this_thread.alloc_bytes)) << std::endl
|
||||
<< "freed bytes: " << pretty(pbuf[1], iec(this_thread.free_bytes)) << std::endl
|
||||
<< std::endl;
|
||||
|
||||
if(opts == "ircd")
|
||||
return true;
|
||||
|
||||
thread_local char buf[48_KiB];
|
||||
out << "Allocator information:" << std::endl
|
||||
<< allocator::info(buf, opts) << std::endl
|
||||
|
|
Loading…
Add table
Reference in a new issue