diff options
author | Michael Wang <wangyun@linux.vnet.ibm.com> | 2012-09-19 20:51:07 -0400 |
---|---|---|
committer | Paul E. McKenney <paulmck@linux.vnet.ibm.com> | 2012-11-08 14:50:18 -0500 |
commit | c011c41f11c4bf9b0c8d489a458770c24aeb2ebd (patch) | |
tree | 249ddff5222c00046911d41279f874741e792cb8 /kernel/rcutree_trace.c | |
parent | 51d0f16d49f6a99189e80c50e18a12325664ef41 (diff) |
rcu: Replace the old interface with the new one
This patch removed the old RCU debugfs interface and replaced it with
the new one.
Signed-off-by: Michael Wang <wangyun@linux.vnet.ibm.com>
Signed-off-by: Paul E. McKenney <paulmck@linux.vnet.ibm.com>
Diffstat (limited to 'kernel/rcutree_trace.c')
-rw-r--r-- | kernel/rcutree_trace.c | 148 |
1 files changed, 24 insertions, 124 deletions
diff --git a/kernel/rcutree_trace.c b/kernel/rcutree_trace.c index 8b2486722211..0e2ab6427b64 100644 --- a/kernel/rcutree_trace.c +++ b/kernel/rcutree_trace.c | |||
@@ -148,53 +148,27 @@ static void print_one_rcu_data(struct seq_file *m, struct rcu_data *rdp) | |||
148 | rdp->n_cbs_invoked, rdp->n_cbs_orphaned, rdp->n_cbs_adopted); | 148 | rdp->n_cbs_invoked, rdp->n_cbs_orphaned, rdp->n_cbs_adopted); |
149 | } | 149 | } |
150 | 150 | ||
151 | static int show_rcudata(struct seq_file *m, void *unused) | 151 | static int show_rcudata(struct seq_file *m, void *v) |
152 | { | ||
153 | int cpu; | ||
154 | struct rcu_state *rsp; | ||
155 | |||
156 | for_each_rcu_flavor(rsp) { | ||
157 | seq_printf(m, "%s:\n", rsp->name); | ||
158 | for_each_possible_cpu(cpu) | ||
159 | print_one_rcu_data(m, per_cpu_ptr(rsp->rda, cpu)); | ||
160 | } | ||
161 | return 0; | ||
162 | } | ||
163 | |||
164 | static int rcudata_open(struct inode *inode, struct file *file) | ||
165 | { | ||
166 | return single_open(file, show_rcudata, NULL); | ||
167 | } | ||
168 | |||
169 | static const struct file_operations rcudata_fops = { | ||
170 | .owner = THIS_MODULE, | ||
171 | .open = rcudata_open, | ||
172 | .read = seq_read, | ||
173 | .llseek = seq_lseek, | ||
174 | .release = single_release, | ||
175 | }; | ||
176 | |||
177 | static int new_show_rcudata(struct seq_file *m, void *v) | ||
178 | { | 152 | { |
179 | print_one_rcu_data(m, (struct rcu_data *)v); | 153 | print_one_rcu_data(m, (struct rcu_data *)v); |
180 | return 0; | 154 | return 0; |
181 | } | 155 | } |
182 | 156 | ||
183 | static const struct seq_operations new_rcudate_op = { | 157 | static const struct seq_operations rcudate_op = { |
184 | .start = r_start, | 158 | .start = r_start, |
185 | .next = r_next, | 159 | .next = r_next, |
186 | .stop = r_stop, | 160 | .stop = r_stop, |
187 | .show = new_show_rcudata, | 161 | .show = show_rcudata, |
188 | }; | 162 | }; |
189 | 163 | ||
190 | static int new_rcudata_open(struct inode *inode, struct file *file) | 164 | static int rcudata_open(struct inode *inode, struct file *file) |
191 | { | 165 | { |
192 | return r_open(inode, file, &new_rcudate_op); | 166 | return r_open(inode, file, &rcudate_op); |
193 | } | 167 | } |
194 | 168 | ||
195 | static const struct file_operations new_rcudata_fops = { | 169 | static const struct file_operations rcudata_fops = { |
196 | .owner = THIS_MODULE, | 170 | .owner = THIS_MODULE, |
197 | .open = new_rcudata_open, | 171 | .open = rcudata_open, |
198 | .read = seq_read, | 172 | .read = seq_read, |
199 | .llseek = no_llseek, | 173 | .llseek = no_llseek, |
200 | .release = seq_release, | 174 | .release = seq_release, |
@@ -234,40 +208,7 @@ static void print_one_rcu_data_csv(struct seq_file *m, struct rcu_data *rdp) | |||
234 | rdp->n_cbs_invoked, rdp->n_cbs_orphaned, rdp->n_cbs_adopted); | 208 | rdp->n_cbs_invoked, rdp->n_cbs_orphaned, rdp->n_cbs_adopted); |
235 | } | 209 | } |
236 | 210 | ||
237 | static int show_rcudata_csv(struct seq_file *m, void *unused) | 211 | static int show_rcudata_csv(struct seq_file *m, void *v) |
238 | { | ||
239 | int cpu; | ||
240 | struct rcu_state *rsp; | ||
241 | |||
242 | seq_puts(m, "\"CPU\",\"Online?\",\"c\",\"g\",\"pq\",\"pq\","); | ||
243 | seq_puts(m, "\"dt\",\"dt nesting\",\"dt NMI nesting\",\"df\","); | ||
244 | seq_puts(m, "\"of\",\"qll\",\"ql\",\"qs\""); | ||
245 | #ifdef CONFIG_RCU_BOOST | ||
246 | seq_puts(m, "\"kt\",\"ktl\""); | ||
247 | #endif /* #ifdef CONFIG_RCU_BOOST */ | ||
248 | seq_puts(m, ",\"b\",\"ci\",\"co\",\"ca\"\n"); | ||
249 | for_each_rcu_flavor(rsp) { | ||
250 | seq_printf(m, "\"%s:\"\n", rsp->name); | ||
251 | for_each_possible_cpu(cpu) | ||
252 | print_one_rcu_data_csv(m, per_cpu_ptr(rsp->rda, cpu)); | ||
253 | } | ||
254 | return 0; | ||
255 | } | ||
256 | |||
257 | static int rcudata_csv_open(struct inode *inode, struct file *file) | ||
258 | { | ||
259 | return single_open(file, show_rcudata_csv, NULL); | ||
260 | } | ||
261 | |||
262 | static const struct file_operations rcudata_csv_fops = { | ||
263 | .owner = THIS_MODULE, | ||
264 | .open = rcudata_csv_open, | ||
265 | .read = seq_read, | ||
266 | .llseek = seq_lseek, | ||
267 | .release = single_release, | ||
268 | }; | ||
269 | |||
270 | static int new_show_rcudata_csv(struct seq_file *m, void *v) | ||
271 | { | 212 | { |
272 | struct rcu_data *rdp = (struct rcu_data *)v; | 213 | struct rcu_data *rdp = (struct rcu_data *)v; |
273 | if (cpumask_first(cpu_possible_mask) == rdp->cpu) { | 214 | if (cpumask_first(cpu_possible_mask) == rdp->cpu) { |
@@ -284,21 +225,21 @@ static int new_show_rcudata_csv(struct seq_file *m, void *v) | |||
284 | return 0; | 225 | return 0; |
285 | } | 226 | } |
286 | 227 | ||
287 | static const struct seq_operations new_rcudate_csv_op = { | 228 | static const struct seq_operations rcudate_csv_op = { |
288 | .start = r_start, | 229 | .start = r_start, |
289 | .next = r_next, | 230 | .next = r_next, |
290 | .stop = r_stop, | 231 | .stop = r_stop, |
291 | .show = new_show_rcudata_csv, | 232 | .show = show_rcudata_csv, |
292 | }; | 233 | }; |
293 | 234 | ||
294 | static int new_rcudata_csv_open(struct inode *inode, struct file *file) | 235 | static int rcudata_csv_open(struct inode *inode, struct file *file) |
295 | { | 236 | { |
296 | return r_open(inode, file, &new_rcudate_csv_op); | 237 | return r_open(inode, file, &rcudate_csv_op); |
297 | } | 238 | } |
298 | 239 | ||
299 | static const struct file_operations new_rcudata_csv_fops = { | 240 | static const struct file_operations rcudata_csv_fops = { |
300 | .owner = THIS_MODULE, | 241 | .owner = THIS_MODULE, |
301 | .open = new_rcudata_csv_open, | 242 | .open = rcudata_csv_open, |
302 | .read = seq_read, | 243 | .read = seq_read, |
303 | .llseek = no_llseek, | 244 | .llseek = no_llseek, |
304 | .release = seq_release, | 245 | .release = seq_release, |
@@ -484,53 +425,27 @@ static void print_one_rcu_pending(struct seq_file *m, struct rcu_data *rdp) | |||
484 | rdp->n_rp_need_nothing); | 425 | rdp->n_rp_need_nothing); |
485 | } | 426 | } |
486 | 427 | ||
487 | static int show_rcu_pending(struct seq_file *m, void *unused) | 428 | static int show_rcu_pending(struct seq_file *m, void *v) |
488 | { | ||
489 | int cpu; | ||
490 | struct rcu_state *rsp; | ||
491 | |||
492 | for_each_rcu_flavor(rsp) { | ||
493 | seq_printf(m, "%s:\n", rsp->name); | ||
494 | for_each_possible_cpu(cpu) | ||
495 | print_one_rcu_pending(m, per_cpu_ptr(rsp->rda, cpu)); | ||
496 | } | ||
497 | return 0; | ||
498 | } | ||
499 | |||
500 | static int rcu_pending_open(struct inode *inode, struct file *file) | ||
501 | { | ||
502 | return single_open(file, show_rcu_pending, NULL); | ||
503 | } | ||
504 | |||
505 | static const struct file_operations rcu_pending_fops = { | ||
506 | .owner = THIS_MODULE, | ||
507 | .open = rcu_pending_open, | ||
508 | .read = seq_read, | ||
509 | .llseek = seq_lseek, | ||
510 | .release = single_release, | ||
511 | }; | ||
512 | |||
513 | static int new_show_rcu_pending(struct seq_file *m, void *v) | ||
514 | { | 429 | { |
515 | print_one_rcu_pending(m, (struct rcu_data *)v); | 430 | print_one_rcu_pending(m, (struct rcu_data *)v); |
516 | return 0; | 431 | return 0; |
517 | } | 432 | } |
518 | 433 | ||
519 | static const struct seq_operations new_rcu_pending_op = { | 434 | static const struct seq_operations rcu_pending_op = { |
520 | .start = r_start, | 435 | .start = r_start, |
521 | .next = r_next, | 436 | .next = r_next, |
522 | .stop = r_stop, | 437 | .stop = r_stop, |
523 | .show = new_show_rcu_pending, | 438 | .show = show_rcu_pending, |
524 | }; | 439 | }; |
525 | 440 | ||
526 | static int new_rcu_pending_open(struct inode *inode, struct file *file) | 441 | static int rcu_pending_open(struct inode *inode, struct file *file) |
527 | { | 442 | { |
528 | return r_open(inode, file, &new_rcu_pending_op); | 443 | return r_open(inode, file, &rcu_pending_op); |
529 | } | 444 | } |
530 | 445 | ||
531 | static const struct file_operations new_rcu_pending_fops = { | 446 | static const struct file_operations rcu_pending_fops = { |
532 | .owner = THIS_MODULE, | 447 | .owner = THIS_MODULE, |
533 | .open = new_rcu_pending_open, | 448 | .open = rcu_pending_open, |
534 | .read = seq_read, | 449 | .read = seq_read, |
535 | .llseek = no_llseek, | 450 | .llseek = no_llseek, |
536 | .release = seq_release, | 451 | .release = seq_release, |
@@ -577,17 +492,17 @@ static int __init rcutree_trace_init(void) | |||
577 | goto free_out; | 492 | goto free_out; |
578 | 493 | ||
579 | retval = debugfs_create_file("rcudata", 0444, | 494 | retval = debugfs_create_file("rcudata", 0444, |
580 | rspdir, rsp, &new_rcudata_fops); | 495 | rspdir, rsp, &rcudata_fops); |
581 | if (!retval) | 496 | if (!retval) |
582 | goto free_out; | 497 | goto free_out; |
583 | 498 | ||
584 | retval = debugfs_create_file("rcudata.csv", 0444, | 499 | retval = debugfs_create_file("rcudata.csv", 0444, |
585 | rspdir, rsp, &new_rcudata_csv_fops); | 500 | rspdir, rsp, &rcudata_csv_fops); |
586 | if (!retval) | 501 | if (!retval) |
587 | goto free_out; | 502 | goto free_out; |
588 | 503 | ||
589 | retval = debugfs_create_file("rcu_pending", 0444, | 504 | retval = debugfs_create_file("rcu_pending", 0444, |
590 | rspdir, rsp, &new_rcu_pending_fops); | 505 | rspdir, rsp, &rcu_pending_fops); |
591 | if (!retval) | 506 | if (!retval) |
592 | goto free_out; | 507 | goto free_out; |
593 | } | 508 | } |
@@ -597,16 +512,6 @@ static int __init rcutree_trace_init(void) | |||
597 | if (!retval) | 512 | if (!retval) |
598 | goto free_out; | 513 | goto free_out; |
599 | 514 | ||
600 | retval = debugfs_create_file("rcudata", 0444, rcudir, | ||
601 | NULL, &rcudata_fops); | ||
602 | if (!retval) | ||
603 | goto free_out; | ||
604 | |||
605 | retval = debugfs_create_file("rcudata.csv", 0444, rcudir, | ||
606 | NULL, &rcudata_csv_fops); | ||
607 | if (!retval) | ||
608 | goto free_out; | ||
609 | |||
610 | if (rcu_boost_trace_create_file(rcudir)) | 515 | if (rcu_boost_trace_create_file(rcudir)) |
611 | goto free_out; | 516 | goto free_out; |
612 | 517 | ||
@@ -619,11 +524,6 @@ static int __init rcutree_trace_init(void) | |||
619 | if (!retval) | 524 | if (!retval) |
620 | goto free_out; | 525 | goto free_out; |
621 | 526 | ||
622 | retval = debugfs_create_file("rcu_pending", 0444, rcudir, | ||
623 | NULL, &rcu_pending_fops); | ||
624 | if (!retval) | ||
625 | goto free_out; | ||
626 | |||
627 | retval = debugfs_create_file("rcutorture", 0444, rcudir, | 527 | retval = debugfs_create_file("rcutorture", 0444, rcudir, |
628 | NULL, &rcutorture_fops); | 528 | NULL, &rcutorture_fops); |
629 | if (!retval) | 529 | if (!retval) |