| Paul E. McKenney | 64db4cf | 2008-12-18 21:55:32 +0100 | [diff] [blame] | 1 | /* | 
 | 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. McKenney | a71fca5 | 2009-09-18 10:28:19 -0700 | [diff] [blame] | 23 |  *		Documentation/RCU | 
| Paul E. McKenney | 64db4cf | 2008-12-18 21:55:32 +0100 | [diff] [blame] | 24 |  * | 
 | 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. McKenney | 9f77da9 | 2009-08-22 13:56:45 -0700 | [diff] [blame] | 46 | #define RCU_TREE_NONCORE | 
| Ingo Molnar | 6258c4f | 2009-03-25 16:42:24 +0100 | [diff] [blame] | 47 | #include "rcutree.h" | 
 | 48 |  | 
| Paul E. McKenney | 64db4cf | 2008-12-18 21:55:32 +0100 | [diff] [blame] | 49 | static void print_one_rcu_data(struct seq_file *m, struct rcu_data *rdp) | 
 | 50 | { | 
 | 51 | 	if (!rdp->beenonline) | 
 | 52 | 		return; | 
| Paul E. McKenney | ef631b0 | 2009-04-13 21:31:16 -0700 | [diff] [blame] | 53 | 	seq_printf(m, "%3d%cc=%ld g=%ld pq=%d pqc=%ld qp=%d", | 
| Paul E. McKenney | 64db4cf | 2008-12-18 21:55:32 +0100 | [diff] [blame] | 54 | 		   rdp->cpu, | 
 | 55 | 		   cpu_is_offline(rdp->cpu) ? '!' : ' ', | 
 | 56 | 		   rdp->completed, rdp->gpnum, | 
 | 57 | 		   rdp->passed_quiesc, rdp->passed_quiesc_completed, | 
| Paul E. McKenney | ef631b0 | 2009-04-13 21:31:16 -0700 | [diff] [blame] | 58 | 		   rdp->qs_pending); | 
| Paul E. McKenney | 64db4cf | 2008-12-18 21:55:32 +0100 | [diff] [blame] | 59 | #ifdef CONFIG_NO_HZ | 
 | 60 | 	seq_printf(m, " dt=%d/%d dn=%d df=%lu", | 
 | 61 | 		   rdp->dynticks->dynticks, | 
 | 62 | 		   rdp->dynticks->dynticks_nesting, | 
 | 63 | 		   rdp->dynticks->dynticks_nmi, | 
 | 64 | 		   rdp->dynticks_fqs); | 
 | 65 | #endif /* #ifdef CONFIG_NO_HZ */ | 
 | 66 | 	seq_printf(m, " of=%lu ri=%lu", rdp->offline_fqs, rdp->resched_ipi); | 
 | 67 | 	seq_printf(m, " ql=%ld b=%ld\n", rdp->qlen, rdp->blimit); | 
 | 68 | } | 
 | 69 |  | 
 | 70 | #define PRINT_RCU_DATA(name, func, m) \ | 
 | 71 | 	do { \ | 
 | 72 | 		int _p_r_d_i; \ | 
 | 73 | 		\ | 
 | 74 | 		for_each_possible_cpu(_p_r_d_i) \ | 
 | 75 | 			func(m, &per_cpu(name, _p_r_d_i)); \ | 
 | 76 | 	} while (0) | 
 | 77 |  | 
 | 78 | static int show_rcudata(struct seq_file *m, void *unused) | 
 | 79 | { | 
| Paul E. McKenney | f41d911 | 2009-08-22 13:56:52 -0700 | [diff] [blame] | 80 | #ifdef CONFIG_TREE_PREEMPT_RCU | 
 | 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 */ | 
| Paul E. McKenney | d6714c2 | 2009-08-22 13:56:46 -0700 | [diff] [blame] | 84 | 	seq_puts(m, "rcu_sched:\n"); | 
 | 85 | 	PRINT_RCU_DATA(rcu_sched_data, print_one_rcu_data, m); | 
| Paul E. McKenney | 64db4cf | 2008-12-18 21:55:32 +0100 | [diff] [blame] | 86 | 	seq_puts(m, "rcu_bh:\n"); | 
 | 87 | 	PRINT_RCU_DATA(rcu_bh_data, print_one_rcu_data, m); | 
 | 88 | 	return 0; | 
 | 89 | } | 
 | 90 |  | 
 | 91 | static int rcudata_open(struct inode *inode, struct file *file) | 
 | 92 | { | 
 | 93 | 	return single_open(file, show_rcudata, NULL); | 
 | 94 | } | 
 | 95 |  | 
