diff options
| author | Ingo Molnar <mingo@elte.hu> | 2008-08-20 05:52:15 -0400 |
|---|---|---|
| committer | Ingo Molnar <mingo@elte.hu> | 2008-08-20 05:52:15 -0400 |
| commit | 7393423dd9b5790a3115873be355e9fc862bce8f (patch) | |
| tree | fc83214602c8ce41dc06d5c8e21deada679521f7 /kernel/lockdep_proc.c | |
| parent | 8df9676d6402563da91427e8d9f2da8a4598aede (diff) | |
| parent | 1fca25427482387689fa27594c992a961d98768f (diff) | |
Merge branch 'linus' into x86/cleanups
Diffstat (limited to 'kernel/lockdep_proc.c')
| -rw-r--r-- | kernel/lockdep_proc.c | 45 |
1 files changed, 10 insertions, 35 deletions
diff --git a/kernel/lockdep_proc.c b/kernel/lockdep_proc.c index 9b0e940e2545..4b194d34d77f 100644 --- a/kernel/lockdep_proc.c +++ b/kernel/lockdep_proc.c | |||
| @@ -63,34 +63,6 @@ static void l_stop(struct seq_file *m, void *v) | |||
| 63 | { | 63 | { |
| 64 | } | 64 | } |
| 65 | 65 | ||
| 66 | static unsigned long count_forward_deps(struct lock_class *class) | ||
| 67 | { | ||
| 68 | struct lock_list *entry; | ||
| 69 | unsigned long ret = 1; | ||
| 70 | |||
| 71 | /* | ||
| 72 | * Recurse this class's dependency list: | ||
| 73 | */ | ||
| 74 | list_for_each_entry(entry, &class->locks_after, entry) | ||
| 75 | ret += count_forward_deps(entry->class); | ||
| 76 | |||
| 77 | return ret; | ||
| 78 | } | ||
| 79 | |||
| 80 | static unsigned long count_backward_deps(struct lock_class *class) | ||
| 81 | { | ||
| 82 | struct lock_list *entry; | ||
| 83 | unsigned long ret = 1; | ||
| 84 | |||
| 85 | /* | ||
| 86 | * Recurse this class's dependency list: | ||
| 87 | */ | ||
| 88 | list_for_each_entry(entry, &class->locks_before, entry) | ||
| 89 | ret += count_backward_deps(entry->class); | ||
| 90 | |||
| 91 | return ret; | ||
| 92 | } | ||
| 93 | |||
| 94 | static void print_name(struct seq_file *m, struct lock_class *class) | 66 | static void print_name(struct seq_file *m, struct lock_class *class) |
| 95 | { | 67 | { |
| 96 | char str[128]; | 68 | char str[128]; |
| @@ -110,7 +82,6 @@ static void print_name(struct seq_file *m, struct lock_class *class) | |||
| 110 | 82 | ||
| 111 | static int l_show(struct seq_file *m, void *v) | 83 | static int l_show(struct seq_file *m, void *v) |
| 112 | { | 84 | { |
| 113 | unsigned long nr_forward_deps, nr_backward_deps; | ||
| 114 | struct lock_class *class = v; | 85 | struct lock_class *class = v; |
| 115 | struct lock_list *entry; | 86 | struct lock_list *entry; |
| 116 | char c1, c2, c3, c4; | 87 | char c1, c2, c3, c4; |
| @@ -124,11 +95,10 @@ static int l_show(struct seq_file *m, void *v) | |||
| 124 | #ifdef CONFIG_DEBUG_LOCKDEP | 95 | #ifdef CONFIG_DEBUG_LOCKDEP |
| 125 | seq_printf(m, " OPS:%8ld", class->ops); | 96 | seq_printf(m, " OPS:%8ld", class->ops); |
| 126 | #endif | 97 | #endif |
| 127 | nr_forward_deps = count_forward_deps(class); | 98 | #ifdef CONFIG_PROVE_LOCKING |
| 128 | seq_printf(m, " FD:%5ld", nr_forward_deps); | 99 | seq_printf(m, " FD:%5ld", lockdep_count_forward_deps(class)); |
| 129 | 100 | seq_printf(m, " BD:%5ld", lockdep_count_backward_deps(class)); | |
| 130 | nr_backward_deps = count_backward_deps(class); | 101 | #endif |
| 131 | seq_printf(m, " BD:%5ld", nr_backward_deps); | ||
| 132 | 102 | ||
| 133 | get_usage_chars(class, &c1, &c2, &c3, &c4); | 103 | get_usage_chars(class, &c1, &c2, &c3, &c4); |
| 134 | seq_printf(m, " %c%c%c%c", c1, c2, c3, c4); | 104 | seq_printf(m, " %c%c%c%c", c1, c2, c3, c4); |
| @@ -229,6 +199,9 @@ static int lc_show(struct seq_file *m, void *v) | |||
| 229 | 199 | ||
| 230 | for (i = 0; i < chain->depth; i++) { | 200 | for (i = 0; i < chain->depth; i++) { |
| 231 | class = lock_chain_get_class(chain, i); | 201 | class = lock_chain_get_class(chain, i); |
| 202 | if (!class->key) | ||
| 203 | continue; | ||
| 204 | |||
| 232 | seq_printf(m, "[%p] ", class->key); | 205 | seq_printf(m, "[%p] ", class->key); |
| 233 | print_name(m, class); | 206 | print_name(m, class); |
| 234 | seq_puts(m, "\n"); | 207 | seq_puts(m, "\n"); |
| @@ -350,7 +323,9 @@ static int lockdep_stats_show(struct seq_file *m, void *v) | |||
| 350 | if (class->usage_mask & LOCKF_ENABLED_HARDIRQS_READ) | 323 | if (class->usage_mask & LOCKF_ENABLED_HARDIRQS_READ) |
| 351 | nr_hardirq_read_unsafe++; | 324 | nr_hardirq_read_unsafe++; |
| 352 | 325 | ||
| 353 | sum_forward_deps += count_forward_deps(class); | 326 | #ifdef CONFIG_PROVE_LOCKING |
| 327 | sum_forward_deps += lockdep_count_forward_deps(class); | ||
| 328 | #endif | ||
| 354 | } | 329 | } |
| 355 | #ifdef CONFIG_DEBUG_LOCKDEP | 330 | #ifdef CONFIG_DEBUG_LOCKDEP |
| 356 | DEBUG_LOCKS_WARN_ON(debug_atomic_read(&nr_unused_locks) != nr_unused); | 331 | DEBUG_LOCKS_WARN_ON(debug_atomic_read(&nr_unused_locks) != nr_unused); |
