Greg Kroah-Hartman | b244131 | 2017-11-01 15:07:57 +0100 | [diff] [blame] | 1 | // SPDX-License-Identifier: GPL-2.0 |
Ingo Molnar | a8f24a3 | 2006-07-03 00:24:52 -0700 | [diff] [blame] | 2 | /* |
| 3 | * kernel/lockdep_proc.c |
| 4 | * |
| 5 | * Runtime locking correctness validator |
| 6 | * |
| 7 | * Started by Ingo Molnar: |
| 8 | * |
Peter Zijlstra | 4b32d0a | 2007-07-19 01:48:59 -0700 | [diff] [blame] | 9 | * Copyright (C) 2006,2007 Red Hat, Inc., Ingo Molnar <mingo@redhat.com> |
Peter Zijlstra | 90eec10 | 2015-11-16 11:08:45 +0100 | [diff] [blame] | 10 | * Copyright (C) 2007 Red Hat, Inc., Peter Zijlstra |
Ingo Molnar | a8f24a3 | 2006-07-03 00:24:52 -0700 | [diff] [blame] | 11 | * |
| 12 | * Code for /proc/lockdep and /proc/lockdep_stats: |
| 13 | * |
| 14 | */ |
Paul Gortmaker | 9984de1 | 2011-05-23 14:51:41 -0400 | [diff] [blame] | 15 | #include <linux/export.h> |
Ingo Molnar | a8f24a3 | 2006-07-03 00:24:52 -0700 | [diff] [blame] | 16 | #include <linux/proc_fs.h> |
| 17 | #include <linux/seq_file.h> |
| 18 | #include <linux/kallsyms.h> |
| 19 | #include <linux/debug_locks.h> |
Peter Zijlstra | c46261d | 2007-07-19 01:48:57 -0700 | [diff] [blame] | 20 | #include <linux/vmalloc.h> |
| 21 | #include <linux/sort.h> |
Linus Torvalds | 7c0f6ba | 2016-12-24 11:46:01 -0800 | [diff] [blame] | 22 | #include <linux/uaccess.h> |
Peter Zijlstra | c46261d | 2007-07-19 01:48:57 -0700 | [diff] [blame] | 23 | #include <asm/div64.h> |
Ingo Molnar | a8f24a3 | 2006-07-03 00:24:52 -0700 | [diff] [blame] | 24 | |
| 25 | #include "lockdep_internals.h" |
| 26 | |
| 27 | static void *l_next(struct seq_file *m, void *v, loff_t *pos) |
| 28 | { |
Li Zefan | 8109e1d | 2009-08-17 13:40:17 +0800 | [diff] [blame] | 29 | return seq_list_next(v, &all_lock_classes, pos); |
Ingo Molnar | a8f24a3 | 2006-07-03 00:24:52 -0700 | [diff] [blame] | 30 | } |
| 31 | |
| 32 | static void *l_start(struct seq_file *m, loff_t *pos) |
| 33 | { |
Li Zefan | 8109e1d | 2009-08-17 13:40:17 +0800 | [diff] [blame] | 34 | return seq_list_start_head(&all_lock_classes, *pos); |
Ingo Molnar | a8f24a3 | 2006-07-03 00:24:52 -0700 | [diff] [blame] | 35 | } |
| 36 | |
| 37 | static void l_stop(struct seq_file *m, void *v) |
| 38 | { |
| 39 | } |
| 40 | |
Jason Baron | 068135e | 2007-02-10 01:44:59 -0800 | [diff] [blame] | 41 | static void print_name(struct seq_file *m, struct lock_class *class) |
| 42 | { |
Cyrill Gorcunov | 99fb4a1 | 2012-10-20 23:05:19 +0400 | [diff] [blame] | 43 | char str[KSYM_NAME_LEN]; |
Jason Baron | 068135e | 2007-02-10 01:44:59 -0800 | [diff] [blame] | 44 | const char *name = class->name; |
| 45 | |
| 46 | if (!name) { |
| 47 | name = __get_key_name(class->key, str); |
| 48 | seq_printf(m, "%s", name); |
| 49 | } else{ |
| 50 | seq_printf(m, "%s", name); |
| 51 | if (class->name_version > 1) |
| 52 | seq_printf(m, "#%d", class->name_version); |
| 53 | if (class->subclass) |
| 54 | seq_printf(m, "/%d", class->subclass); |
| 55 | } |
| 56 | } |
| 57 | |
Ingo Molnar | a8f24a3 | 2006-07-03 00:24:52 -0700 | [diff] [blame] | 58 | static int l_show(struct seq_file *m, void *v) |
| 59 | { |
Li Zefan | 8109e1d | 2009-08-17 13:40:17 +0800 | [diff] [blame] | 60 | struct lock_class *class = list_entry(v, struct lock_class, lock_entry); |
Jason Baron | 068135e | 2007-02-10 01:44:59 -0800 | [diff] [blame] | 61 | struct lock_list *entry; |
Peter Zijlstra | f510b23 | 2009-01-22 17:53:47 +0100 | [diff] [blame] | 62 | char usage[LOCK_USAGE_CHARS]; |
Ingo Molnar | a8f24a3 | 2006-07-03 00:24:52 -0700 | [diff] [blame] | 63 | |
Li Zefan | 8109e1d | 2009-08-17 13:40:17 +0800 | [diff] [blame] | 64 | if (v == &all_lock_classes) { |
Tim Pepper | 94c61c0 | 2007-10-11 22:11:11 +0200 | [diff] [blame] | 65 | seq_printf(m, "all lock classes:\n"); |
| 66 | return 0; |
| 67 | } |
| 68 | |
Ingo Molnar | a8f24a3 | 2006-07-03 00:24:52 -0700 | [diff] [blame] | 69 | seq_printf(m, "%p", class->key); |
| 70 | #ifdef CONFIG_DEBUG_LOCKDEP |
Waiman Long | 8ca2b56c | 2018-10-03 13:07:18 -0400 | [diff] [blame] | 71 | seq_printf(m, " OPS:%8ld", debug_class_ops_read(class)); |
Ingo Molnar | a8f24a3 | 2006-07-03 00:24:52 -0700 | [diff] [blame] | 72 | #endif |
Stephen Hemminger | df60a84 | 2008-08-15 09:33:05 -0700 | [diff] [blame] | 73 | #ifdef CONFIG_PROVE_LOCKING |
| 74 | seq_printf(m, " FD:%5ld", lockdep_count_forward_deps(class)); |
| 75 | seq_printf(m, " BD:%5ld", lockdep_count_backward_deps(class)); |
| 76 | #endif |
Ingo Molnar | a8f24a3 | 2006-07-03 00:24:52 -0700 | [diff] [blame] | 77 | |
Peter Zijlstra | f510b23 | 2009-01-22 17:53:47 +0100 | [diff] [blame] | 78 | get_usage_chars(class, usage); |
| 79 | seq_printf(m, " %s", usage); |
Ingo Molnar | a8f24a3 | 2006-07-03 00:24:52 -0700 | [diff] [blame] | 80 | |
Jason Baron | 068135e | 2007-02-10 01:44:59 -0800 | [diff] [blame] | 81 | seq_printf(m, ": "); |
| 82 | print_name(m, class); |
| 83 | seq_puts(m, "\n"); |
| 84 | |
| 85 | list_for_each_entry(entry, &class->locks_after, entry) { |
| 86 | if (entry->distance == 1) { |
Huang, Ying | 2429e4e | 2008-06-13 14:40:17 +0800 | [diff] [blame] | 87 | seq_printf(m, " -> [%p] ", entry->class->key); |
Jason Baron | 068135e | 2007-02-10 01:44:59 -0800 | [diff] [blame] | 88 | print_name(m, entry->class); |
| 89 | seq_puts(m, "\n"); |
| 90 | } |
Ingo Molnar | a8f24a3 | 2006-07-03 00:24:52 -0700 | [diff] [blame] | 91 | } |
| 92 | seq_puts(m, "\n"); |
| 93 | |
| 94 | return 0; |
| 95 | } |
| 96 | |
Helge Deller | 15ad7cd | 2006-12-06 20:40:36 -0800 | [diff] [blame] | 97 | static const struct seq_operations lockdep_ops = { |
Ingo Molnar | a8f24a3 | 2006-07-03 00:24:52 -0700 | [diff] [blame] | 98 | .start = l_start, |
| 99 | .next = l_next, |
| 100 | .stop = l_stop, |
| 101 | .show = l_show, |
| 102 | }; |
| 103 | |
Huang, Ying | cd1a28e | 2008-06-23 11:20:54 +0800 | [diff] [blame] | 104 | #ifdef CONFIG_PROVE_LOCKING |
Huang, Ying | 443cd50 | 2008-06-20 16:39:21 +0800 | [diff] [blame] | 105 | static void *lc_start(struct seq_file *m, loff_t *pos) |
| 106 | { |
Bart Van Assche | 2212684 | 2019-02-14 15:00:48 -0800 | [diff] [blame] | 107 | if (*pos < 0) |
| 108 | return NULL; |
| 109 | |
Huang, Ying | 443cd50 | 2008-06-20 16:39:21 +0800 | [diff] [blame] | 110 | if (*pos == 0) |
| 111 | return SEQ_START_TOKEN; |
| 112 | |
Bart Van Assche | 2212684 | 2019-02-14 15:00:48 -0800 | [diff] [blame] | 113 | return lock_chains + (*pos - 1); |
Huang, Ying | 443cd50 | 2008-06-20 16:39:21 +0800 | [diff] [blame] | 114 | } |
| 115 | |
Li Zefan | 12aac19 | 2009-08-17 13:40:39 +0800 | [diff] [blame] | 116 | static void *lc_next(struct seq_file *m, void *v, loff_t *pos) |
| 117 | { |
Bart Van Assche | 2212684 | 2019-02-14 15:00:48 -0800 | [diff] [blame] | 118 | *pos = lockdep_next_lockchain(*pos - 1) + 1; |
Li Zefan | 12aac19 | 2009-08-17 13:40:39 +0800 | [diff] [blame] | 119 | return lc_start(m, pos); |
| 120 | } |
| 121 | |
Huang, Ying | 443cd50 | 2008-06-20 16:39:21 +0800 | [diff] [blame] | 122 | static void lc_stop(struct seq_file *m, void *v) |
| 123 | { |
| 124 | } |
| 125 | |
| 126 | static int lc_show(struct seq_file *m, void *v) |
| 127 | { |
| 128 | struct lock_chain *chain = v; |
| 129 | struct lock_class *class; |
| 130 | int i; |
| 131 | |
| 132 | if (v == SEQ_START_TOKEN) { |
Peter Zijlstra | 75dd602 | 2016-03-30 11:36:59 +0200 | [diff] [blame] | 133 | if (nr_chain_hlocks > MAX_LOCKDEP_CHAIN_HLOCKS) |
| 134 | seq_printf(m, "(buggered) "); |
Huang, Ying | 443cd50 | 2008-06-20 16:39:21 +0800 | [diff] [blame] | 135 | seq_printf(m, "all lock chains:\n"); |
| 136 | return 0; |
| 137 | } |
| 138 | |
| 139 | seq_printf(m, "irq_context: %d\n", chain->irq_context); |
| 140 | |
| 141 | for (i = 0; i < chain->depth; i++) { |
| 142 | class = lock_chain_get_class(chain, i); |
Rabin Vincent | 8bfe029 | 2008-08-11 09:30:26 +0200 | [diff] [blame] | 143 | if (!class->key) |
| 144 | continue; |
| 145 | |
Huang, Ying | 443cd50 | 2008-06-20 16:39:21 +0800 | [diff] [blame] | 146 | seq_printf(m, "[%p] ", class->key); |
| 147 | print_name(m, class); |
| 148 | seq_puts(m, "\n"); |
| 149 | } |
| 150 | seq_puts(m, "\n"); |
| 151 | |
| 152 | return 0; |
| 153 | } |
| 154 | |
| 155 | static const struct seq_operations lockdep_chains_ops = { |
| 156 | .start = lc_start, |
| 157 | .next = lc_next, |
| 158 | .stop = lc_stop, |
| 159 | .show = lc_show, |
| 160 | }; |
Huang, Ying | cd1a28e | 2008-06-23 11:20:54 +0800 | [diff] [blame] | 161 | #endif /* CONFIG_PROVE_LOCKING */ |
Huang, Ying | 443cd50 | 2008-06-20 16:39:21 +0800 | [diff] [blame] | 162 | |
Ingo Molnar | a8f24a3 | 2006-07-03 00:24:52 -0700 | [diff] [blame] | 163 | static void lockdep_stats_debug_show(struct seq_file *m) |
| 164 | { |
| 165 | #ifdef CONFIG_DEBUG_LOCKDEP |
Frederic Weisbecker | bd6d29c | 2010-04-06 00:10:17 +0200 | [diff] [blame] | 166 | unsigned long long hi1 = debug_atomic_read(hardirqs_on_events), |
| 167 | hi2 = debug_atomic_read(hardirqs_off_events), |
| 168 | hr1 = debug_atomic_read(redundant_hardirqs_on), |
| 169 | hr2 = debug_atomic_read(redundant_hardirqs_off), |
| 170 | si1 = debug_atomic_read(softirqs_on_events), |
| 171 | si2 = debug_atomic_read(softirqs_off_events), |
| 172 | sr1 = debug_atomic_read(redundant_softirqs_on), |
| 173 | sr2 = debug_atomic_read(redundant_softirqs_off); |
Ingo Molnar | a8f24a3 | 2006-07-03 00:24:52 -0700 | [diff] [blame] | 174 | |
Frederic Weisbecker | bd6d29c | 2010-04-06 00:10:17 +0200 | [diff] [blame] | 175 | seq_printf(m, " chain lookup misses: %11llu\n", |
| 176 | debug_atomic_read(chain_lookup_misses)); |
| 177 | seq_printf(m, " chain lookup hits: %11llu\n", |
| 178 | debug_atomic_read(chain_lookup_hits)); |
| 179 | seq_printf(m, " cyclic checks: %11llu\n", |
| 180 | debug_atomic_read(nr_cyclic_checks)); |
Peter Zijlstra | ae81330 | 2017-03-03 10:13:38 +0100 | [diff] [blame] | 181 | seq_printf(m, " redundant checks: %11llu\n", |
| 182 | debug_atomic_read(nr_redundant_checks)); |
| 183 | seq_printf(m, " redundant links: %11llu\n", |
| 184 | debug_atomic_read(nr_redundant)); |
Frederic Weisbecker | bd6d29c | 2010-04-06 00:10:17 +0200 | [diff] [blame] | 185 | seq_printf(m, " find-mask forwards checks: %11llu\n", |
| 186 | debug_atomic_read(nr_find_usage_forwards_checks)); |
| 187 | seq_printf(m, " find-mask backwards checks: %11llu\n", |
| 188 | debug_atomic_read(nr_find_usage_backwards_checks)); |
Ingo Molnar | a8f24a3 | 2006-07-03 00:24:52 -0700 | [diff] [blame] | 189 | |
Frederic Weisbecker | bd6d29c | 2010-04-06 00:10:17 +0200 | [diff] [blame] | 190 | seq_printf(m, " hardirq on events: %11llu\n", hi1); |
| 191 | seq_printf(m, " hardirq off events: %11llu\n", hi2); |
| 192 | seq_printf(m, " redundant hardirq ons: %11llu\n", hr1); |
| 193 | seq_printf(m, " redundant hardirq offs: %11llu\n", hr2); |
| 194 | seq_printf(m, " softirq on events: %11llu\n", si1); |
| 195 | seq_printf(m, " softirq off events: %11llu\n", si2); |
| 196 | seq_printf(m, " redundant softirq ons: %11llu\n", sr1); |
| 197 | seq_printf(m, " redundant softirq offs: %11llu\n", sr2); |
Ingo Molnar | a8f24a3 | 2006-07-03 00:24:52 -0700 | [diff] [blame] | 198 | #endif |
| 199 | } |
| 200 | |
| 201 | static int lockdep_stats_show(struct seq_file *m, void *v) |
| 202 | { |
Ingo Molnar | a8f24a3 | 2006-07-03 00:24:52 -0700 | [diff] [blame] | 203 | unsigned long nr_unused = 0, nr_uncategorized = 0, |
| 204 | nr_irq_safe = 0, nr_irq_unsafe = 0, |
| 205 | nr_softirq_safe = 0, nr_softirq_unsafe = 0, |
| 206 | nr_hardirq_safe = 0, nr_hardirq_unsafe = 0, |
| 207 | nr_irq_read_safe = 0, nr_irq_read_unsafe = 0, |
| 208 | nr_softirq_read_safe = 0, nr_softirq_read_unsafe = 0, |
| 209 | nr_hardirq_read_safe = 0, nr_hardirq_read_unsafe = 0, |
Sergey Senozhatsky | dec2960 | 2011-03-23 14:38:28 +0200 | [diff] [blame] | 210 | sum_forward_deps = 0; |
Ingo Molnar | a8f24a3 | 2006-07-03 00:24:52 -0700 | [diff] [blame] | 211 | |
Yuyang Du | 68d41d8 | 2019-07-09 18:15:22 +0800 | [diff] [blame] | 212 | #ifdef CONFIG_PROVE_LOCKING |
Arnd Bergmann | 68037aa | 2019-07-15 11:27:49 +0200 | [diff] [blame] | 213 | struct lock_class *class; |
| 214 | |
Ingo Molnar | a8f24a3 | 2006-07-03 00:24:52 -0700 | [diff] [blame] | 215 | list_for_each_entry(class, &all_lock_classes, lock_entry) { |
| 216 | |
| 217 | if (class->usage_mask == 0) |
| 218 | nr_unused++; |
| 219 | if (class->usage_mask == LOCKF_USED) |
| 220 | nr_uncategorized++; |
| 221 | if (class->usage_mask & LOCKF_USED_IN_IRQ) |
| 222 | nr_irq_safe++; |
Peter Zijlstra | 4fc95e8 | 2009-01-22 13:10:52 +0100 | [diff] [blame] | 223 | if (class->usage_mask & LOCKF_ENABLED_IRQ) |
Ingo Molnar | a8f24a3 | 2006-07-03 00:24:52 -0700 | [diff] [blame] | 224 | nr_irq_unsafe++; |
| 225 | if (class->usage_mask & LOCKF_USED_IN_SOFTIRQ) |
| 226 | nr_softirq_safe++; |
Peter Zijlstra | 4fc95e8 | 2009-01-22 13:10:52 +0100 | [diff] [blame] | 227 | if (class->usage_mask & LOCKF_ENABLED_SOFTIRQ) |
Ingo Molnar | a8f24a3 | 2006-07-03 00:24:52 -0700 | [diff] [blame] | 228 | nr_softirq_unsafe++; |
| 229 | if (class->usage_mask & LOCKF_USED_IN_HARDIRQ) |
| 230 | nr_hardirq_safe++; |
Peter Zijlstra | 4fc95e8 | 2009-01-22 13:10:52 +0100 | [diff] [blame] | 231 | if (class->usage_mask & LOCKF_ENABLED_HARDIRQ) |
Ingo Molnar | a8f24a3 | 2006-07-03 00:24:52 -0700 | [diff] [blame] | 232 | nr_hardirq_unsafe++; |
| 233 | if (class->usage_mask & LOCKF_USED_IN_IRQ_READ) |
| 234 | nr_irq_read_safe++; |
Peter Zijlstra | 4fc95e8 | 2009-01-22 13:10:52 +0100 | [diff] [blame] | 235 | if (class->usage_mask & LOCKF_ENABLED_IRQ_READ) |
Ingo Molnar | a8f24a3 | 2006-07-03 00:24:52 -0700 | [diff] [blame] | 236 | nr_irq_read_unsafe++; |
| 237 | if (class->usage_mask & LOCKF_USED_IN_SOFTIRQ_READ) |
| 238 | nr_softirq_read_safe++; |
Peter Zijlstra | 4fc95e8 | 2009-01-22 13:10:52 +0100 | [diff] [blame] | 239 | if (class->usage_mask & LOCKF_ENABLED_SOFTIRQ_READ) |
Ingo Molnar | a8f24a3 | 2006-07-03 00:24:52 -0700 | [diff] [blame] | 240 | nr_softirq_read_unsafe++; |
| 241 | if (class->usage_mask & LOCKF_USED_IN_HARDIRQ_READ) |
| 242 | nr_hardirq_read_safe++; |
Peter Zijlstra | 4fc95e8 | 2009-01-22 13:10:52 +0100 | [diff] [blame] | 243 | if (class->usage_mask & LOCKF_ENABLED_HARDIRQ_READ) |
Ingo Molnar | a8f24a3 | 2006-07-03 00:24:52 -0700 | [diff] [blame] | 244 | nr_hardirq_read_unsafe++; |
| 245 | |
David Miller | 419ca3f | 2008-07-29 21:45:03 -0700 | [diff] [blame] | 246 | sum_forward_deps += lockdep_count_forward_deps(class); |
Ingo Molnar | a8f24a3 | 2006-07-03 00:24:52 -0700 | [diff] [blame] | 247 | } |
Robert P. J. Day | 501b9eb | 2007-02-10 01:46:34 -0800 | [diff] [blame] | 248 | #ifdef CONFIG_DEBUG_LOCKDEP |
Frederic Weisbecker | bd6d29c | 2010-04-06 00:10:17 +0200 | [diff] [blame] | 249 | DEBUG_LOCKS_WARN_ON(debug_atomic_read(nr_unused_locks) != nr_unused); |
Ingo Molnar | a8f24a3 | 2006-07-03 00:24:52 -0700 | [diff] [blame] | 250 | #endif |
Yuyang Du | 68d41d8 | 2019-07-09 18:15:22 +0800 | [diff] [blame] | 251 | |
| 252 | #endif |
Ingo Molnar | a8f24a3 | 2006-07-03 00:24:52 -0700 | [diff] [blame] | 253 | seq_printf(m, " lock-classes: %11lu [max: %lu]\n", |
| 254 | nr_lock_classes, MAX_LOCKDEP_KEYS); |
| 255 | seq_printf(m, " direct dependencies: %11lu [max: %lu]\n", |
| 256 | nr_list_entries, MAX_LOCKDEP_ENTRIES); |
| 257 | seq_printf(m, " indirect dependencies: %11lu\n", |
| 258 | sum_forward_deps); |
| 259 | |
| 260 | /* |
| 261 | * Total number of dependencies: |
| 262 | * |
| 263 | * All irq-safe locks may nest inside irq-unsafe locks, |
| 264 | * plus all the other known dependencies: |
| 265 | */ |
| 266 | seq_printf(m, " all direct dependencies: %11lu\n", |
| 267 | nr_irq_unsafe * nr_irq_safe + |
| 268 | nr_hardirq_unsafe * nr_hardirq_safe + |
| 269 | nr_list_entries); |
| 270 | |
Peter Zijlstra | 8e18257 | 2007-07-19 01:48:54 -0700 | [diff] [blame] | 271 | #ifdef CONFIG_PROVE_LOCKING |
Ingo Molnar | a8f24a3 | 2006-07-03 00:24:52 -0700 | [diff] [blame] | 272 | seq_printf(m, " dependency chains: %11lu [max: %lu]\n", |
Bart Van Assche | 2212684 | 2019-02-14 15:00:48 -0800 | [diff] [blame] | 273 | lock_chain_count(), MAX_LOCKDEP_CHAINS); |
Huang, Ying | 443cd50 | 2008-06-20 16:39:21 +0800 | [diff] [blame] | 274 | seq_printf(m, " dependency chain hlocks: %11d [max: %lu]\n", |
Huang, Ying | cd1a28e | 2008-06-23 11:20:54 +0800 | [diff] [blame] | 275 | nr_chain_hlocks, MAX_LOCKDEP_CHAIN_HLOCKS); |
Peter Zijlstra | 8e18257 | 2007-07-19 01:48:54 -0700 | [diff] [blame] | 276 | #endif |
Ingo Molnar | a8f24a3 | 2006-07-03 00:24:52 -0700 | [diff] [blame] | 277 | |
| 278 | #ifdef CONFIG_TRACE_IRQFLAGS |
| 279 | seq_printf(m, " in-hardirq chains: %11u\n", |
| 280 | nr_hardirq_chains); |
| 281 | seq_printf(m, " in-softirq chains: %11u\n", |
| 282 | nr_softirq_chains); |
| 283 | #endif |
| 284 | seq_printf(m, " in-process chains: %11u\n", |
| 285 | nr_process_chains); |
| 286 | seq_printf(m, " stack-trace entries: %11lu [max: %lu]\n", |
| 287 | nr_stack_trace_entries, MAX_STACK_TRACE_ENTRIES); |
| 288 | seq_printf(m, " combined max dependencies: %11u\n", |
| 289 | (nr_hardirq_chains + 1) * |
| 290 | (nr_softirq_chains + 1) * |
| 291 | (nr_process_chains + 1) |
| 292 | ); |
| 293 | seq_printf(m, " hardirq-safe locks: %11lu\n", |
| 294 | nr_hardirq_safe); |
| 295 | seq_printf(m, " hardirq-unsafe locks: %11lu\n", |
| 296 | nr_hardirq_unsafe); |
| 297 | seq_printf(m, " softirq-safe locks: %11lu\n", |
| 298 | nr_softirq_safe); |
| 299 | seq_printf(m, " softirq-unsafe locks: %11lu\n", |
| 300 | nr_softirq_unsafe); |
| 301 | seq_printf(m, " irq-safe locks: %11lu\n", |
| 302 | nr_irq_safe); |
| 303 | seq_printf(m, " irq-unsafe locks: %11lu\n", |
| 304 | nr_irq_unsafe); |
| 305 | |
| 306 | seq_printf(m, " hardirq-read-safe locks: %11lu\n", |
| 307 | nr_hardirq_read_safe); |
| 308 | seq_printf(m, " hardirq-read-unsafe locks: %11lu\n", |
| 309 | nr_hardirq_read_unsafe); |
| 310 | seq_printf(m, " softirq-read-safe locks: %11lu\n", |
| 311 | nr_softirq_read_safe); |
| 312 | seq_printf(m, " softirq-read-unsafe locks: %11lu\n", |
| 313 | nr_softirq_read_unsafe); |
| 314 | seq_printf(m, " irq-read-safe locks: %11lu\n", |
| 315 | nr_irq_read_safe); |
| 316 | seq_printf(m, " irq-read-unsafe locks: %11lu\n", |
| 317 | nr_irq_read_unsafe); |
| 318 | |
| 319 | seq_printf(m, " uncategorized locks: %11lu\n", |
| 320 | nr_uncategorized); |
| 321 | seq_printf(m, " unused locks: %11lu\n", |
| 322 | nr_unused); |
| 323 | seq_printf(m, " max locking depth: %11u\n", |
| 324 | max_lockdep_depth); |
Ingo Molnar | bbfa262 | 2009-08-02 14:44:24 +0200 | [diff] [blame] | 325 | #ifdef CONFIG_PROVE_LOCKING |
Ming Lei | 12f3dfd | 2009-07-16 15:44:29 +0200 | [diff] [blame] | 326 | seq_printf(m, " max bfs queue depth: %11u\n", |
| 327 | max_bfs_queue_depth); |
Ingo Molnar | bbfa262 | 2009-08-02 14:44:24 +0200 | [diff] [blame] | 328 | #endif |
Ingo Molnar | a8f24a3 | 2006-07-03 00:24:52 -0700 | [diff] [blame] | 329 | lockdep_stats_debug_show(m); |
| 330 | seq_printf(m, " debug_locks: %11u\n", |
| 331 | debug_locks); |
| 332 | |
| 333 | return 0; |
| 334 | } |
| 335 | |
Peter Zijlstra | c46261d | 2007-07-19 01:48:57 -0700 | [diff] [blame] | 336 | #ifdef CONFIG_LOCK_STAT |
| 337 | |
| 338 | struct lock_stat_data { |
| 339 | struct lock_class *class; |
| 340 | struct lock_class_stats stats; |
| 341 | }; |
| 342 | |
| 343 | struct lock_stat_seq { |
Peter Zijlstra | c46261d | 2007-07-19 01:48:57 -0700 | [diff] [blame] | 344 | struct lock_stat_data *iter_end; |
| 345 | struct lock_stat_data stats[MAX_LOCKDEP_KEYS]; |
| 346 | }; |
| 347 | |
| 348 | /* |
| 349 | * sort on absolute number of contentions |
| 350 | */ |
| 351 | static int lock_stat_cmp(const void *l, const void *r) |
| 352 | { |
| 353 | const struct lock_stat_data *dl = l, *dr = r; |
| 354 | unsigned long nl, nr; |
| 355 | |
| 356 | nl = dl->stats.read_waittime.nr + dl->stats.write_waittime.nr; |
| 357 | nr = dr->stats.read_waittime.nr + dr->stats.write_waittime.nr; |
| 358 | |
| 359 | return nr - nl; |
| 360 | } |
| 361 | |
| 362 | static void seq_line(struct seq_file *m, char c, int offset, int length) |
| 363 | { |
| 364 | int i; |
| 365 | |
| 366 | for (i = 0; i < offset; i++) |
| 367 | seq_puts(m, " "); |
| 368 | for (i = 0; i < length; i++) |
| 369 | seq_printf(m, "%c", c); |
| 370 | seq_puts(m, "\n"); |
| 371 | } |
| 372 | |
| 373 | static void snprint_time(char *buf, size_t bufsiz, s64 nr) |
| 374 | { |
Peter Zijlstra | 6918bc5 | 2008-09-23 15:33:41 +0200 | [diff] [blame] | 375 | s64 div; |
| 376 | s32 rem; |
Peter Zijlstra | c46261d | 2007-07-19 01:48:57 -0700 | [diff] [blame] | 377 | |
Joe Korty | 2189459d | 2008-08-25 17:15:33 -0400 | [diff] [blame] | 378 | nr += 5; /* for display rounding */ |
Peter Zijlstra | 6918bc5 | 2008-09-23 15:33:41 +0200 | [diff] [blame] | 379 | div = div_s64_rem(nr, 1000, &rem); |
| 380 | snprintf(buf, bufsiz, "%lld.%02d", (long long)div, (int)rem/10); |
Peter Zijlstra | c46261d | 2007-07-19 01:48:57 -0700 | [diff] [blame] | 381 | } |
| 382 | |
| 383 | static void seq_time(struct seq_file *m, s64 time) |
| 384 | { |
| 385 | char num[15]; |
| 386 | |
| 387 | snprint_time(num, sizeof(num), time); |
| 388 | seq_printf(m, " %14s", num); |
| 389 | } |
| 390 | |
| 391 | static void seq_lock_time(struct seq_file *m, struct lock_time *lt) |
| 392 | { |
| 393 | seq_printf(m, "%14lu", lt->nr); |
| 394 | seq_time(m, lt->min); |
| 395 | seq_time(m, lt->max); |
| 396 | seq_time(m, lt->total); |
Peter Zijlstra | 838cc7b | 2013-11-06 17:42:30 +0100 | [diff] [blame] | 397 | seq_time(m, lt->nr ? div_s64(lt->total, lt->nr) : 0); |
Peter Zijlstra | c46261d | 2007-07-19 01:48:57 -0700 | [diff] [blame] | 398 | } |
| 399 | |
| 400 | static void seq_stats(struct seq_file *m, struct lock_stat_data *data) |
| 401 | { |
Bart Van Assche | 364f6af | 2019-07-22 11:24:40 -0700 | [diff] [blame^] | 402 | const struct lockdep_subclass_key *ckey; |
Peter Zijlstra | c46261d | 2007-07-19 01:48:57 -0700 | [diff] [blame] | 403 | struct lock_class_stats *stats; |
Peter Zijlstra | cee34d8 | 2015-06-02 12:50:13 +0200 | [diff] [blame] | 404 | struct lock_class *class; |
| 405 | const char *cname; |
Peter Zijlstra | c46261d | 2007-07-19 01:48:57 -0700 | [diff] [blame] | 406 | int i, namelen; |
Peter Zijlstra | cee34d8 | 2015-06-02 12:50:13 +0200 | [diff] [blame] | 407 | char name[39]; |
Peter Zijlstra | c46261d | 2007-07-19 01:48:57 -0700 | [diff] [blame] | 408 | |
| 409 | class = data->class; |
| 410 | stats = &data->stats; |
| 411 | |
Peter Zijlstra | d38e1d5 | 2007-07-19 01:49:01 -0700 | [diff] [blame] | 412 | namelen = 38; |
| 413 | if (class->name_version > 1) |
| 414 | namelen -= 2; /* XXX truncates versions > 9 */ |
| 415 | if (class->subclass) |
| 416 | namelen -= 2; |
| 417 | |
Peter Zijlstra | cee34d8 | 2015-06-02 12:50:13 +0200 | [diff] [blame] | 418 | rcu_read_lock_sched(); |
| 419 | cname = rcu_dereference_sched(class->name); |
| 420 | ckey = rcu_dereference_sched(class->key); |
| 421 | |
| 422 | if (!cname && !ckey) { |
| 423 | rcu_read_unlock_sched(); |
| 424 | return; |
| 425 | |
| 426 | } else if (!cname) { |
Peter Zijlstra | d38e1d5 | 2007-07-19 01:49:01 -0700 | [diff] [blame] | 427 | char str[KSYM_NAME_LEN]; |
| 428 | const char *key_name; |
| 429 | |
Peter Zijlstra | cee34d8 | 2015-06-02 12:50:13 +0200 | [diff] [blame] | 430 | key_name = __get_key_name(ckey, str); |
Peter Zijlstra | d38e1d5 | 2007-07-19 01:49:01 -0700 | [diff] [blame] | 431 | snprintf(name, namelen, "%s", key_name); |
| 432 | } else { |
Peter Zijlstra | cee34d8 | 2015-06-02 12:50:13 +0200 | [diff] [blame] | 433 | snprintf(name, namelen, "%s", cname); |
Peter Zijlstra | d38e1d5 | 2007-07-19 01:49:01 -0700 | [diff] [blame] | 434 | } |
Peter Zijlstra | cee34d8 | 2015-06-02 12:50:13 +0200 | [diff] [blame] | 435 | rcu_read_unlock_sched(); |
| 436 | |
Peter Zijlstra | c46261d | 2007-07-19 01:48:57 -0700 | [diff] [blame] | 437 | namelen = strlen(name); |
Peter Zijlstra | d38e1d5 | 2007-07-19 01:49:01 -0700 | [diff] [blame] | 438 | if (class->name_version > 1) { |
| 439 | snprintf(name+namelen, 3, "#%d", class->name_version); |
| 440 | namelen += 2; |
| 441 | } |
| 442 | if (class->subclass) { |
| 443 | snprintf(name+namelen, 3, "/%d", class->subclass); |
| 444 | namelen += 2; |
| 445 | } |
Peter Zijlstra | c46261d | 2007-07-19 01:48:57 -0700 | [diff] [blame] | 446 | |
| 447 | if (stats->write_holdtime.nr) { |
| 448 | if (stats->read_holdtime.nr) |
| 449 | seq_printf(m, "%38s-W:", name); |
| 450 | else |
| 451 | seq_printf(m, "%40s:", name); |
| 452 | |
Peter Zijlstra | 9664567 | 2007-07-19 01:49:00 -0700 | [diff] [blame] | 453 | seq_printf(m, "%14lu ", stats->bounces[bounce_contended_write]); |
Peter Zijlstra | c46261d | 2007-07-19 01:48:57 -0700 | [diff] [blame] | 454 | seq_lock_time(m, &stats->write_waittime); |
Peter Zijlstra | 9664567 | 2007-07-19 01:49:00 -0700 | [diff] [blame] | 455 | seq_printf(m, " %14lu ", stats->bounces[bounce_acquired_write]); |
Peter Zijlstra | c46261d | 2007-07-19 01:48:57 -0700 | [diff] [blame] | 456 | seq_lock_time(m, &stats->write_holdtime); |
| 457 | seq_puts(m, "\n"); |
| 458 | } |
| 459 | |
| 460 | if (stats->read_holdtime.nr) { |
| 461 | seq_printf(m, "%38s-R:", name); |
Peter Zijlstra | 9664567 | 2007-07-19 01:49:00 -0700 | [diff] [blame] | 462 | seq_printf(m, "%14lu ", stats->bounces[bounce_contended_read]); |
Peter Zijlstra | c46261d | 2007-07-19 01:48:57 -0700 | [diff] [blame] | 463 | seq_lock_time(m, &stats->read_waittime); |
Peter Zijlstra | 9664567 | 2007-07-19 01:49:00 -0700 | [diff] [blame] | 464 | seq_printf(m, " %14lu ", stats->bounces[bounce_acquired_read]); |
Peter Zijlstra | c46261d | 2007-07-19 01:48:57 -0700 | [diff] [blame] | 465 | seq_lock_time(m, &stats->read_holdtime); |
| 466 | seq_puts(m, "\n"); |
| 467 | } |
| 468 | |
| 469 | if (stats->read_waittime.nr + stats->write_waittime.nr == 0) |
| 470 | return; |
| 471 | |
| 472 | if (stats->read_holdtime.nr) |
| 473 | namelen += 2; |
| 474 | |
Peter Zijlstra | c7e78cf | 2008-10-16 23:17:09 +0200 | [diff] [blame] | 475 | for (i = 0; i < LOCKSTAT_POINTS; i++) { |
Peter Zijlstra | c46261d | 2007-07-19 01:48:57 -0700 | [diff] [blame] | 476 | char ip[32]; |
| 477 | |
| 478 | if (class->contention_point[i] == 0) |
| 479 | break; |
| 480 | |
| 481 | if (!i) |
| 482 | seq_line(m, '-', 40-namelen, namelen); |
| 483 | |
Peter Zijlstra | c46261d | 2007-07-19 01:48:57 -0700 | [diff] [blame] | 484 | snprintf(ip, sizeof(ip), "[<%p>]", |
| 485 | (void *)class->contention_point[i]); |
Joe Perches | 3cf9b85 | 2010-11-05 16:12:38 -0700 | [diff] [blame] | 486 | seq_printf(m, "%40s %14lu %29s %pS\n", |
| 487 | name, stats->contention_point[i], |
| 488 | ip, (void *)class->contention_point[i]); |
Peter Zijlstra | c46261d | 2007-07-19 01:48:57 -0700 | [diff] [blame] | 489 | } |
Peter Zijlstra | c7e78cf | 2008-10-16 23:17:09 +0200 | [diff] [blame] | 490 | for (i = 0; i < LOCKSTAT_POINTS; i++) { |
Peter Zijlstra | c7e78cf | 2008-10-16 23:17:09 +0200 | [diff] [blame] | 491 | char ip[32]; |
| 492 | |
| 493 | if (class->contending_point[i] == 0) |
| 494 | break; |
| 495 | |
| 496 | if (!i) |
| 497 | seq_line(m, '-', 40-namelen, namelen); |
| 498 | |
Peter Zijlstra | c7e78cf | 2008-10-16 23:17:09 +0200 | [diff] [blame] | 499 | snprintf(ip, sizeof(ip), "[<%p>]", |
| 500 | (void *)class->contending_point[i]); |
Joe Perches | 3cf9b85 | 2010-11-05 16:12:38 -0700 | [diff] [blame] | 501 | seq_printf(m, "%40s %14lu %29s %pS\n", |
| 502 | name, stats->contending_point[i], |
| 503 | ip, (void *)class->contending_point[i]); |
Peter Zijlstra | c7e78cf | 2008-10-16 23:17:09 +0200 | [diff] [blame] | 504 | } |
Peter Zijlstra | c46261d | 2007-07-19 01:48:57 -0700 | [diff] [blame] | 505 | if (i) { |
| 506 | seq_puts(m, "\n"); |
Davidlohr Bueso | 1232e38 | 2013-10-08 20:37:16 -0700 | [diff] [blame] | 507 | seq_line(m, '.', 0, 40 + 1 + 12 * (14 + 1)); |
Peter Zijlstra | c46261d | 2007-07-19 01:48:57 -0700 | [diff] [blame] | 508 | seq_puts(m, "\n"); |
| 509 | } |
| 510 | } |
| 511 | |
| 512 | static void seq_header(struct seq_file *m) |
| 513 | { |
Davidlohr Bueso | 1232e38 | 2013-10-08 20:37:16 -0700 | [diff] [blame] | 514 | seq_puts(m, "lock_stat version 0.4\n"); |
Peter Zijlstra | 9833f8c | 2009-02-14 16:59:04 +0100 | [diff] [blame] | 515 | |
| 516 | if (unlikely(!debug_locks)) |
| 517 | seq_printf(m, "*WARNING* lock debugging disabled!! - possibly due to a lockdep warning\n"); |
| 518 | |
Davidlohr Bueso | 1232e38 | 2013-10-08 20:37:16 -0700 | [diff] [blame] | 519 | seq_line(m, '-', 0, 40 + 1 + 12 * (14 + 1)); |
| 520 | seq_printf(m, "%40s %14s %14s %14s %14s %14s %14s %14s %14s %14s %14s " |
Peter Zijlstra | 9664567 | 2007-07-19 01:49:00 -0700 | [diff] [blame] | 521 | "%14s %14s\n", |
Peter Zijlstra | c46261d | 2007-07-19 01:48:57 -0700 | [diff] [blame] | 522 | "class name", |
Peter Zijlstra | 9664567 | 2007-07-19 01:49:00 -0700 | [diff] [blame] | 523 | "con-bounces", |
Peter Zijlstra | c46261d | 2007-07-19 01:48:57 -0700 | [diff] [blame] | 524 | "contentions", |
| 525 | "waittime-min", |
| 526 | "waittime-max", |
| 527 | "waittime-total", |
Davidlohr Bueso | 1232e38 | 2013-10-08 20:37:16 -0700 | [diff] [blame] | 528 | "waittime-avg", |
Peter Zijlstra | 9664567 | 2007-07-19 01:49:00 -0700 | [diff] [blame] | 529 | "acq-bounces", |
Peter Zijlstra | c46261d | 2007-07-19 01:48:57 -0700 | [diff] [blame] | 530 | "acquisitions", |
| 531 | "holdtime-min", |
| 532 | "holdtime-max", |
Davidlohr Bueso | 1232e38 | 2013-10-08 20:37:16 -0700 | [diff] [blame] | 533 | "holdtime-total", |
| 534 | "holdtime-avg"); |
| 535 | seq_line(m, '-', 0, 40 + 1 + 12 * (14 + 1)); |
Peter Zijlstra | c46261d | 2007-07-19 01:48:57 -0700 | [diff] [blame] | 536 | seq_printf(m, "\n"); |
| 537 | } |
| 538 | |
| 539 | static void *ls_start(struct seq_file *m, loff_t *pos) |
| 540 | { |
| 541 | struct lock_stat_seq *data = m->private; |
Li Zefan | 96004bb | 2009-08-17 13:40:59 +0800 | [diff] [blame] | 542 | struct lock_stat_data *iter; |
Peter Zijlstra | c46261d | 2007-07-19 01:48:57 -0700 | [diff] [blame] | 543 | |
Tim Pepper | 94c61c0 | 2007-10-11 22:11:11 +0200 | [diff] [blame] | 544 | if (*pos == 0) |
| 545 | return SEQ_START_TOKEN; |
Peter Zijlstra | c46261d | 2007-07-19 01:48:57 -0700 | [diff] [blame] | 546 | |
Li Zefan | 96004bb | 2009-08-17 13:40:59 +0800 | [diff] [blame] | 547 | iter = data->stats + (*pos - 1); |
| 548 | if (iter >= data->iter_end) |
| 549 | iter = NULL; |
Peter Zijlstra | 4b32d0a | 2007-07-19 01:48:59 -0700 | [diff] [blame] | 550 | |
Li Zefan | 96004bb | 2009-08-17 13:40:59 +0800 | [diff] [blame] | 551 | return iter; |
Peter Zijlstra | c46261d | 2007-07-19 01:48:57 -0700 | [diff] [blame] | 552 | } |
| 553 | |
| 554 | static void *ls_next(struct seq_file *m, void *v, loff_t *pos) |
| 555 | { |
Peter Zijlstra | c46261d | 2007-07-19 01:48:57 -0700 | [diff] [blame] | 556 | (*pos)++; |
Li Zefan | 96004bb | 2009-08-17 13:40:59 +0800 | [diff] [blame] | 557 | return ls_start(m, pos); |
Peter Zijlstra | c46261d | 2007-07-19 01:48:57 -0700 | [diff] [blame] | 558 | } |
| 559 | |
| 560 | static void ls_stop(struct seq_file *m, void *v) |
| 561 | { |
| 562 | } |
| 563 | |
| 564 | static int ls_show(struct seq_file *m, void *v) |
| 565 | { |
Tim Pepper | 94c61c0 | 2007-10-11 22:11:11 +0200 | [diff] [blame] | 566 | if (v == SEQ_START_TOKEN) |
| 567 | seq_header(m); |
| 568 | else |
| 569 | seq_stats(m, v); |
Peter Zijlstra | c46261d | 2007-07-19 01:48:57 -0700 | [diff] [blame] | 570 | |
Peter Zijlstra | c46261d | 2007-07-19 01:48:57 -0700 | [diff] [blame] | 571 | return 0; |
| 572 | } |
| 573 | |
James Morris | 88e9d34 | 2009-09-22 16:43:43 -0700 | [diff] [blame] | 574 | static const struct seq_operations lockstat_ops = { |
Peter Zijlstra | c46261d | 2007-07-19 01:48:57 -0700 | [diff] [blame] | 575 | .start = ls_start, |
| 576 | .next = ls_next, |
| 577 | .stop = ls_stop, |
| 578 | .show = ls_show, |
| 579 | }; |
| 580 | |
| 581 | static int lock_stat_open(struct inode *inode, struct file *file) |
| 582 | { |
| 583 | int res; |
| 584 | struct lock_class *class; |
| 585 | struct lock_stat_seq *data = vmalloc(sizeof(struct lock_stat_seq)); |
| 586 | |
| 587 | if (!data) |
| 588 | return -ENOMEM; |
| 589 | |
| 590 | res = seq_open(file, &lockstat_ops); |
| 591 | if (!res) { |
| 592 | struct lock_stat_data *iter = data->stats; |
| 593 | struct seq_file *m = file->private_data; |
| 594 | |
Peter Zijlstra | c46261d | 2007-07-19 01:48:57 -0700 | [diff] [blame] | 595 | list_for_each_entry(class, &all_lock_classes, lock_entry) { |
| 596 | iter->class = class; |
| 597 | iter->stats = lock_stats(class); |
| 598 | iter++; |
| 599 | } |
| 600 | data->iter_end = iter; |
| 601 | |
Li Zefan | 96004bb | 2009-08-17 13:40:59 +0800 | [diff] [blame] | 602 | sort(data->stats, data->iter_end - data->stats, |
Peter Zijlstra | c46261d | 2007-07-19 01:48:57 -0700 | [diff] [blame] | 603 | sizeof(struct lock_stat_data), |
| 604 | lock_stat_cmp, NULL); |
| 605 | |
| 606 | m->private = data; |
| 607 | } else |
| 608 | vfree(data); |
| 609 | |
| 610 | return res; |
| 611 | } |
| 612 | |
| 613 | static ssize_t lock_stat_write(struct file *file, const char __user *buf, |
| 614 | size_t count, loff_t *ppos) |
| 615 | { |
| 616 | struct lock_class *class; |
| 617 | char c; |
| 618 | |
| 619 | if (count) { |
| 620 | if (get_user(c, buf)) |
| 621 | return -EFAULT; |
| 622 | |
| 623 | if (c != '0') |
| 624 | return count; |
| 625 | |
| 626 | list_for_each_entry(class, &all_lock_classes, lock_entry) |
| 627 | clear_lock_stats(class); |
| 628 | } |
| 629 | return count; |
| 630 | } |
| 631 | |
| 632 | static int lock_stat_release(struct inode *inode, struct file *file) |
| 633 | { |
| 634 | struct seq_file *seq = file->private_data; |
| 635 | |
| 636 | vfree(seq->private); |
Peter Zijlstra | c46261d | 2007-07-19 01:48:57 -0700 | [diff] [blame] | 637 | return seq_release(inode, file); |
| 638 | } |
| 639 | |
| 640 | static const struct file_operations proc_lock_stat_operations = { |
| 641 | .open = lock_stat_open, |
| 642 | .write = lock_stat_write, |
| 643 | .read = seq_read, |
| 644 | .llseek = seq_lseek, |
| 645 | .release = lock_stat_release, |
| 646 | }; |
| 647 | #endif /* CONFIG_LOCK_STAT */ |
| 648 | |
Ingo Molnar | a8f24a3 | 2006-07-03 00:24:52 -0700 | [diff] [blame] | 649 | static int __init lockdep_proc_init(void) |
| 650 | { |
Christoph Hellwig | fddda2b | 2018-04-13 19:44:18 +0200 | [diff] [blame] | 651 | proc_create_seq("lockdep", S_IRUSR, NULL, &lockdep_ops); |
Huang, Ying | cd1a28e | 2008-06-23 11:20:54 +0800 | [diff] [blame] | 652 | #ifdef CONFIG_PROVE_LOCKING |
Christoph Hellwig | fddda2b | 2018-04-13 19:44:18 +0200 | [diff] [blame] | 653 | proc_create_seq("lockdep_chains", S_IRUSR, NULL, &lockdep_chains_ops); |
Huang, Ying | cd1a28e | 2008-06-23 11:20:54 +0800 | [diff] [blame] | 654 | #endif |
Christoph Hellwig | 3f3942a | 2018-05-15 15:57:23 +0200 | [diff] [blame] | 655 | proc_create_single("lockdep_stats", S_IRUSR, NULL, lockdep_stats_show); |
Peter Zijlstra | c46261d | 2007-07-19 01:48:57 -0700 | [diff] [blame] | 656 | #ifdef CONFIG_LOCK_STAT |
Li Zefan | 9795447 | 2009-08-07 16:37:10 +0800 | [diff] [blame] | 657 | proc_create("lock_stat", S_IRUSR | S_IWUSR, NULL, |
| 658 | &proc_lock_stat_operations); |
Peter Zijlstra | c46261d | 2007-07-19 01:48:57 -0700 | [diff] [blame] | 659 | #endif |
| 660 | |
Ingo Molnar | a8f24a3 | 2006-07-03 00:24:52 -0700 | [diff] [blame] | 661 | return 0; |
| 662 | } |
| 663 | |
| 664 | __initcall(lockdep_proc_init); |
| 665 | |