diff options
author | Michael Wang <wangyun@linux.vnet.ibm.com> | 2012-09-19 20:51:06 -0400 |
---|---|---|
committer | Paul E. McKenney <paulmck@linux.vnet.ibm.com> | 2012-11-08 14:50:17 -0500 |
commit | 51d0f16d49f6a99189e80c50e18a12325664ef41 (patch) | |
tree | 2d7e28e39eff3d1d169ccca95e18a0f06cc574af /kernel/rcutree_trace.c | |
parent | d29200efa2ad7a1dc516a1048faf98dcc01b9fef (diff) |
rcu: Optimize the 'rcu_pending' for RCU trace
This patch implements the new 'rcu_pending' interface under each rsp
directory, by using the 'CPU units sequence reading', thus avoiding loss
of tracing data.
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 | 41 |
1 files changed, 35 insertions, 6 deletions
diff --git a/kernel/rcutree_trace.c b/kernel/rcutree_trace.c index e387a642632b..8b2486722211 100644 --- a/kernel/rcutree_trace.c +++ b/kernel/rcutree_trace.c | |||
@@ -467,6 +467,8 @@ static const struct file_operations rcugp_fops = { | |||
467 | 467 | ||
468 | static void print_one_rcu_pending(struct seq_file *m, struct rcu_data *rdp) | 468 | static void print_one_rcu_pending(struct seq_file *m, struct rcu_data *rdp) |
469 | { | 469 | { |
470 | if (!rdp->beenonline) | ||
471 | return; | ||
470 | seq_printf(m, "%3d%cnp=%ld ", | 472 | seq_printf(m, "%3d%cnp=%ld ", |
471 | rdp->cpu, | 473 | rdp->cpu, |
472 | cpu_is_offline(rdp->cpu) ? '!' : ' ', | 474 | cpu_is_offline(rdp->cpu) ? '!' : ' ', |
@@ -485,16 +487,12 @@ static void print_one_rcu_pending(struct seq_file *m, struct rcu_data *rdp) | |||
485 | static int show_rcu_pending(struct seq_file *m, void *unused) | 487 | static int show_rcu_pending(struct seq_file *m, void *unused) |
486 | { | 488 | { |
487 | int cpu; | 489 | int cpu; |
488 | struct rcu_data *rdp; | ||
489 | struct rcu_state *rsp; | 490 | struct rcu_state *rsp; |
490 | 491 | ||
491 | for_each_rcu_flavor(rsp) { | 492 | for_each_rcu_flavor(rsp) { |
492 | seq_printf(m, "%s:\n", rsp->name); | 493 | seq_printf(m, "%s:\n", rsp->name); |
493 | for_each_possible_cpu(cpu) { | 494 | for_each_possible_cpu(cpu) |
494 | rdp = per_cpu_ptr(rsp->rda, cpu); | 495 | print_one_rcu_pending(m, per_cpu_ptr(rsp->rda, cpu)); |
495 | if (rdp->beenonline) | ||
496 | print_one_rcu_pending(m, rdp); | ||
497 | } | ||
498 | } | 496 | } |
499 | return 0; | 497 | return 0; |
500 | } | 498 | } |
@@ -512,6 +510,32 @@ static const struct file_operations rcu_pending_fops = { | |||
512 | .release = single_release, | 510 | .release = single_release, |
513 | }; | 511 | }; |
514 | 512 | ||
513 | static int new_show_rcu_pending(struct seq_file *m, void *v) | ||
514 | { | ||
515 | print_one_rcu_pending(m, (struct rcu_data *)v); | ||
516 | return 0; | ||
517 | } | ||
518 | |||
519 | static const struct seq_operations new_rcu_pending_op = { | ||
520 | .start = r_start, | ||
521 | .next = r_next, | ||
522 | .stop = r_stop, | ||
523 | .show = new_show_rcu_pending, | ||
524 | }; | ||
525 | |||
526 | static int new_rcu_pending_open(struct inode *inode, struct file *file) | ||
527 | { | ||
528 | return r_open(inode, file, &new_rcu_pending_op); | ||
529 | } | ||
530 | |||
531 | static const struct file_operations new_rcu_pending_fops = { | ||
532 | .owner = THIS_MODULE, | ||
533 | .open = new_rcu_pending_open, | ||
534 | .read = seq_read, | ||
535 | .llseek = no_llseek, | ||
536 | .release = seq_release, | ||
537 | }; | ||
538 | |||
515 | static int show_rcutorture(struct seq_file *m, void *unused) | 539 | static int show_rcutorture(struct seq_file *m, void *unused) |
516 | { | 540 | { |
517 | seq_printf(m, "rcutorture test sequence: %lu %s\n", | 541 | seq_printf(m, "rcutorture test sequence: %lu %s\n", |
@@ -561,6 +585,11 @@ static int __init rcutree_trace_init(void) | |||
561 | rspdir, rsp, &new_rcudata_csv_fops); | 585 | rspdir, rsp, &new_rcudata_csv_fops); |
562 | if (!retval) | 586 | if (!retval) |
563 | goto free_out; | 587 | goto free_out; |
588 | |||
589 | retval = debugfs_create_file("rcu_pending", 0444, | ||
590 | rspdir, rsp, &new_rcu_pending_fops); | ||
591 | if (!retval) | ||
592 | goto free_out; | ||
564 | } | 593 | } |
565 | 594 | ||
566 | retval = debugfs_create_file("rcubarrier", 0444, rcudir, | 595 | retval = debugfs_create_file("rcubarrier", 0444, rcudir, |