| Alexey Dobriyan | 828c095 | 2009-10-01 15:43:56 -0700 | [diff] [blame] | 96 | static const struct file_operations rcudata_fops = { | 
| Paul E. McKenney | 64db4cf | 2008-12-18 21:55:32 +0100 | [diff] [blame] | 97 | 	.owner = THIS_MODULE, | 
 | 98 | 	.open = rcudata_open, | 
 | 99 | 	.read = seq_read, | 
 | 100 | 	.llseek = seq_lseek, | 
 | 101 | 	.release = single_release, | 
 | 102 | }; | 
 | 103 |  | 
 | 104 | static void print_one_rcu_data_csv(struct seq_file *m, struct rcu_data *rdp) | 
 | 105 | { | 
 | 106 | 	if (!rdp->beenonline) | 
 | 107 | 		return; | 
| Paul E. McKenney | ef631b0 | 2009-04-13 21:31:16 -0700 | [diff] [blame] | 108 | 	seq_printf(m, "%d,%s,%ld,%ld,%d,%ld,%d", | 
| Paul E. McKenney | 64db4cf | 2008-12-18 21:55:32 +0100 | [diff] [blame] | 109 | 		   rdp->cpu, | 
| Paul E. McKenney | 5699ed8 | 2009-08-22 13:56:48 -0700 | [diff] [blame] | 110 | 		   cpu_is_offline(rdp->cpu) ? "\"N\"" : "\"Y\"", | 
| Paul E. McKenney | 64db4cf | 2008-12-18 21:55:32 +0100 | [diff] [blame] | 111 | 		   rdp->completed, rdp->gpnum, | 
 | 112 | 		   rdp->passed_quiesc, rdp->passed_quiesc_completed, | 
| Paul E. McKenney | ef631b0 | 2009-04-13 21:31:16 -0700 | [diff] [blame] | 113 | 		   rdp->qs_pending); | 
| Paul E. McKenney | 64db4cf | 2008-12-18 21:55:32 +0100 | [diff] [blame] | 114 | #ifdef CONFIG_NO_HZ | 
 | 115 | 	seq_printf(m, ",%d,%d,%d,%lu", | 
 | 116 | 		   rdp->dynticks->dynticks, | 
 | 117 | 		   rdp->dynticks->dynticks_nesting, | 
 | 118 | 		   rdp->dynticks->dynticks_nmi, | 
 | 119 | 		   rdp->dynticks_fqs); | 
 | 120 | #endif /* #ifdef CONFIG_NO_HZ */ | 
 | 121 | 	seq_printf(m, ",%lu,%lu", rdp->offline_fqs, rdp->resched_ipi); | 
 | 122 | 	seq_printf(m, ",%ld,%ld\n", rdp->qlen, rdp->blimit); | 
 | 123 | } | 
 | 124 |  | 
 | 125 | static int show_rcudata_csv(struct seq_file *m, void *unused) | 
 | 126 | { | 
| Paul E. McKenney | ef631b0 | 2009-04-13 21:31:16 -0700 | [diff] [blame] | 127 | 	seq_puts(m, "\"CPU\",\"Online?\",\"c\",\"g\",\"pq\",\"pqc\",\"pq\","); | 
| Paul E. McKenney | 64db4cf | 2008-12-18 21:55:32 +0100 | [diff] [blame] | 128 | #ifdef CONFIG_NO_HZ | 
 | 129 | 	seq_puts(m, "\"dt\",\"dt nesting\",\"dn\",\"df\","); | 
 | 130 | #endif /* #ifdef CONFIG_NO_HZ */ | 
 | 131 | 	seq_puts(m, "\"of\",\"ri\",\"ql\",\"b\"\n"); | 
| Paul E. McKenney | f41d911 | 2009-08-22 13:56:52 -0700 | [diff] [blame] | 132 | #ifdef CONFIG_TREE_PREEMPT_RCU | 
 | 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 */ | 
| Paul E. McKenney | d6714c2 | 2009-08-22 13:56:46 -0700 | [diff] [blame] | 136 | 	seq_puts(m, "\"rcu_sched:\"\n"); | 
 | 137 | 	PRINT_RCU_DATA(rcu_sched_data, print_one_rcu_data_csv, m); | 
| Paul E. McKenney | 64db4cf | 2008-12-18 21:55:32 +0100 | [diff] [blame] | 138 | 	seq_puts(m, "\"rcu_bh:\"\n"); | 
 | 139 | 	PRINT_RCU_DATA(rcu_bh_data, print_one_rcu_data_csv, m); | 
 | 140 | 	return 0; | 
 | 141 | } | 
 | 142 |  | 
 | 143 | static int rcudata_csv_open(struct inode *inode, struct file *file) | 
 | 144 | { | 
 | 145 | 	return single_open(file, show_rcudata_csv, NULL); | 
 | 146 | } | 
 | 147 |  | 
