Commit 5831c0f7 authored by Peter Zijlstra's avatar Peter Zijlstra

locking/selftests: More granular debug_locks_verbose

Showing all tests all the time is tiresome.
Signed-off-by: default avatarPeter Zijlstra (Intel) <peterz@infradead.org>
parent 9271a40d
...@@ -802,13 +802,14 @@ ...@@ -802,13 +802,14 @@
insecure, please do not use on production kernels. insecure, please do not use on production kernels.
debug_locks_verbose= debug_locks_verbose=
[KNL] verbose self-tests [KNL] verbose locking self-tests
Format=<0|1> Format: <int>
Print debugging info while doing the locking API Print debugging info while doing the locking API
self-tests. self-tests.
We default to 0 (no extra messages), setting it to Bitmask for the various LOCKTYPE_ tests. Defaults to 0
1 will print _a lot_ more information - normally (no extra messages), setting it to -1 (all bits set)
only useful to kernel developers. will print _a_lot_ more information - normally only
useful to lockdep developers.
debug_objects [KNL] Enable object debugging debug_objects [KNL] Enable object debugging
......
...@@ -1390,6 +1390,8 @@ static void dotest(void (*testcase_fn)(void), int expected, int lockclass_mask) ...@@ -1390,6 +1390,8 @@ static void dotest(void (*testcase_fn)(void), int expected, int lockclass_mask)
WARN_ON(irqs_disabled()); WARN_ON(irqs_disabled());
debug_locks_silent = !(debug_locks_verbose & lockclass_mask);
testcase_fn(); testcase_fn();
/* /*
* Filter out expected failures: * Filter out expected failures:
...@@ -1410,7 +1412,7 @@ static void dotest(void (*testcase_fn)(void), int expected, int lockclass_mask) ...@@ -1410,7 +1412,7 @@ static void dotest(void (*testcase_fn)(void), int expected, int lockclass_mask)
} }
testcase_total++; testcase_total++;
if (debug_locks_verbose) if (debug_locks_verbose & lockclass_mask)
pr_cont(" lockclass mask: %x, debug_locks: %d, expected: %d\n", pr_cont(" lockclass mask: %x, debug_locks: %d, expected: %d\n",
lockclass_mask, debug_locks, expected); lockclass_mask, debug_locks, expected);
/* /*
...@@ -2674,7 +2676,6 @@ void locking_selftest(void) ...@@ -2674,7 +2676,6 @@ void locking_selftest(void)
printk(" --------------------------------------------------------------------------\n"); printk(" --------------------------------------------------------------------------\n");
init_shared_classes(); init_shared_classes();
debug_locks_silent = !debug_locks_verbose;
lockdep_set_selftest_task(current); lockdep_set_selftest_task(current);
DO_TESTCASE_6R("A-A deadlock", AA); DO_TESTCASE_6R("A-A deadlock", AA);
......
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