lockdep: output lock_class key instead of address for forward dependency output
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, volist_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" ); }
Ingo Molnar
AppliedQuoted 6 lines · Huang, Ying
The key instead of address of
lock_classshould be output in/proc/lockdepwhen forward dependency is output, because key is output forlock_classitself as identifier too.This patch is based on x86/auto-latest branch of git-x86 tree, and has been tested on
x86_64platform.
applied to tip/core/locking - thanks Ying.
i'm wondering, can entry->class never be NULL here?
Ingo
Quoted 6 lines · Ingo Molnar
Quoted 4 lines · Huang, Ying
The key instead of address of
lock_classshould be output in/proc/lockdepwhen forward dependency is output, because key is output forlock_classitself 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_64platform.applied to tip/core/locking - thanks Ying.
i'm wondering, can
entry->classnever 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