| Alexey Dobriyan | 828c095 | 2009-10-01 15:43:56 -0700 | [diff] [blame] | 148 | static const struct file_operations rcudata_csv_fops = { | 
| Paul E. McKenney | 64db4cf | 2008-12-18 21:55:32 +0100 | [diff] [blame] | 149 | 	.owner = THIS_MODULE, | 
 | 150 | 	.open = rcudata_csv_open, | 
 | 151 | 	.read = seq_read, | 
 | 152 | 	.llseek = seq_lseek, | 
 | 153 | 	.release = single_release, | 
 | 154 | }; | 
 | 155 |  | 
 | 156 | static void print_one_rcu_state(struct seq_file *m, struct rcu_state *rsp) | 
 | 157 | { | 
 | 158 | 	int level = 0; | 
 | 159 | 	struct rcu_node *rnp; | 
 | 160 |  | 
 | 161 | 	seq_printf(m, "c=%ld g=%ld s=%d jfq=%ld j=%x " | 
 | 162 | 	              "nfqs=%lu/nfqsng=%lu(%lu) fqlh=%lu\n", | 
 | 163 | 		   rsp->completed, rsp->gpnum, rsp->signaled, | 
 | 164 | 		   (long)(rsp->jiffies_force_qs - jiffies), | 
 | 165 | 		   (int)(jiffies & 0xffff), | 
 | 166 | 		   rsp->n_force_qs, rsp->n_force_qs_ngp, | 
 | 167 | 		   rsp->n_force_qs - rsp->n_force_qs_ngp, | 
 | 168 | 		   rsp->n_force_qs_lh); | 
 | 169 | 	for (rnp = &rsp->node[0]; rnp - &rsp->node[0] < NUM_RCU_NODES; rnp++) { | 
 | 170 | 		if (rnp->level != level) { | 
 | 171 | 			seq_puts(m, "\n"); | 
 | 172 | 			level = rnp->level; | 
 | 173 | 		} | 
 | 174 | 		seq_printf(m, "%lx/%lx %d:%d ^%d    ", | 
 | 175 | 			   rnp->qsmask, rnp->qsmaskinit, | 
 | 176 | 			   rnp->grplo, rnp->grphi, rnp->grpnum); | 
 | 177 | 	} | 
 | 178 | 	seq_puts(m, "\n"); | 
 | 179 | } | 
 | 180 |  | 
 | 181 | static int show_rcuhier(struct seq_file *m, void *unused) | 
 | 182 | { | 
| Paul E. McKenney | f41d911 | 2009-08-22 13:56:52 -0700 | [diff] [blame] | 183 | #ifdef CONFIG_TREE_PREEMPT_RCU | 
 | 184 | 	seq_puts(m, "rcu_preempt:\n"); | 
 | 185 | 	print_one_rcu_state(m, &rcu_preempt_state); | 
 | 186 | #endif /* #ifdef CONFIG_TREE_PREEMPT_RCU */ | 
| Paul E. McKenney | d6714c2 | 2009-08-22 13:56:46 -0700 | [diff] [blame] | 187 | 	seq_puts(m, "rcu_sched:\n"); | 
 | 188 | 	print_one_rcu_state(m, &rcu_sched_state); | 
| Paul E. McKenney | 64db4cf | 2008-12-18 21:55:32 +0100 | [diff] [blame] | 189 | 	seq_puts(m, "rcu_bh:\n"); | 
 | 190 | 	print_one_rcu_state(m, &rcu_bh_state); | 
 | 191 | 	return 0; | 
 | 192 | } | 
 | 193 |  | 
 | 194 | static int rcuhier_open(struct inode *inode, struct file *file) | 
 | 195 | { | 
 | 196 | 	return single_open(file, show_rcuhier, NULL); | 
 | 197 | } | 
 | 198 |  | 
| Alexey Dobriyan | 828c095 | 2009-10-01 15:43:56 -0700 | [diff] [blame] | 199 | static const struct file_operations rcuhier_fops = { | 
| Paul E. McKenney | 64db4cf | 2008-12-18 21:55:32 +0100 | [diff] [blame] | 200 | 	.owner = THIS_MODULE, | 
 | 201 | 	.open = rcuhier_open, | 
 | 202 | 	.read = seq_read, | 
 | 203 | 	.llseek = seq_lseek, | 
 | 204 | 	.release = single_release, | 
 | 205 | }; | 
 | 206 |  | 
 | 207 | static int show_rcugp(struct seq_file *m, void *unused) | 
 | 208 | { | 
| Paul E. McKenney | f41d911 | 2009-08-22 13:56:52 -0700 | [diff] [blame] | 209 | #ifdef CONFIG_TREE_PREEMPT_RCU | 
 | 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 */ | 
| Paul E. McKenney | d6714c2 | 2009-08-22 13:56:46 -0700 | [diff] [blame] | 213 | 	seq_printf(m, "rcu_sched: completed=%ld  gpnum=%ld\n", | 
 | 214 | 		   rcu_sched_state.completed, rcu_sched_state.gpnum); | 
| Paul E. McKenney | 64db4cf | 2008-12-18 21:55:32 +0100 | [diff] [blame] | 215 | 	seq_printf(m, "rcu_bh: completed=%ld  gpnum=%ld\n", | 
 | 216 | 		   rcu_bh_state.completed, rcu_bh_state.gpnum); | 
 | 217 | 	return 0; | 
 | 218 | } | 
 | 219 |  | 
 | 220 | static int rcugp_open(struct inode *inode, struct file *file) | 
 | 221 | { | 
 | 222 | 	return single_open(file, show_rcugp, NULL); | 
 | 223 | } | 
 | 224 |  | 
| Alexey Dobriyan | 828c095 | 2009-10-01 15:43:56 -0700 | [diff] [blame] | 225 | static const struct file_operations rcugp_fops = { | 
| Paul E. McKenney | 64db4cf | 2008-12-18 21:55:32 +0100 | [diff] [blame] | 226 | 	.owner = THIS_MODULE, | 
 | 227 | 	.open = rcugp_open, | 
 | 228 | 	.read = seq_read, | 
 | 229 | 	.llseek = seq_lseek, | 
 | 230 | 	.release = single_release, | 
 | 231 | }; | 
 | 232 |  | 
| Paul E. McKenney | 7ba5c84 | 2009-04-13 21:31:17 -0700 | [diff] [blame] | 233 | static void print_one_rcu_pending(struct seq_file *m, struct rcu_data *rdp) | 
 | 234 | { | 
 | 235 | 	seq_printf(m, "%3d%cnp=%ld " | 
 | 236 | 		   "qsp=%ld cbr=%ld cng=%ld gpc=%ld gps=%ld nf=%ld nn=%ld\n", | 
 | 237 | 		   rdp->cpu, | 
 | 238 | 		   cpu_is_offline(rdp->cpu) ? '!' : ' ', | 
 | 239 | 		   rdp->n_rcu_pending, | 
 | 240 | 		   rdp->n_rp_qs_pending, | 
 | 241 | 		   rdp->n_rp_cb_ready, | 
 | 242 | 		   rdp->n_rp_cpu_needs_gp, | 
 | 243 | 		   rdp->n_rp_gp_completed, | 
 | 244 | 		   rdp->n_rp_gp_started, | 
 | 245 | 		   rdp->n_rp_need_fqs, | 
 | 246 | 		   rdp->n_rp_need_nothing); | 
 | 247 | } | 
 | 248 |  | 
 | 249 | static void print_rcu_pendings(struct seq_file *m, struct rcu_state *rsp) | 
 | 250 | { | 
 | 251 | 	int cpu; | 
 | 252 | 	struct rcu_data *rdp; | 
 | 253 |  | 
 | 254 | 	for_each_possible_cpu(cpu) { | 
 | 255 | 		rdp = rsp->rda[cpu]; | 
 | 256 | 		if (rdp->beenonline) | 
 | 257 | 			print_one_rcu_pending(m, rdp); | 
 | 258 | 	} | 
 | 259 | } | 
 | 260 |  | 
 | 261 | static int show_rcu_pending(struct seq_file *m, void *unused) | 
 | 262 | { | 
| Paul E. McKenney | f41d911 | 2009-08-22 13:56:52 -0700 | [diff] [blame] | 263 | #ifdef CONFIG_TREE_PREEMPT_RCU | 
 | 264 | 	seq_puts(m, "rcu_preempt:\n"); | 
 | 265 | 	print_rcu_pendings(m, &rcu_preempt_state); | 
 | 266 | #endif /* #ifdef CONFIG_TREE_PREEMPT_RCU */ | 
| Paul E. McKenney | d6714c2 | 2009-08-22 13:56:46 -0700 | [diff] [blame] | 267 | 	seq_puts(m, "rcu_sched:\n"); | 
 | 268 | 	print_rcu_pendings(m, &rcu_sched_state); | 
| Paul E. McKenney | 7ba5c84 | 2009-04-13 21:31:17 -0700 | [diff] [blame] | 269 | 	seq_puts(m, "rcu_bh:\n"); | 
 | 270 | 	print_rcu_pendings(m, &rcu_bh_state); | 
 | 271 | 	return 0; | 
 | 272 | } | 
 | 273 |  | 
 | 274 | static int rcu_pending_open(struct inode *inode, struct file *file) | 
 | 275 | { | 
 | 276 | 	return single_open(file, show_rcu_pending, NULL); | 
 | 277 | } | 
 | 278 |  | 
| Alexey Dobriyan | 828c095 | 2009-10-01 15:43:56 -0700 | [diff] [blame] | 279 | static const struct file_operations rcu_pending_fops = { | 
| Paul E. McKenney | 7ba5c84 | 2009-04-13 21:31:17 -0700 | [diff] [blame] | 280 | 	.owner = THIS_MODULE, | 
 | 281 | 	.open = rcu_pending_open, | 
 | 282 | 	.read = seq_read, | 
 | 283 | 	.llseek = seq_lseek, | 
 | 284 | 	.release = single_release, | 
 | 285 | }; | 
 | 286 |  | 
 | 287 | static struct dentry *rcudir; | 
