aboutsummaryrefslogtreecommitdiffstats
path: root/kernel/lockdep_proc.c
diff options
context:
space:
mode:
Diffstat (limited to 'kernel/lockdep_proc.c')
-rw-r--r--kernel/lockdep_proc.c41
1 files changed, 29 insertions, 12 deletions
diff --git a/kernel/lockdep_proc.c b/kernel/lockdep_proc.c
index b554b40a4aa6..57a547a2da3f 100644
--- a/kernel/lockdep_proc.c
+++ b/kernel/lockdep_proc.c
@@ -77,12 +77,29 @@ static unsigned long count_backward_deps(struct lock_class *class)
77 return ret; 77 return ret;
78} 78}
79 79
80static void print_name(struct seq_file *m, struct lock_class *class)
81{
82 char str[128];
83 const char *name = class->name;
84
85 if (!name) {
86 name = __get_key_name(class->key, str);
87 seq_printf(m, "%s", name);
88 } else{
89 seq_printf(m, "%s", name);
90 if (class->name_version > 1)
91 seq_printf(m, "#%d", class->name_version);
92 if (class->subclass)
93 seq_printf(m, "/%d", class->subclass);
94 }
95}
96
80static int l_show(struct seq_file *m, void *v) 97static int l_show(struct seq_file *m, void *v)
81{ 98{
82 unsigned long nr_forward_deps, nr_backward_deps; 99 unsigned long nr_forward_deps, nr_backward_deps;
83 struct lock_class *class = m->private; 100 struct lock_class *class = m->private;
84 char str[128], c1, c2, c3, c4; 101 struct lock_list *entry;
85 const char *name; 102 char c1, c2, c3, c4;
86 103
87 seq_printf(m, "%p", class->key); 104 seq_printf(m, "%p", class->key);
88#ifdef CONFIG_DEBUG_LOCKDEP 105#ifdef CONFIG_DEBUG_LOCKDEP
@@ -97,16 +114,16 @@ static int l_show(struct seq_file *m, void *v)
97 get_usage_chars(class, &c1, &c2, &c3, &c4); 114 get_usage_chars(class, &c1, &c2, &c3, &c4);
98 seq_printf(m, " %c%c%c%c", c1, c2, c3, c4); 115 seq_printf(m, " %c%c%c%c", c1, c2, c3, c4);
99 116
100 name = class->name; 117 seq_printf(m, ": ");
101 if (!name) { 118 print_name(m, class);
102 name = __get_key_name(class->key, str); 119 seq_puts(m, "\n");
103 seq_printf(m, ": %s", name); 120
104 } else{ 121 list_for_each_entry(entry, &class->locks_after, entry) {
105 seq_printf(m, ": %s", name); 122 if (entry->distance == 1) {
106 if (class->name_version > 1) 123 seq_printf(m, " -> [%p] ", entry->class);
107 seq_printf(m, "#%d", class->name_version); 124 print_name(m, entry->class);
108 if (class->subclass) 125 seq_puts(m, "\n");
109 seq_printf(m, "/%d", class->subclass); 126 }
110 } 127 }
111 seq_puts(m, "\n"); 128 seq_puts(m, "\n");
112 129