[PATCH 10/32] locking/lockdep: Make mark_lock() verbosity aware of vector

Frederic Weisbecker
2019-02-12T17:15:07Z

Expand the effective usage bit on top of the lock usage bit/vector pair
while in verbose mode logging in mark_lock().

FIXME: This only handle the first bit in the mask. We may need to
iterate over all of them.

Signed-off-by: Frederic Weisbecker <frederic@kernel.org>
Cc: Mauro Carvalho Chehab <mchehab@s-opensource.com>
Cc: Joel Fernandes <joel@joelfernandes.org>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: Pavan Kondeti <pkondeti@codeaurora.org>
Cc: Paul E . McKenney <paulmck@linux.vnet.ibm.com>
Cc: David S . Miller <davem@davemloft.net>
Cc: Ingo Molnar <mingo@kernel.org>
Cc: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
Cc: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Peter Zijlstra <peterz@infradead.org>
---
kernel/locking/lockdep.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/kernel/locking/lockdep.c b/kernel/locking/lockdep.c
index 4bac8c1a3929..6a74b433fe4c 100644
--- a/kernel/locking/lockdep.c
+++ b/kernel/locking/lockdep.c
@@ -3219,7 +3219,7 @@ static int mark_lock(struct task_struct *curr, struct held_lock *this,
* We must printk outside of the graph_lock:
*/
if (ret == 2) {
- printk("\nmarked lock as {%s}:\n", usage_str[new_usage->bit]);
+ printk("\nmarked lock as {%s}:\n", usage_str[__ffs64(lock_usage_mask(new_usage))]);
print_lock(this);
print_irqtrace_events(curr);
dump_stack();
--
2.17.1