diff options
author | Kent Overstreet <kent.overstreet@linux.dev> | 2024-09-06 02:53:37 +0200 |
---|---|---|
committer | Andrew Morton <akpm@linux-foundation.org> | 2024-09-17 10:07:00 +0200 |
commit | fd00be9afa1d64c90ae20a1307da1bdb809b3d55 (patch) | |
tree | 78ad2a26140a7aeadf9df95f066d3ef547434b14 /mm | |
parent | mm: support poison recovery from copy_present_page() (diff) | |
download | linux-fd00be9afa1d64c90ae20a1307da1bdb809b3d55.tar.xz linux-fd00be9afa1d64c90ae20a1307da1bdb809b3d55.zip |
mm/show_mem.c: report alloc tags in human readable units
We already do this when reporting slab info - more consistent and more
readable.
Link: https://lkml.kernel.org/r/20240906005337.1220091-1-kent.overstreet@linux.dev
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
Reviewed-by: Suren Baghdasaryan <surenb@google.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Diffstat (limited to 'mm')
-rw-r--r-- | mm/show_mem.c | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/mm/show_mem.c b/mm/show_mem.c index bdb439551eef..ec885a398fa0 100644 --- a/mm/show_mem.c +++ b/mm/show_mem.c @@ -435,15 +435,18 @@ void __show_mem(unsigned int filter, nodemask_t *nodemask, int max_zone_idx) struct codetag *ct = tags[i].ct; struct alloc_tag *tag = ct_to_alloc_tag(ct); struct alloc_tag_counters counter = alloc_tag_read(tag); + char bytes[10]; + + string_get_size(counter.bytes, 1, STRING_UNITS_2, bytes, sizeof(bytes)); /* Same as alloc_tag_to_text() but w/o intermediate buffer */ if (ct->modname) - pr_notice("%12lli %8llu %s:%u [%s] func:%s\n", - counter.bytes, counter.calls, ct->filename, + pr_notice("%12s %8llu %s:%u [%s] func:%s\n", + bytes, counter.calls, ct->filename, ct->lineno, ct->modname, ct->function); else - pr_notice("%12lli %8llu %s:%u func:%s\n", - counter.bytes, counter.calls, ct->filename, + pr_notice("%12s %8llu %s:%u func:%s\n", + bytes, counter.calls, ct->filename, ct->lineno, ct->function); } } |