aboutsummaryrefslogtreecommitdiffstats
path: root/kernel/rcutree_trace.c
diff options
context:
space:
mode:
authorPaul E. McKenney <paulmck@linux.vnet.ibm.com>2012-06-12 15:25:39 -0400
committerPaul E. McKenney <paulmck@linux.vnet.ibm.com>2012-07-02 15:33:24 -0400
commitc0cc962da3e7770feb3665f087ea3e23d8c15479 (patch)
treeeb2ee2904a5620133d38e2a1060c2b0524c73a04 /kernel/rcutree_trace.c
parent6ce75a2326e6f8b3bdfb60e1de7934b89858e87b (diff)
rcu: Use for_each_rcu_flavor() in TREE_RCU tracing
This commit applies the new for_each_rcu_flavor() macro to the kernel/rcutree_trace.c file. Signed-off-by: Paul E. McKenney <paulmck@linux.vnet.ibm.com>
Diffstat (limited to 'kernel/rcutree_trace.c')
-rw-r--r--kernel/rcutree_trace.c116
1 files changed, 43 insertions, 73 deletions
diff --git a/kernel/rcutree_trace.c b/kernel/rcutree_trace.c
index 057408be6c3b..a16ddbd6fdc4 100644
--- a/kernel/rcutree_trace.c
+++ b/kernel/rcutree_trace.c
@@ -46,24 +46,15 @@
46#define RCU_TREE_NONCORE 46#define RCU_TREE_NONCORE
47#include "rcutree.h" 47#include "rcutree.h"
48 48
49static 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
57static int show_rcubarrier(struct seq_file *m, void *unused) 49static int show_rcubarrier(struct seq_file *m, void *unused)
58{ 50{
59#ifdef CONFIG_TREE_PREEMPT_RCU 51 struct rcu_state *rsp;
60 seq_puts(m, "rcu_preempt: "); 52
61 print_rcubarrier(m, &rcu_preempt_state); 53 for_each_rcu_flavor(rsp)
62#endif /* #ifdef CONFIG_TREE_PREEMPT_RCU */ 54 seq_printf(m, "%s: %c bcc: %d nbd: %lu\n",
63 seq_puts(m, "rcu_sched: "); 55 rsp->name, rsp->rcu_barrier_in_progress ? 'B' : '.',
64 print_rcubarrier(m, &rcu_sched_state); 56 atomic_read(&rsp->barrier_cpu_count),
65 seq_puts(m, "rcu_bh: "); 57 rsp->n_barrier_done);
66 print_rcubarrier(m, &rcu_bh_state);
67 return 0; 58 return 0;
68} 59}
69 60
@@ -129,24 +120,16 @@ static void print_one_rcu_data(struct seq_file *m, struct rcu_data *rdp)
129 rdp->n_cbs_invoked, rdp->n_cbs_orphaned, rdp->n_cbs_adopted); 120 rdp->n_cbs_invoked, rdp->n_cbs_orphaned, rdp->n_cbs_adopted);
130} 121}
131 122
132#define PRINT_RCU_DATA(name, func, m) \
133 do { \
134 int _p_r_d_i; \
135 \
136 for_each_possible_cpu(_p_r_d_i) \
137 func(m, &per_cpu(name, _p_r_d_i)); \
138 } while (0)
139
140static int show_rcudata(struct seq_file *m, void *unused) 123static int show_rcudata(struct seq_file *m, void *unused)
141{ 124{
142#ifdef CONFIG_TREE_PREEMPT_RCU 125 int cpu;
143 seq_puts(m, "rcu_preempt:\n"); 126 struct rcu_state *rsp;
144 PRINT_RCU_DATA(rcu_preempt_data, print_one_rcu_data, m); 127
145#endif /* #ifdef CONFIG_TREE_PREEMPT_RCU */ 128 for_each_rcu_flavor(rsp) {
146 seq_puts(m, "rcu_sched:\n"); 129 seq_printf(m, "%s:\n", rsp->name);
147 PRINT_RCU_DATA(rcu_sched_data, print_one_rcu_data, m); 130 for_each_possible_cpu(cpu)
148 seq_puts(m, "rcu_bh:\n"); 131 print_one_rcu_data(m, per_cpu_ptr(rsp->rda, cpu));
149 PRINT_RCU_DATA(rcu_bh_data, print_one_rcu_data, m); 132 }
150 return 0; 133 return 0;
151} 134}
152 135
@@ -200,6 +183,9 @@ static void print_one_rcu_data_csv(struct seq_file *m, struct rcu_data *rdp)
200 183
201static int show_rcudata_csv(struct seq_file *m, void *unused) 184static int show_rcudata_csv(struct seq_file *m, void *unused)
202{ 185{
186 int cpu;
187 struct rcu_state *rsp;
188
203 seq_puts(m, "\"CPU\",\"Online?\",\"c\",\"g\",\"pq\",\"pgp\",\"pq\","); 189 seq_puts(m, "\"CPU\",\"Online?\",\"c\",\"g\",\"pq\",\"pgp\",\"pq\",");
204 seq_puts(m, "\"dt\",\"dt nesting\",\"dt NMI nesting\",\"df\","); 190 seq_puts(m, "\"dt\",\"dt nesting\",\"dt NMI nesting\",\"df\",");
205 seq_puts(m, "\"of\",\"qll\",\"ql\",\"qs\""); 191 seq_puts(m, "\"of\",\"qll\",\"ql\",\"qs\"");
@@ -207,14 +193,11 @@ static int show_rcudata_csv(struct seq_file *m, void *unused)
207 seq_puts(m, "\"kt\",\"ktl\""); 193 seq_puts(m, "\"kt\",\"ktl\"");
208#endif /* #ifdef CONFIG_RCU_BOOST */ 194#endif /* #ifdef CONFIG_RCU_BOOST */
209 seq_puts(m, ",\"b\",\"ci\",\"co\",\"ca\"\n"); 195 seq_puts(m, ",\"b\",\"ci\",\"co\",\"ca\"\n");
210#ifdef CONFIG_TREE_PREEMPT_RCU 196 for_each_rcu_flavor(rsp) {
211 seq_puts(m, "\"rcu_preempt:\"\n"); 197 seq_printf(m, "\"%s:\"\n", rsp->name);
212 PRINT_RCU_DATA(rcu_preempt_data, print_one_rcu_data_csv, m); 198 for_each_possible_cpu(cpu)
213#endif /* #ifdef CONFIG_TREE_PREEMPT_RCU */ 199 print_one_rcu_data_csv(m, per_cpu_ptr(rsp->rda, cpu));
214 seq_puts(m, "\"rcu_sched:\"\n"); 200 }
215 PRINT_RCU_DATA(rcu_sched_data, print_one_rcu_data_csv, m);
216 seq_puts(m, "\"rcu_bh:\"\n");
217 PRINT_RCU_DATA(rcu_bh_data, print_one_rcu_data_csv, m);
218 return 0; 201 return 0;
219} 202}
220 203
@@ -304,9 +287,9 @@ static void print_one_rcu_state(struct seq_file *m, struct rcu_state *rsp)
304 struct rcu_node *rnp; 287 struct rcu_node *rnp;
305 288
306 gpnum = rsp->gpnum; 289 gpnum = rsp->gpnum;
307 seq_printf(m, "c=%lu g=%lu s=%d jfq=%ld j=%x " 290 seq_printf(m, "%s: c=%lu g=%lu s=%d jfq=%ld j=%x "
308 "nfqs=%lu/nfqsng=%lu(%lu) fqlh=%lu oqlen=%ld/%ld\n", 291 "nfqs=%lu/nfqsng=%lu(%lu) fqlh=%lu oqlen=%ld/%ld\n",
309 rsp->completed, gpnum, rsp->fqs_state, 292 rsp->name, rsp->completed, gpnum, rsp->fqs_state,
310 (long)(rsp->jiffies_force_qs - jiffies), 293 (long)(rsp->jiffies_force_qs - jiffies),
311 (int)(jiffies & 0xffff), 294 (int)(jiffies & 0xffff),
312 rsp->n_force_qs, rsp->n_force_qs_ngp, 295 rsp->n_force_qs, rsp->n_force_qs_ngp,
@@ -329,14 +312,10 @@ static void print_one_rcu_state(struct seq_file *m, struct rcu_state *rsp)
329 312
330static int show_rcuhier(struct seq_file *m, void *unused) 313static int show_rcuhier(struct seq_file *m, void *unused)
331{ 314{
332#ifdef CONFIG_TREE_PREEMPT_RCU 315 struct rcu_state *rsp;
333 seq_puts(m, "rcu_preempt:\n"); 316
334 print_one_rcu_state(m, &rcu_preempt_state); 317 for_each_rcu_flavor(rsp)
335#endif /* #ifdef CONFIG_TREE_PREEMPT_RCU */ 318 print_one_rcu_state(m, rsp);
336 seq_puts(m, "rcu_sched:\n");
337 print_one_rcu_state(m, &rcu_sched_state);
338 seq_puts(m, "rcu_bh:\n");
339 print_one_rcu_state(m, &rcu_bh_state);
340 return 0; 319 return 0;
341} 320}
342 321
@@ -377,11 +356,10 @@ static void show_one_rcugp(struct seq_file *m, struct rcu_state *rsp)
377 356
378static int show_rcugp(struct seq_file *m, void *unused) 357static int show_rcugp(struct seq_file *m, void *unused)
379{ 358{
380#ifdef CONFIG_TREE_PREEMPT_RCU 359 struct rcu_state *rsp;
381 show_one_rcugp(m, &rcu_preempt_state); 360
382#endif /* #ifdef CONFIG_TREE_PREEMPT_RCU */ 361 for_each_rcu_flavor(rsp)
383 show_one_rcugp(m, &rcu_sched_state); 362 show_one_rcugp(m, rsp);
384 show_one_rcugp(m, &rcu_bh_state);
385 return 0; 363 return 0;
386} 364}
387 365
@@ -416,28 +394,20 @@ static void print_one_rcu_pending(struct seq_file *m, struct rcu_data *rdp)
416 rdp->n_rp_need_nothing); 394 rdp->n_rp_need_nothing);
417} 395}
418 396
419static void print_rcu_pendings(struct seq_file *m, struct rcu_state *rsp) 397static int show_rcu_pending(struct seq_file *m, void *unused)
420{ 398{
421 int cpu; 399 int cpu;
422 struct rcu_data *rdp; 400 struct rcu_data *rdp;
423 401 struct rcu_state *rsp;
424 for_each_possible_cpu(cpu) { 402
425 rdp = per_cpu_ptr(rsp->rda, cpu); 403 for_each_rcu_flavor(rsp) {
426 if (rdp->beenonline) 404 seq_printf(m, "%s:\n", rsp->name);
427 print_one_rcu_pending(m, rdp); 405 for_each_possible_cpu(cpu) {
406 rdp = per_cpu_ptr(rsp->rda, cpu);
407 if (rdp->beenonline)
408 print_one_rcu_pending(m, rdp);
409 }
428 } 410 }
429}
430
431static int show_rcu_pending(struct seq_file *m, void *unused)
432{
433#ifdef CONFIG_TREE_PREEMPT_RCU
434 seq_puts(m, "rcu_preempt:\n");
435 print_rcu_pendings(m, &rcu_preempt_state);
436#endif /* #ifdef CONFIG_TREE_PREEMPT_RCU */
437 seq_puts(m, "rcu_sched:\n");
438 print_rcu_pendings(m, &rcu_sched_state);
439 seq_puts(m, "rcu_bh:\n");
440 print_rcu_pendings(m, &rcu_bh_state);
441 return 0; 411 return 0;
442} 412}
443 413