diff options
Diffstat (limited to 'kernel/rcutree_trace.c')
-rw-r--r-- | kernel/rcutree_trace.c | 88 |
1 files changed, 47 insertions, 41 deletions
diff --git a/kernel/rcutree_trace.c b/kernel/rcutree_trace.c index fe1dcdbf1ca3..0ea1bff69727 100644 --- a/kernel/rcutree_trace.c +++ b/kernel/rcutree_trace.c | |||
@@ -43,6 +43,7 @@ | |||
43 | #include <linux/debugfs.h> | 43 | #include <linux/debugfs.h> |
44 | #include <linux/seq_file.h> | 44 | #include <linux/seq_file.h> |
45 | 45 | ||
46 | #define RCU_TREE_NONCORE | ||
46 | #include "rcutree.h" | 47 | #include "rcutree.h" |
47 | 48 | ||
48 | static void print_one_rcu_data(struct seq_file *m, struct rcu_data *rdp) | 49 | static void print_one_rcu_data(struct seq_file *m, struct rcu_data *rdp) |
@@ -76,8 +77,12 @@ static void print_one_rcu_data(struct seq_file *m, struct rcu_data *rdp) | |||
76 | 77 | ||
77 | static int show_rcudata(struct seq_file *m, void *unused) | 78 | static int show_rcudata(struct seq_file *m, void *unused) |
78 | { | 79 | { |
79 | seq_puts(m, "rcu:\n"); | 80 | #ifdef CONFIG_TREE_PREEMPT_RCU |
80 | PRINT_RCU_DATA(rcu_data, print_one_rcu_data, m); | 81 | seq_puts(m, "rcu_preempt:\n"); |
82 | PRINT_RCU_DATA(rcu_preempt_data, print_one_rcu_data, m); | ||
83 | #endif /* #ifdef CONFIG_TREE_PREEMPT_RCU */ | ||
84 | seq_puts(m, "rcu_sched:\n"); | ||
85 | PRINT_RCU_DATA(rcu_sched_data, print_one_rcu_data, m); | ||
81 | seq_puts(m, "rcu_bh:\n"); | 86 | seq_puts(m, "rcu_bh:\n"); |
82 | PRINT_RCU_DATA(rcu_bh_data, print_one_rcu_data, m); | 87 | PRINT_RCU_DATA(rcu_bh_data, print_one_rcu_data, m); |
83 | return 0; | 88 | return 0; |
@@ -102,7 +107,7 @@ static void print_one_rcu_data_csv(struct seq_file *m, struct rcu_data *rdp) | |||
102 | return; | 107 | return; |
103 | seq_printf(m, "%d,%s,%ld,%ld,%d,%ld,%d", | 108 | seq_printf(m, "%d,%s,%ld,%ld,%d,%ld,%d", |
104 | rdp->cpu, | 109 | rdp->cpu, |
105 | cpu_is_offline(rdp->cpu) ? "\"Y\"" : "\"N\"", | 110 | cpu_is_offline(rdp->cpu) ? "\"N\"" : "\"Y\"", |
106 | rdp->completed, rdp->gpnum, | 111 | rdp->completed, rdp->gpnum, |
107 | rdp->passed_quiesc, rdp->passed_quiesc_completed, | 112 | rdp->passed_quiesc, rdp->passed_quiesc_completed, |
108 | rdp->qs_pending); | 113 | rdp->qs_pending); |
@@ -124,8 +129,12 @@ static int show_rcudata_csv(struct seq_file *m, void *unused) | |||
124 | seq_puts(m, "\"dt\",\"dt nesting\",\"dn\",\"df\","); | 129 | seq_puts(m, "\"dt\",\"dt nesting\",\"dn\",\"df\","); |
125 | #endif /* #ifdef CONFIG_NO_HZ */ | 130 | #endif /* #ifdef CONFIG_NO_HZ */ |
126 | seq_puts(m, "\"of\",\"ri\",\"ql\",\"b\"\n"); | 131 | seq_puts(m, "\"of\",\"ri\",\"ql\",\"b\"\n"); |
127 | seq_puts(m, "\"rcu:\"\n"); | 132 | #ifdef CONFIG_TREE_PREEMPT_RCU |
128 | PRINT_RCU_DATA(rcu_data, print_one_rcu_data_csv, m); | 133 | seq_puts(m, "\"rcu_preempt:\"\n"); |
134 | PRINT_RCU_DATA(rcu_preempt_data, print_one_rcu_data_csv, m); | ||
135 | #endif /* #ifdef CONFIG_TREE_PREEMPT_RCU */ | ||
136 | seq_puts(m, "\"rcu_sched:\"\n"); | ||
137 | PRINT_RCU_DATA(rcu_sched_data, print_one_rcu_data_csv, m); | ||
129 | seq_puts(m, "\"rcu_bh:\"\n"); | 138 | seq_puts(m, "\"rcu_bh:\"\n"); |
130 | PRINT_RCU_DATA(rcu_bh_data, print_one_rcu_data_csv, m); | 139 | PRINT_RCU_DATA(rcu_bh_data, print_one_rcu_data_csv, m); |
131 | return 0; | 140 | return 0; |
@@ -171,8 +180,12 @@ static void print_one_rcu_state(struct seq_file *m, struct rcu_state *rsp) | |||
171 | 180 | ||
172 | static int show_rcuhier(struct seq_file *m, void *unused) | 181 | static int show_rcuhier(struct seq_file *m, void *unused) |
173 | { | 182 | { |
174 | seq_puts(m, "rcu:\n"); | 183 | #ifdef CONFIG_TREE_PREEMPT_RCU |
175 | print_one_rcu_state(m, &rcu_state); | 184 | seq_puts(m, "rcu_preempt:\n"); |
185 | print_one_rcu_state(m, &rcu_preempt_state); | ||
186 | #endif /* #ifdef CONFIG_TREE_PREEMPT_RCU */ | ||
187 | seq_puts(m, "rcu_sched:\n"); | ||
188 | print_one_rcu_state(m, &rcu_sched_state); | ||
176 | seq_puts(m, "rcu_bh:\n"); | 189 | seq_puts(m, "rcu_bh:\n"); |
177 | print_one_rcu_state(m, &rcu_bh_state); | 190 | print_one_rcu_state(m, &rcu_bh_state); |
178 | return 0; | 191 | return 0; |
@@ -193,8 +206,12 @@ static struct file_operations rcuhier_fops = { | |||
193 | 206 | ||
194 | static int show_rcugp(struct seq_file *m, void *unused) | 207 | static int show_rcugp(struct seq_file *m, void *unused) |
195 | { | 208 | { |
196 | seq_printf(m, "rcu: completed=%ld gpnum=%ld\n", | 209 | #ifdef CONFIG_TREE_PREEMPT_RCU |
197 | rcu_state.completed, rcu_state.gpnum); | 210 | seq_printf(m, "rcu_preempt: completed=%ld gpnum=%ld\n", |
211 | rcu_preempt_state.completed, rcu_preempt_state.gpnum); | ||
212 | #endif /* #ifdef CONFIG_TREE_PREEMPT_RCU */ | ||
213 | seq_printf(m, "rcu_sched: completed=%ld gpnum=%ld\n", | ||
214 | rcu_sched_state.completed, rcu_sched_state.gpnum); | ||
198 | seq_printf(m, "rcu_bh: completed=%ld gpnum=%ld\n", | 215 | seq_printf(m, "rcu_bh: completed=%ld gpnum=%ld\n", |
199 | rcu_bh_state.completed, rcu_bh_state.gpnum); | 216 | rcu_bh_state.completed, rcu_bh_state.gpnum); |
200 | return 0; | 217 | return 0; |
@@ -243,8 +260,12 @@ static void print_rcu_pendings(struct seq_file *m, struct rcu_state *rsp) | |||
243 | 260 | ||
244 | static int show_rcu_pending(struct seq_file *m, void *unused) | 261 | static int show_rcu_pending(struct seq_file *m, void *unused) |
245 | { | 262 | { |
246 | seq_puts(m, "rcu:\n"); | 263 | #ifdef CONFIG_TREE_PREEMPT_RCU |
247 | print_rcu_pendings(m, &rcu_state); | 264 | seq_puts(m, "rcu_preempt:\n"); |
265 | print_rcu_pendings(m, &rcu_preempt_state); | ||
266 | #endif /* #ifdef CONFIG_TREE_PREEMPT_RCU */ | ||
267 | seq_puts(m, "rcu_sched:\n"); | ||
268 | print_rcu_pendings(m, &rcu_sched_state); | ||
248 | seq_puts(m, "rcu_bh:\n"); | 269 | seq_puts(m, "rcu_bh:\n"); |
249 | print_rcu_pendings(m, &rcu_bh_state); | 270 | print_rcu_pendings(m, &rcu_bh_state); |
250 | return 0; | 271 | return 0; |
@@ -264,62 +285,47 @@ static struct file_operations rcu_pending_fops = { | |||
264 | }; | 285 | }; |
265 | 286 | ||
266 | static struct dentry *rcudir; | 287 | static struct dentry *rcudir; |
267 | static struct dentry *datadir; | ||
268 | static struct dentry *datadir_csv; | ||
269 | static struct dentry *gpdir; | ||
270 | static struct dentry *hierdir; | ||
271 | static struct dentry *rcu_pendingdir; | ||
272 | 288 | ||
273 | static int __init rcuclassic_trace_init(void) | 289 | static int __init rcuclassic_trace_init(void) |
274 | { | 290 | { |
291 | struct dentry *retval; | ||
292 | |||
275 | rcudir = debugfs_create_dir("rcu", NULL); | 293 | rcudir = debugfs_create_dir("rcu", NULL); |
276 | if (!rcudir) | 294 | if (!rcudir) |
277 | goto out; | 295 | goto free_out; |
278 | 296 | ||
279 | datadir = debugfs_create_file("rcudata", 0444, rcudir, | 297 | retval = debugfs_create_file("rcudata", 0444, rcudir, |
280 | NULL, &rcudata_fops); | 298 | NULL, &rcudata_fops); |
281 | if (!datadir) | 299 | if (!retval) |
282 | goto free_out; | 300 | goto free_out; |
283 | 301 | ||
284 | datadir_csv = debugfs_create_file("rcudata.csv", 0444, rcudir, | 302 | retval = debugfs_create_file("rcudata.csv", 0444, rcudir, |
285 | NULL, &rcudata_csv_fops); | 303 | NULL, &rcudata_csv_fops); |
286 | if (!datadir_csv) | 304 | if (!retval) |
287 | goto free_out; | 305 | goto free_out; |
288 | 306 | ||
289 | gpdir = debugfs_create_file("rcugp", 0444, rcudir, NULL, &rcugp_fops); | 307 | retval = debugfs_create_file("rcugp", 0444, rcudir, NULL, &rcugp_fops); |
290 | if (!gpdir) | 308 | if (!retval) |
291 | goto free_out; | 309 | goto free_out; |
292 | 310 | ||
293 | hierdir = debugfs_create_file("rcuhier", 0444, rcudir, | 311 | retval = debugfs_create_file("rcuhier", 0444, rcudir, |
294 | NULL, &rcuhier_fops); | 312 | NULL, &rcuhier_fops); |
295 | if (!hierdir) | 313 | if (!retval) |
296 | goto free_out; | 314 | goto free_out; |
297 | 315 | ||
298 | rcu_pendingdir = debugfs_create_file("rcu_pending", 0444, rcudir, | 316 | retval = debugfs_create_file("rcu_pending", 0444, rcudir, |
299 | NULL, &rcu_pending_fops); | 317 | NULL, &rcu_pending_fops); |
300 | if (!rcu_pendingdir) | 318 | if (!retval) |
301 | goto free_out; | 319 | goto free_out; |
302 | return 0; | 320 | return 0; |
303 | free_out: | 321 | free_out: |
304 | if (datadir) | 322 | debugfs_remove_recursive(rcudir); |
305 | debugfs_remove(datadir); | ||
306 | if (datadir_csv) | ||
307 | debugfs_remove(datadir_csv); | ||
308 | if (gpdir) | ||
309 | debugfs_remove(gpdir); | ||
310 | debugfs_remove(rcudir); | ||
311 | out: | ||
312 | return 1; | 323 | return 1; |
313 | } | 324 | } |
314 | 325 | ||
315 | static void __exit rcuclassic_trace_cleanup(void) | 326 | static void __exit rcuclassic_trace_cleanup(void) |
316 | { | 327 | { |
317 | debugfs_remove(datadir); | 328 | debugfs_remove_recursive(rcudir); |
318 | debugfs_remove(datadir_csv); | ||
319 | debugfs_remove(gpdir); | ||
320 | debugfs_remove(hierdir); | ||
321 | debugfs_remove(rcu_pendingdir); | ||
322 | debugfs_remove(rcudir); | ||
323 | } | 329 | } |
324 | 330 | ||
325 | 331 | ||