Skip to content

Commit fd00be9

Browse files
Kent Overstreetakpm00
authored andcommitted
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/[email protected] Signed-off-by: Kent Overstreet <[email protected]> Reviewed-by: Suren Baghdasaryan <[email protected]> Signed-off-by: Andrew Morton <[email protected]>
1 parent 658be46 commit fd00be9

File tree

1 file changed

+7
-4
lines changed

1 file changed

+7
-4
lines changed

mm/show_mem.c

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -435,15 +435,18 @@ void __show_mem(unsigned int filter, nodemask_t *nodemask, int max_zone_idx)
435435
struct codetag *ct = tags[i].ct;
436436
struct alloc_tag *tag = ct_to_alloc_tag(ct);
437437
struct alloc_tag_counters counter = alloc_tag_read(tag);
438+
char bytes[10];
439+
440+
string_get_size(counter.bytes, 1, STRING_UNITS_2, bytes, sizeof(bytes));
438441

439442
/* Same as alloc_tag_to_text() but w/o intermediate buffer */
440443
if (ct->modname)
441-
pr_notice("%12lli %8llu %s:%u [%s] func:%s\n",
442-
counter.bytes, counter.calls, ct->filename,
444+
pr_notice("%12s %8llu %s:%u [%s] func:%s\n",
445+
bytes, counter.calls, ct->filename,
443446
ct->lineno, ct->modname, ct->function);
444447
else
445-
pr_notice("%12lli %8llu %s:%u func:%s\n",
446-
counter.bytes, counter.calls, ct->filename,
448+
pr_notice("%12s %8llu %s:%u func:%s\n",
449+
bytes, counter.calls, ct->filename,
447450
ct->lineno, ct->function);
448451
}
449452
}

0 commit comments

Comments
 (0)