Commit d3df1453 authored by Ritesh Harjani's avatar Ritesh Harjani Committed by Theodore Ts'o

ext4: mballoc: make mb_debug() implementation to use pr_debug()

mb_debug() msg had only 1 control level for all type of msgs.
And if we enable mballoc_debug then all of those msgs would be enabled.
Instead of adding multiple debug levels for mb_debug() msgs, use
pr_debug() with which we could have finer control to print msgs at all
of different levels (i.e. at file, func, line no.).

Also add process name/pid, superblk id, and other info in mb_debug()
msg. This also kills the mballoc_debug module parameter, since it is
not needed any more.
Signed-off-by: default avatarRitesh Harjani <riteshh@linux.ibm.com>
Link: https://lore.kernel.org/r/f0c660cbde9e2edbe95c67942ca9ad80dd2231eb.1589086800.git.riteshh@linux.ibm.comSigned-off-by: default avatarTheodore Ts'o <tytso@mit.edu>
parent 8ec2d31b
...@@ -99,8 +99,7 @@ config EXT4_DEBUG ...@@ -99,8 +99,7 @@ config EXT4_DEBUG
Enables run-time debugging support for the ext4 filesystem. Enables run-time debugging support for the ext4 filesystem.
If you select Y here, then you will be able to turn on debugging If you select Y here, then you will be able to turn on debugging
with a command such as: using dynamic debug control for mb_debug() msgs.
echo 1 > /sys/module/ext4/parameters/mballoc_debug
config EXT4_KUNIT_TESTS config EXT4_KUNIT_TESTS
tristate "KUnit tests for ext4" tristate "KUnit tests for ext4"
......
This diff is collapsed.
...@@ -24,19 +24,15 @@ ...@@ -24,19 +24,15 @@
#include "ext4.h" #include "ext4.h"
/* /*
* mb_debug() dynamic printk msgs could be used to debug mballoc code.
*/ */
#ifdef CONFIG_EXT4_DEBUG #ifdef CONFIG_EXT4_DEBUG
extern ushort ext4_mballoc_debug; #define mb_debug(sb, fmt, ...) \
pr_debug("[%s/%d] EXT4-fs (%s): (%s, %d): %s: " fmt, \
#define mb_debug(n, fmt, ...) \ current->comm, task_pid_nr(current), sb->s_id, \
do { \ __FILE__, __LINE__, __func__, ##__VA_ARGS__)
if ((n) <= ext4_mballoc_debug) { \
printk(KERN_DEBUG "(%s, %d): %s: " fmt, \
__FILE__, __LINE__, __func__, ##__VA_ARGS__); \
} \
} while (0)
#else #else
#define mb_debug(n, fmt, ...) no_printk(fmt, ##__VA_ARGS__) #define mb_debug(sb, fmt, ...) no_printk(fmt, ##__VA_ARGS__)
#endif #endif
#define EXT4_MB_HISTORY_ALLOC 1 /* allocation */ #define EXT4_MB_HISTORY_ALLOC 1 /* allocation */
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment