debugobjects: Export max loops counter
authorYang Shi <yang.shi@linux.alibaba.com>
Mon, 5 Feb 2018 23:18:25 +0000 (07:18 +0800)
committerThomas Gleixner <tglx@linutronix.de>
Tue, 13 Feb 2018 09:58:58 +0000 (10:58 +0100)
commitbd9dcd046509cd5355605e43791eacee8bf5e40f
tree3b40437e4a2357eb74e321b4b11934bea31cc955
parent7928b2cbe55b2a410a0f5c1f154610059c57b1b2
debugobjects: Export max loops counter

__debug_check_no_obj_freed() can be an expensive operation depending on the
size of memory freed. It already exports the maximum chain walk length via
debugfs, but this only records the maximum of a single memory chunk.

Though there is no information about the total number of objects inspected
for a __debug_check_no_obj_freed() operation, which might be significantly
larger when a huge memory region is freed.

Aggregate the number of objects inspected for a single invocation of
__debug_check_no_obj_freed() and export it via sysfs.

The resulting output of /sys/kernel/debug/debug_objects/stats looks like:

max_chain     :121
max_checked   :543267
warnings      :0
fixups        :0
pool_free     :1764
pool_min_free :341
pool_used     :86438
pool_max_used :268887
objs_allocated:6068254
objs_freed    :5981076

[ tglx: Renamed the variable to max_checked and adjusted changelog ]

Signed-off-by: Yang Shi <yang.shi@linux.alibaba.com>
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Cc: longman@redhat.com
Link: https://lkml.kernel.org/r/1517872708-24207-2-git-send-email-yang.shi@linux.alibaba.com
lib/debugobjects.c