diff options
author | Paul E. McKenney <paul.mckenney@linaro.org> | 2012-05-25 14:49:15 -0400 |
---|---|---|
committer | Paul E. McKenney <paulmck@linux.vnet.ibm.com> | 2012-07-02 15:33:23 -0400 |
commit | d7e187c8e9f30543f9cadfed094896ff414acb8f (patch) | |
tree | 071503440393317c78fad16dbf1ca4e9ce2807e7 /kernel/rcutree_trace.c | |
parent | a83eff0a82a7f3f14fea477fd41e6c082e7fc96a (diff) |
rcu: Add rcu_barrier() statistics to debugfs tracing
This commit adds an rcubarrier file to RCU's debugfs statistical tracing
directory, providing diagnostic information on rcu_barrier().
Signed-off-by: Paul E. McKenney <paul.mckenney@linaro.org>
Signed-off-by: Paul E. McKenney <paulmck@linux.vnet.ibm.com>
Reviewed-by: Josh Triplett <josh@joshtriplett.org>
Diffstat (limited to 'kernel/rcutree_trace.c')
-rw-r--r-- | kernel/rcutree_trace.c | 39 |
1 files changed, 39 insertions, 0 deletions
diff --git a/kernel/rcutree_trace.c b/kernel/rcutree_trace.c index a3556a2d842..057408be6c3 100644 --- a/kernel/rcutree_trace.c +++ b/kernel/rcutree_trace.c | |||
@@ -46,6 +46,40 @@ | |||
46 | #define RCU_TREE_NONCORE | 46 | #define RCU_TREE_NONCORE |
47 | #include "rcutree.h" | 47 | #include "rcutree.h" |
48 | 48 | ||
49 | static void print_rcubarrier(struct seq_file *m, struct rcu_state *rsp) | ||
50 | { | ||
51 | seq_printf(m, "%c bcc: %d nbd: %lu\n", | ||
52 | rsp->rcu_barrier_in_progress ? 'B' : '.', | ||
53 | atomic_read(&rsp->barrier_cpu_count), | ||
54 | rsp->n_barrier_done); | ||
55 | } | ||
56 | |||
57 | static int show_rcubarrier(struct seq_file *m, void *unused) | ||
58 | { | ||
59 | #ifdef CONFIG_TREE_PREEMPT_RCU | ||
60 | seq_puts(m, "rcu_preempt: "); | ||
61 | print_rcubarrier(m, &rcu_preempt_state); | ||
62 | #endif /* #ifdef CONFIG_TREE_PREEMPT_RCU */ | ||
63 | seq_puts(m, "rcu_sched: "); | ||
64 | print_rcubarrier(m, &rcu_sched_state); | ||
65 | seq_puts(m, "rcu_bh: "); | ||
66 | print_rcubarrier(m, &rcu_bh_state); | ||
67 | return 0; | ||
68 | } | ||
69 | |||
70 | static int rcubarrier_open(struct inode *inode, struct file *file) | ||
71 | { | ||
72 | return single_open(file, show_rcubarrier, NULL); | ||
73 | } | ||
74 | |||
75 | static const struct file_operations rcubarrier_fops = { | ||
76 | .owner = THIS_MODULE, | ||
77 | .open = rcubarrier_open, | ||
78 | .read = seq_read, | ||
79 | .llseek = seq_lseek, | ||
80 | .release = single_release, | ||
81 | }; | ||
82 | |||
49 | #ifdef CONFIG_RCU_BOOST | 83 | #ifdef CONFIG_RCU_BOOST |
50 | 84 | ||
51 | static char convert_kthread_status(unsigned int kthread_status) | 85 | static char convert_kthread_status(unsigned int kthread_status) |
@@ -453,6 +487,11 @@ static int __init rcutree_trace_init(void) | |||
453 | if (!rcudir) | 487 | if (!rcudir) |
454 | goto free_out; | 488 | goto free_out; |
455 | 489 | ||
490 | retval = debugfs_create_file("rcubarrier", 0444, rcudir, | ||
491 | NULL, &rcubarrier_fops); | ||
492 | if (!retval) | ||
493 | goto free_out; | ||
494 | |||
456 | retval = debugfs_create_file("rcudata", 0444, rcudir, | 495 | retval = debugfs_create_file("rcudata", 0444, rcudir, |
457 | NULL, &rcudata_fops); | 496 | NULL, &rcudata_fops); |
458 | if (!retval) | 497 | if (!retval) |