debugobjects: Fix debug_objects_freed accounting
authorArnd Bergmann <arnd@arndb.de>
Thu, 22 Feb 2018 15:52:58 +0000 (16:52 +0100)
committerThomas Gleixner <tglx@linutronix.de>
Thu, 22 Feb 2018 21:00:24 +0000 (22:00 +0100)
commit04148187aa9df3626168f7429d2287997787e387
tree7a24a10f826607b0a1c4636fd2a803cb1c2d6ce8
parent1ea9b98b007a662e402551a41a4413becad40a65
debugobjects: Fix debug_objects_freed accounting

The removal of the batched object freeing has caused the debug_objects_freed
to become read-only, and the reading is inside an ifdef, so gcc warns that it
is completely unused without CONFIG_DEBUG_FS:

lib/debugobjects.c:71:14: error: 'debug_objects_freed' defined but not used [-Werror=unused-variable]

Assuming we are still interested in this number, this adds back code to
keep track of the freed objects.

Fixes: 636e1970fd7d ("debugobjects: Use global free list in free_object()")
Suggested-by: Waiman Long <longman@redhat.com>
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Acked-by: Yang Shi <yang.shi@linux.alibaba.com>
Acked-by: Waiman Long <longman@redhat.com>
Link: https://lkml.kernel.org/r/20180222155335.1647466-1-arnd@arndb.de
lib/debugobjects.c