Skip to contentSkip to conversation

lockdep: output lock_class key instead of address for forward dependency output

BUGFIX Applied Huang, Ying 2 participants 3 messages Jun 13, 2008

lore
Share & tools
lore
#0 lore raw

The key instead of address of lock_class should be output in /proc/lockdep when forward dependency is output, because key is output for lock_class itself as identifier too.

This patch is based on x86/auto-latest branch of git-x86 tree, and has been tested on x86_64 platform.

---
 kernel/lockdep_proc.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
kernel/lockdep_proc.c +1 -1
@@ -139,7 +139,7 @@ static int l_show(struct seq_file *m, vo
 
 	list_for_each_entry(entry, &class->locks_after, entry) {
 		if (entry->distance == 1) {
-			seq_printf(m, " -> [%p] ", entry->class);
+			seq_printf(m, " -> [%p] ", entry->class->key);
 			print_name(m, entry->class);
 			seq_puts(m, "\n");
 		}
Applied
#1 lore raw
Quoted 6 lines · Huang, Ying

The key instead of address of lock_class should be output in /proc/lockdep when forward dependency is output, because key is output for lock_class itself as identifier too.

This patch is based on x86/auto-latest branch of git-x86 tree, and has been tested on x86_64 platform.

applied to tip/core/locking - thanks Ying.

i'm wondering, can entry->class never be NULL here?

Ingo

#2 lore raw
Quoted 6 lines · Ingo Molnar
Quoted 4 lines · Huang, Ying

The key instead of address of lock_class should be output in /proc/lockdep when forward dependency is output, because key is output for lock_class itself as identifier too.

Quoted 6 lines
Quoted 2 lines

This patch is based on x86/auto-latest branch of git-x86 tree, and has been tested on x86_64 platform.

applied to tip/core/locking - thanks Ying.

i'm wondering, can entry->class never be NULL here?

As far as I know, it can never be NULL. Because entry is added into class->locks_after in following call chain:

lock_acquire -> __lock_acquire -> validate_chain -> check_prevs_add -> check_prev_add -> add_lock_to_list

in __lock_acquire the lock_class is look up or registered from lockdep_map and put in held_lock, which is used in following function in call chain.

Best Regards,
Huang Ying