| Paul E. McKenney | 7ba5c84 | 2009-04-13 21:31:17 -0700 | [diff] [blame] | 288 |  | 
| Paul E. McKenney | 64db4cf | 2008-12-18 21:55:32 +0100 | [diff] [blame] | 289 | static int __init rcuclassic_trace_init(void) | 
 | 290 | { | 
| Paul E. McKenney | 22f00b6 | 2009-08-22 13:56:50 -0700 | [diff] [blame] | 291 | 	struct dentry *retval; | 
 | 292 |  | 
| Paul E. McKenney | 64db4cf | 2008-12-18 21:55:32 +0100 | [diff] [blame] | 293 | 	rcudir = debugfs_create_dir("rcu", NULL); | 
 | 294 | 	if (!rcudir) | 
| Paul E. McKenney | 22f00b6 | 2009-08-22 13:56:50 -0700 | [diff] [blame] | 295 | 		goto free_out; | 
| Paul E. McKenney | 64db4cf | 2008-12-18 21:55:32 +0100 | [diff] [blame] | 296 |  | 
| Paul E. McKenney | 22f00b6 | 2009-08-22 13:56:50 -0700 | [diff] [blame] | 297 | 	retval = debugfs_create_file("rcudata", 0444, rcudir, | 
| Paul E. McKenney | 64db4cf | 2008-12-18 21:55:32 +0100 | [diff] [blame] | 298 | 						NULL, &rcudata_fops); | 
| Paul E. McKenney | 22f00b6 | 2009-08-22 13:56:50 -0700 | [diff] [blame] | 299 | 	if (!retval) | 
| Paul E. McKenney | 64db4cf | 2008-12-18 21:55:32 +0100 | [diff] [blame] | 300 | 		goto free_out; | 
 | 301 |  | 
| Paul E. McKenney | 22f00b6 | 2009-08-22 13:56:50 -0700 | [diff] [blame] | 302 | 	retval = debugfs_create_file("rcudata.csv", 0444, rcudir, | 
| Paul E. McKenney | 64db4cf | 2008-12-18 21:55:32 +0100 | [diff] [blame] | 303 | 						NULL, &rcudata_csv_fops); | 
| Paul E. McKenney | 22f00b6 | 2009-08-22 13:56:50 -0700 | [diff] [blame] | 304 | 	if (!retval) | 
| Paul E. McKenney | 64db4cf | 2008-12-18 21:55:32 +0100 | [diff] [blame] | 305 | 		goto free_out; | 
 | 306 |  | 
| Paul E. McKenney | 22f00b6 | 2009-08-22 13:56:50 -0700 | [diff] [blame] | 307 | 	retval = debugfs_create_file("rcugp", 0444, rcudir, NULL, &rcugp_fops); | 
 | 308 | 	if (!retval) | 
| Paul E. McKenney | 64db4cf | 2008-12-18 21:55:32 +0100 | [diff] [blame] | 309 | 		goto free_out; | 
 | 310 |  | 
| Paul E. McKenney | 22f00b6 | 2009-08-22 13:56:50 -0700 | [diff] [blame] | 311 | 	retval = debugfs_create_file("rcuhier", 0444, rcudir, | 
| Paul E. McKenney | 64db4cf | 2008-12-18 21:55:32 +0100 | [diff] [blame] | 312 | 						NULL, &rcuhier_fops); | 
| Paul E. McKenney | 22f00b6 | 2009-08-22 13:56:50 -0700 | [diff] [blame] | 313 | 	if (!retval) | 
| Paul E. McKenney | 64db4cf | 2008-12-18 21:55:32 +0100 | [diff] [blame] | 314 | 		goto free_out; | 
| Paul E. McKenney | 7ba5c84 | 2009-04-13 21:31:17 -0700 | [diff] [blame] | 315 |  | 
| Paul E. McKenney | 22f00b6 | 2009-08-22 13:56:50 -0700 | [diff] [blame] | 316 | 	retval = debugfs_create_file("rcu_pending", 0444, rcudir, | 
| Paul E. McKenney | 7ba5c84 | 2009-04-13 21:31:17 -0700 | [diff] [blame] | 317 | 						NULL, &rcu_pending_fops); | 
| Paul E. McKenney | 22f00b6 | 2009-08-22 13:56:50 -0700 | [diff] [blame] | 318 | 	if (!retval) | 
| Paul E. McKenney | 7ba5c84 | 2009-04-13 21:31:17 -0700 | [diff] [blame] | 319 | 		goto free_out; | 
| Paul E. McKenney | 64db4cf | 2008-12-18 21:55:32 +0100 | [diff] [blame] | 320 | 	return 0; | 
 | 321 | free_out: | 
| Paul E. McKenney | 22f00b6 | 2009-08-22 13:56:50 -0700 | [diff] [blame] | 322 | 	debugfs_remove_recursive(rcudir); | 
| Paul E. McKenney | 64db4cf | 2008-12-18 21:55:32 +0100 | [diff] [blame] | 323 | 	return 1; | 
 | 324 | } | 
 | 325 |  | 
 | 326 | static void __exit rcuclassic_trace_cleanup(void) | 
 | 327 | { | 
| Paul E. McKenney | 22f00b6 | 2009-08-22 13:56:50 -0700 | [diff] [blame] | 328 | 	debugfs_remove_recursive(rcudir); | 
| Paul E. McKenney | 64db4cf | 2008-12-18 21:55:32 +0100 | [diff] [blame] | 329 | } | 
 | 330 |  | 
 | 331 |  | 
 | 332 | module_init(rcuclassic_trace_init); | 
 | 333 | module_exit(rcuclassic_trace_cleanup); | 
 | 334 |  | 
 | 335 | MODULE_AUTHOR("Paul E. McKenney"); | 
 | 336 | MODULE_DESCRIPTION("Read-Copy Update tracing for hierarchical implementation"); | 
 | 337 | MODULE_LICENSE("GPL"); |