blob: afd262f912622453b6a6425419d47d8dafa72e43 [file] [log] [blame]
Paul E. McKenney64db4cf2008-12-18 21:55:32 +01001/*
2 * Read-Copy Update tracing for classic implementation
3 *
4 * This program is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License as published by
6 * the Free Software Foundation; either version 2 of the License, or
7 * (at your option) any later version.
8 *
9 * This program is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 * GNU General Public License for more details.
13 *
14 * You should have received a copy of the GNU General Public License
15 * along with this program; if not, write to the Free Software
16 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
17 *
18 * Copyright IBM Corporation, 2008
19 *
20 * Papers: http://www.rdrop.com/users/paulmck/RCU
21 *
22 * For detailed explanation of Read-Copy Update mechanism see -
Paul E. McKenneya71fca52009-09-18 10:28:19 -070023 * Documentation/RCU
Paul E. McKenney64db4cf2008-12-18 21:55:32 +010024 *
25 */
26#include <linux/types.h>
27#include <linux/kernel.h>
28#include <linux/init.h>
29#include <linux/spinlock.h>
30#include <linux/smp.h>
31#include <linux/rcupdate.h>
32#include <linux/interrupt.h>
33#include <linux/sched.h>
34#include <asm/atomic.h>
35#include <linux/bitops.h>
36#include <linux/module.h>
37#include <linux/completion.h>
38#include <linux/moduleparam.h>
39#include <linux/percpu.h>
40#include <linux/notifier.h>
41#include <linux/cpu.h>
42#include <linux/mutex.h>
43#include <linux/debugfs.h>
44#include <linux/seq_file.h>
45
Paul E. McKenney9f77da92009-08-22 13:56:45 -070046#define RCU_TREE_NONCORE
Ingo Molnar6258c4f2009-03-25 16:42:24 +010047#include "rcutree.h"
48
Paul E. McKenney64db4cf2008-12-18 21:55:32 +010049static void print_one_rcu_data(struct seq_file *m, struct rcu_data *rdp)
50{
51 if (!rdp->beenonline)
52 return;
Paul E. McKenney20133cf2010-02-22 17:05:01 -080053 seq_printf(m, "%3d%cc=%lu g=%lu pq=%d pqc=%lu qp=%d",
Paul E. McKenney64db4cf2008-12-18 21:55:32 +010054 rdp->cpu,
55 cpu_is_offline(rdp->cpu) ? '!' : ' ',
56 rdp->completed, rdp->gpnum,
57 rdp->passed_quiesc, rdp->passed_quiesc_completed,
Paul E. McKenneyef631b02009-04-13 21:31:16 -070058 rdp->qs_pending);
Paul E. McKenney64db4cf2008-12-18 21:55:32 +010059#ifdef CONFIG_NO_HZ
Paul E. McKenneye59fb312010-09-07 10:38:22 -070060 seq_printf(m, " dt=%d/%d/%d df=%lu",
61 atomic_read(&rdp->dynticks->dynticks),
Paul E. McKenney64db4cf2008-12-18 21:55:32 +010062 rdp->dynticks->dynticks_nesting,
Paul E. McKenneye59fb312010-09-07 10:38:22 -070063 rdp->dynticks->dynticks_nmi_nesting,
Paul E. McKenney64db4cf2008-12-18 21:55:32 +010064 rdp->dynticks_fqs);
65#endif /* #ifdef CONFIG_NO_HZ */
66 seq_printf(m, " of=%lu ri=%lu", rdp->offline_fqs, rdp->resched_ipi);
Paul E. McKenney0ac3d132011-03-28 15:47:07 -070067 seq_printf(m, " ql=%ld qs=%c%c%c%c b=%ld",
68 rdp->qlen,
69 ".N"[rdp->nxttail[RCU_NEXT_READY_TAIL] !=
70 rdp->nxttail[RCU_NEXT_TAIL]],
71 ".R"[rdp->nxttail[RCU_WAIT_TAIL] !=
72 rdp->nxttail[RCU_NEXT_READY_TAIL]],
73 ".W"[rdp->nxttail[RCU_DONE_TAIL] !=
74 rdp->nxttail[RCU_WAIT_TAIL]],
75 ".D"[&rdp->nxtlist != rdp->nxttail[RCU_DONE_TAIL]],
76 rdp->blimit);
Paul E. McKenney269dcc12010-09-07 14:23:09 -070077 seq_printf(m, " ci=%lu co=%lu ca=%lu\n",
78 rdp->n_cbs_invoked, rdp->n_cbs_orphaned, rdp->n_cbs_adopted);
Paul E. McKenney64db4cf2008-12-18 21:55:32 +010079}
80
81#define PRINT_RCU_DATA(name, func, m) \
82 do { \
83 int _p_r_d_i; \
84 \
85 for_each_possible_cpu(_p_r_d_i) \
86 func(m, &per_cpu(name, _p_r_d_i)); \
87 } while (0)
88
89static int show_rcudata(struct seq_file *m, void *unused)
90{
Paul E. McKenneyf41d9112009-08-22 13:56:52 -070091#ifdef CONFIG_TREE_PREEMPT_RCU
92 seq_puts(m, "rcu_preempt:\n");
93 PRINT_RCU_DATA(rcu_preempt_data, print_one_rcu_data, m);
94#endif /* #ifdef CONFIG_TREE_PREEMPT_RCU */
Paul E. McKenneyd6714c22009-08-22 13:56:46 -070095 seq_puts(m, "rcu_sched:\n");
96 PRINT_RCU_DATA(rcu_sched_data, print_one_rcu_data, m);
Paul E. McKenney64db4cf2008-12-18 21:55:32 +010097 seq_puts(m, "rcu_bh:\n");
98 PRINT_RCU_DATA(rcu_bh_data, print_one_rcu_data, m);
99 return 0;
100}
101
102static int rcudata_open(struct inode *inode, struct file *file)
103{
104 return single_open(file, show_rcudata, NULL);
105}
106
Paul E. McKenney9b2619a2009-09-23 09:50:43 -0700107static const struct file_operations rcudata_fops = {
Paul E. McKenney64db4cf2008-12-18 21:55:32 +0100108 .owner = THIS_MODULE,
109 .open = rcudata_open,
110 .read = seq_read,
111 .llseek = seq_lseek,
112 .release = single_release,
113};
114
115static void print_one_rcu_data_csv(struct seq_file *m, struct rcu_data *rdp)
116{
117 if (!rdp->beenonline)
118 return;
Paul E. McKenney20133cf2010-02-22 17:05:01 -0800119 seq_printf(m, "%d,%s,%lu,%lu,%d,%lu,%d",
Paul E. McKenney64db4cf2008-12-18 21:55:32 +0100120 rdp->cpu,
Paul E. McKenney5699ed82009-08-22 13:56:48 -0700121 cpu_is_offline(rdp->cpu) ? "\"N\"" : "\"Y\"",
Paul E. McKenney64db4cf2008-12-18 21:55:32 +0100122 rdp->completed, rdp->gpnum,
123 rdp->passed_quiesc, rdp->passed_quiesc_completed,
Paul E. McKenneyef631b02009-04-13 21:31:16 -0700124 rdp->qs_pending);
Paul E. McKenney64db4cf2008-12-18 21:55:32 +0100125#ifdef CONFIG_NO_HZ
126 seq_printf(m, ",%d,%d,%d,%lu",
Paul E. McKenneye59fb312010-09-07 10:38:22 -0700127 atomic_read(&rdp->dynticks->dynticks),
Paul E. McKenney64db4cf2008-12-18 21:55:32 +0100128 rdp->dynticks->dynticks_nesting,
Paul E. McKenneye59fb312010-09-07 10:38:22 -0700129 rdp->dynticks->dynticks_nmi_nesting,
Paul E. McKenney64db4cf2008-12-18 21:55:32 +0100130 rdp->dynticks_fqs);
131#endif /* #ifdef CONFIG_NO_HZ */
132 seq_printf(m, ",%lu,%lu", rdp->offline_fqs, rdp->resched_ipi);
Paul E. McKenney0ac3d132011-03-28 15:47:07 -0700133 seq_printf(m, ",%ld,\"%c%c%c%c\",%ld", rdp->qlen,
134 ".N"[rdp->nxttail[RCU_NEXT_READY_TAIL] !=
135 rdp->nxttail[RCU_NEXT_TAIL]],
136 ".R"[rdp->nxttail[RCU_WAIT_TAIL] !=
137 rdp->nxttail[RCU_NEXT_READY_TAIL]],
138 ".W"[rdp->nxttail[RCU_DONE_TAIL] !=
139 rdp->nxttail[RCU_WAIT_TAIL]],
140 ".D"[&rdp->nxtlist != rdp->nxttail[RCU_DONE_TAIL]],
141 rdp->blimit);
Paul E. McKenney269dcc12010-09-07 14:23:09 -0700142 seq_printf(m, ",%lu,%lu,%lu\n",
143 rdp->n_cbs_invoked, rdp->n_cbs_orphaned, rdp->n_cbs_adopted);
Paul E. McKenney64db4cf2008-12-18 21:55:32 +0100144}
145
146static int show_rcudata_csv(struct seq_file *m, void *unused)
147{
Paul E. McKenneyef631b02009-04-13 21:31:16 -0700148 seq_puts(m, "\"CPU\",\"Online?\",\"c\",\"g\",\"pq\",\"pqc\",\"pq\",");
Paul E. McKenney64db4cf2008-12-18 21:55:32 +0100149#ifdef CONFIG_NO_HZ
Paul E. McKenneye59fb312010-09-07 10:38:22 -0700150 seq_puts(m, "\"dt\",\"dt nesting\",\"dt NMI nesting\",\"df\",");
Paul E. McKenney64db4cf2008-12-18 21:55:32 +0100151#endif /* #ifdef CONFIG_NO_HZ */
Paul E. McKenney269dcc12010-09-07 14:23:09 -0700152 seq_puts(m, "\"of\",\"ri\",\"ql\",\"b\",\"ci\",\"co\",\"ca\"\n");
Paul E. McKenneyf41d9112009-08-22 13:56:52 -0700153#ifdef CONFIG_TREE_PREEMPT_RCU
154 seq_puts(m, "\"rcu_preempt:\"\n");
155 PRINT_RCU_DATA(rcu_preempt_data, print_one_rcu_data_csv, m);
156#endif /* #ifdef CONFIG_TREE_PREEMPT_RCU */
Paul E. McKenneyd6714c22009-08-22 13:56:46 -0700157 seq_puts(m, "\"rcu_sched:\"\n");
158 PRINT_RCU_DATA(rcu_sched_data, print_one_rcu_data_csv, m);
Paul E. McKenney64db4cf2008-12-18 21:55:32 +0100159 seq_puts(m, "\"rcu_bh:\"\n");
160 PRINT_RCU_DATA(rcu_bh_data, print_one_rcu_data_csv, m);
161 return 0;
162}
163
164static int rcudata_csv_open(struct inode *inode, struct file *file)
165{
166 return single_open(file, show_rcudata_csv, NULL);
167}
168
Paul E. McKenney9b2619a2009-09-23 09:50:43 -0700169static const struct file_operations rcudata_csv_fops = {
Paul E. McKenney64db4cf2008-12-18 21:55:32 +0100170 .owner = THIS_MODULE,
171 .open = rcudata_csv_open,
172 .read = seq_read,
173 .llseek = seq_lseek,
174 .release = single_release,
175};
176
Paul E. McKenney0ea1f2e2011-02-22 13:42:43 -0800177#ifdef CONFIG_RCU_BOOST
178
179static void print_one_rcu_node_boost(struct seq_file *m, struct rcu_node *rnp)
180{
181 seq_printf(m, "%d:%d tasks=%c%c%c%c ntb=%lu neb=%lu nnb=%lu "
182 "j=%04x bt=%04x\n",
183 rnp->grplo, rnp->grphi,
184 "T."[list_empty(&rnp->blkd_tasks)],
185 "N."[!rnp->gp_tasks],
186 "E."[!rnp->exp_tasks],
187 "B."[!rnp->boost_tasks],
188 rnp->n_tasks_boosted, rnp->n_exp_boosts,
189 rnp->n_normal_boosts,
190 (int)(jiffies & 0xffff),
191 (int)(rnp->boost_time & 0xffff));
192 seq_printf(m, "%s: nt=%lu egt=%lu bt=%lu nb=%lu ny=%lu nos=%lu\n",
193 " balk",
194 rnp->n_balk_blkd_tasks,
195 rnp->n_balk_exp_gp_tasks,
196 rnp->n_balk_boost_tasks,
197 rnp->n_balk_notblocked,
198 rnp->n_balk_notyet,
199 rnp->n_balk_nos);
200}
201
202static int show_rcu_node_boost(struct seq_file *m, void *unused)
203{
204 struct rcu_node *rnp;
205
206 rcu_for_each_leaf_node(&rcu_preempt_state, rnp)
207 print_one_rcu_node_boost(m, rnp);
208 return 0;
209}
210
211static int rcu_node_boost_open(struct inode *inode, struct file *file)
212{
213 return single_open(file, show_rcu_node_boost, NULL);
214}
215
216static const struct file_operations rcu_node_boost_fops = {
217 .owner = THIS_MODULE,
218 .open = rcu_node_boost_open,
219 .read = seq_read,
220 .llseek = seq_lseek,
221 .release = single_release,
222};
223
224/*
225 * Create the rcuboost debugfs entry. Standard error return.
226 */
227static int rcu_boost_trace_create_file(struct dentry *rcudir)
228{
229 return !debugfs_create_file("rcuboost", 0444, rcudir, NULL,
230 &rcu_node_boost_fops);
231}
232
233#else /* #ifdef CONFIG_RCU_BOOST */
234
235static int rcu_boost_trace_create_file(struct dentry *rcudir)
236{
237 return 0; /* There cannot be an error if we didn't create it! */
238}
239
240#endif /* #else #ifdef CONFIG_RCU_BOOST */
241
Paul E. McKenney64db4cf2008-12-18 21:55:32 +0100242static void print_one_rcu_state(struct seq_file *m, struct rcu_state *rsp)
243{
Paul E. McKenney20133cf2010-02-22 17:05:01 -0800244 unsigned long gpnum;
Paul E. McKenney64db4cf2008-12-18 21:55:32 +0100245 int level = 0;
246 struct rcu_node *rnp;
247
Paul E. McKenney3397e042009-10-14 16:36:38 -0700248 gpnum = rsp->gpnum;
Paul E. McKenney20133cf2010-02-22 17:05:01 -0800249 seq_printf(m, "c=%lu g=%lu s=%d jfq=%ld j=%x "
Lai Jiangshan29494be2010-10-20 14:13:06 +0800250 "nfqs=%lu/nfqsng=%lu(%lu) fqlh=%lu\n",
Paul E. McKenney3397e042009-10-14 16:36:38 -0700251 rsp->completed, gpnum, rsp->signaled,
Paul E. McKenney64db4cf2008-12-18 21:55:32 +0100252 (long)(rsp->jiffies_force_qs - jiffies),
253 (int)(jiffies & 0xffff),
254 rsp->n_force_qs, rsp->n_force_qs_ngp,
255 rsp->n_force_qs - rsp->n_force_qs_ngp,
Lai Jiangshan29494be2010-10-20 14:13:06 +0800256 rsp->n_force_qs_lh);
Paul E. McKenney64db4cf2008-12-18 21:55:32 +0100257 for (rnp = &rsp->node[0]; rnp - &rsp->node[0] < NUM_RCU_NODES; rnp++) {
258 if (rnp->level != level) {
259 seq_puts(m, "\n");
260 level = rnp->level;
261 }
Paul E. McKenney12f5f522010-11-29 21:56:39 -0800262 seq_printf(m, "%lx/%lx %c%c>%c %d:%d ^%d ",
Paul E. McKenney64db4cf2008-12-18 21:55:32 +0100263 rnp->qsmask, rnp->qsmaskinit,
Paul E. McKenney12f5f522010-11-29 21:56:39 -0800264 ".G"[rnp->gp_tasks != NULL],
265 ".E"[rnp->exp_tasks != NULL],
266 ".T"[!list_empty(&rnp->blkd_tasks)],
Paul E. McKenney64db4cf2008-12-18 21:55:32 +0100267 rnp->grplo, rnp->grphi, rnp->grpnum);
268 }
269 seq_puts(m, "\n");
270}
271
272static int show_rcuhier(struct seq_file *m, void *unused)
273{
Paul E. McKenneyf41d9112009-08-22 13:56:52 -0700274#ifdef CONFIG_TREE_PREEMPT_RCU
275 seq_puts(m, "rcu_preempt:\n");
276 print_one_rcu_state(m, &rcu_preempt_state);
277#endif /* #ifdef CONFIG_TREE_PREEMPT_RCU */
Paul E. McKenneyd6714c22009-08-22 13:56:46 -0700278 seq_puts(m, "rcu_sched:\n");
279 print_one_rcu_state(m, &rcu_sched_state);
Paul E. McKenney64db4cf2008-12-18 21:55:32 +0100280 seq_puts(m, "rcu_bh:\n");
281 print_one_rcu_state(m, &rcu_bh_state);
282 return 0;
283}
284
285static int rcuhier_open(struct inode *inode, struct file *file)
286{
287 return single_open(file, show_rcuhier, NULL);
288}
289
Paul E. McKenney9b2619a2009-09-23 09:50:43 -0700290static const struct file_operations rcuhier_fops = {
Paul E. McKenney64db4cf2008-12-18 21:55:32 +0100291 .owner = THIS_MODULE,
292 .open = rcuhier_open,
293 .read = seq_read,
294 .llseek = seq_lseek,
295 .release = single_release,
296};
297
298static int show_rcugp(struct seq_file *m, void *unused)
299{
Paul E. McKenneyf41d9112009-08-22 13:56:52 -0700300#ifdef CONFIG_TREE_PREEMPT_RCU
Paul E. McKenney20133cf2010-02-22 17:05:01 -0800301 seq_printf(m, "rcu_preempt: completed=%ld gpnum=%lu\n",
Paul E. McKenneyf41d9112009-08-22 13:56:52 -0700302 rcu_preempt_state.completed, rcu_preempt_state.gpnum);
303#endif /* #ifdef CONFIG_TREE_PREEMPT_RCU */
Paul E. McKenney20133cf2010-02-22 17:05:01 -0800304 seq_printf(m, "rcu_sched: completed=%ld gpnum=%lu\n",
Paul E. McKenneyd6714c22009-08-22 13:56:46 -0700305 rcu_sched_state.completed, rcu_sched_state.gpnum);
Paul E. McKenney20133cf2010-02-22 17:05:01 -0800306 seq_printf(m, "rcu_bh: completed=%ld gpnum=%lu\n",
Paul E. McKenney64db4cf2008-12-18 21:55:32 +0100307 rcu_bh_state.completed, rcu_bh_state.gpnum);
308 return 0;
309}
310
311static int rcugp_open(struct inode *inode, struct file *file)
312{
313 return single_open(file, show_rcugp, NULL);
314}
315
Paul E. McKenney9b2619a2009-09-23 09:50:43 -0700316static const struct file_operations rcugp_fops = {
Paul E. McKenney64db4cf2008-12-18 21:55:32 +0100317 .owner = THIS_MODULE,
318 .open = rcugp_open,
319 .read = seq_read,
320 .llseek = seq_lseek,
321 .release = single_release,
322};
323
Paul E. McKenney7ba5c842009-04-13 21:31:17 -0700324static void print_one_rcu_pending(struct seq_file *m, struct rcu_data *rdp)
325{
326 seq_printf(m, "%3d%cnp=%ld "
Paul E. McKenneyd21670a2010-04-14 17:39:26 -0700327 "qsp=%ld rpq=%ld cbr=%ld cng=%ld "
328 "gpc=%ld gps=%ld nf=%ld nn=%ld\n",
Paul E. McKenney7ba5c842009-04-13 21:31:17 -0700329 rdp->cpu,
330 cpu_is_offline(rdp->cpu) ? '!' : ' ',
331 rdp->n_rcu_pending,
332 rdp->n_rp_qs_pending,
Paul E. McKenneyd21670a2010-04-14 17:39:26 -0700333 rdp->n_rp_report_qs,
Paul E. McKenney7ba5c842009-04-13 21:31:17 -0700334 rdp->n_rp_cb_ready,
335 rdp->n_rp_cpu_needs_gp,
336 rdp->n_rp_gp_completed,
337 rdp->n_rp_gp_started,
338 rdp->n_rp_need_fqs,
339 rdp->n_rp_need_nothing);
340}
341
342static void print_rcu_pendings(struct seq_file *m, struct rcu_state *rsp)
343{
344 int cpu;
345 struct rcu_data *rdp;
346
347 for_each_possible_cpu(cpu) {
Lai Jiangshan394f99a2010-06-28 16:25:04 +0800348 rdp = per_cpu_ptr(rsp->rda, cpu);
Paul E. McKenney7ba5c842009-04-13 21:31:17 -0700349 if (rdp->beenonline)
350 print_one_rcu_pending(m, rdp);
351 }
352}
353
354static int show_rcu_pending(struct seq_file *m, void *unused)
355{
Paul E. McKenneyf41d9112009-08-22 13:56:52 -0700356#ifdef CONFIG_TREE_PREEMPT_RCU
357 seq_puts(m, "rcu_preempt:\n");
358 print_rcu_pendings(m, &rcu_preempt_state);
359#endif /* #ifdef CONFIG_TREE_PREEMPT_RCU */
Paul E. McKenneyd6714c22009-08-22 13:56:46 -0700360 seq_puts(m, "rcu_sched:\n");
361 print_rcu_pendings(m, &rcu_sched_state);
Paul E. McKenney7ba5c842009-04-13 21:31:17 -0700362 seq_puts(m, "rcu_bh:\n");
363 print_rcu_pendings(m, &rcu_bh_state);
364 return 0;
365}
366
367static int rcu_pending_open(struct inode *inode, struct file *file)
368{
369 return single_open(file, show_rcu_pending, NULL);
370}
371
Paul E. McKenney9b2619a2009-09-23 09:50:43 -0700372static const struct file_operations rcu_pending_fops = {
Paul E. McKenney7ba5c842009-04-13 21:31:17 -0700373 .owner = THIS_MODULE,
374 .open = rcu_pending_open,
375 .read = seq_read,
376 .llseek = seq_lseek,
377 .release = single_release,
378};
379
380static struct dentry *rcudir;
Paul E. McKenney7ba5c842009-04-13 21:31:17 -0700381
Paul E. McKenneydeb7a412010-09-30 21:33:32 -0700382static int __init rcutree_trace_init(void)
Paul E. McKenney64db4cf2008-12-18 21:55:32 +0100383{
Paul E. McKenney22f00b62009-08-22 13:56:50 -0700384 struct dentry *retval;
385
Paul E. McKenney64db4cf2008-12-18 21:55:32 +0100386 rcudir = debugfs_create_dir("rcu", NULL);
387 if (!rcudir)
Paul E. McKenney22f00b62009-08-22 13:56:50 -0700388 goto free_out;
Paul E. McKenney64db4cf2008-12-18 21:55:32 +0100389
Paul E. McKenney22f00b62009-08-22 13:56:50 -0700390 retval = debugfs_create_file("rcudata", 0444, rcudir,
Paul E. McKenney64db4cf2008-12-18 21:55:32 +0100391 NULL, &rcudata_fops);
Paul E. McKenney22f00b62009-08-22 13:56:50 -0700392 if (!retval)
Paul E. McKenney64db4cf2008-12-18 21:55:32 +0100393 goto free_out;
394
Paul E. McKenney22f00b62009-08-22 13:56:50 -0700395 retval = debugfs_create_file("rcudata.csv", 0444, rcudir,
Paul E. McKenney64db4cf2008-12-18 21:55:32 +0100396 NULL, &rcudata_csv_fops);
Paul E. McKenney22f00b62009-08-22 13:56:50 -0700397 if (!retval)
Paul E. McKenney64db4cf2008-12-18 21:55:32 +0100398 goto free_out;
399
Paul E. McKenney0ea1f2e2011-02-22 13:42:43 -0800400 if (rcu_boost_trace_create_file(rcudir))
401 goto free_out;
402
Paul E. McKenney22f00b62009-08-22 13:56:50 -0700403 retval = debugfs_create_file("rcugp", 0444, rcudir, NULL, &rcugp_fops);
404 if (!retval)
Paul E. McKenney64db4cf2008-12-18 21:55:32 +0100405 goto free_out;
406
Paul E. McKenney22f00b62009-08-22 13:56:50 -0700407 retval = debugfs_create_file("rcuhier", 0444, rcudir,
Paul E. McKenney64db4cf2008-12-18 21:55:32 +0100408 NULL, &rcuhier_fops);
Paul E. McKenney22f00b62009-08-22 13:56:50 -0700409 if (!retval)
Paul E. McKenney64db4cf2008-12-18 21:55:32 +0100410 goto free_out;
Paul E. McKenney7ba5c842009-04-13 21:31:17 -0700411
Paul E. McKenney22f00b62009-08-22 13:56:50 -0700412 retval = debugfs_create_file("rcu_pending", 0444, rcudir,
Paul E. McKenney7ba5c842009-04-13 21:31:17 -0700413 NULL, &rcu_pending_fops);
Paul E. McKenney22f00b62009-08-22 13:56:50 -0700414 if (!retval)
Paul E. McKenney7ba5c842009-04-13 21:31:17 -0700415 goto free_out;
Paul E. McKenney64db4cf2008-12-18 21:55:32 +0100416 return 0;
417free_out:
Paul E. McKenney22f00b62009-08-22 13:56:50 -0700418 debugfs_remove_recursive(rcudir);
Paul E. McKenney64db4cf2008-12-18 21:55:32 +0100419 return 1;
420}
421
Paul E. McKenneydeb7a412010-09-30 21:33:32 -0700422static void __exit rcutree_trace_cleanup(void)
Paul E. McKenney64db4cf2008-12-18 21:55:32 +0100423{
Paul E. McKenney22f00b62009-08-22 13:56:50 -0700424 debugfs_remove_recursive(rcudir);
Paul E. McKenney64db4cf2008-12-18 21:55:32 +0100425}
426
427
Paul E. McKenneydeb7a412010-09-30 21:33:32 -0700428module_init(rcutree_trace_init);
429module_exit(rcutree_trace_cleanup);
Paul E. McKenney64db4cf2008-12-18 21:55:32 +0100430
431MODULE_AUTHOR("Paul E. McKenney");
432MODULE_DESCRIPTION("Read-Copy Update tracing for hierarchical implementation");
433MODULE_LICENSE("GPL");