aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPaul E. McKenney <paul.mckenney@linaro.org>2013-02-08 18:55:02 -0500
committerPaul E. McKenney <paulmck@linux.vnet.ibm.com>2013-03-26 11:04:46 -0400
commit09c7b890622d72b5e004cc249bbe610e8b928ddf (patch)
tree4326a3d6baaebaeb3417f0593bb017c2477b973b
parent21e7a6087480451804124cee27c0a7d0a7de1564 (diff)
rcu: Add event tracing for no-CBs CPUs' grace periods
Signed-off-by: Paul E. McKenney <paul.mckenney@linaro.org> Signed-off-by: Paul E. McKenney <paulmck@linux.vnet.ibm.com>
-rw-r--r--include/trace/events/rcu.h55
-rw-r--r--kernel/rcutree_plugin.h30
2 files changed, 85 insertions, 0 deletions
diff --git a/include/trace/events/rcu.h b/include/trace/events/rcu.h
index 1918e832da4f..cdfed6d386eb 100644
--- a/include/trace/events/rcu.h
+++ b/include/trace/events/rcu.h
@@ -72,6 +72,58 @@ TRACE_EVENT(rcu_grace_period,
72); 72);
73 73
74/* 74/*
75 * Tracepoint for no-callbacks grace-period events. The caller should
76 * pull the data from the rcu_node structure, other than rcuname, which
77 * comes from the rcu_state structure, and event, which is one of the
78 * following:
79 *
80 * "Startleaf": Request a nocb grace period based on leaf-node data.
81 * "Startedleaf": Leaf-node start proved sufficient.
82 * "Startedleafroot": Leaf-node start proved sufficient after checking root.
83 * "Startedroot": Requested a nocb grace period based on root-node data.
84 * "StartWait": Start waiting for the requested grace period.
85 * "ResumeWait": Resume waiting after signal.
86 * "EndWait": Complete wait.
87 * "Cleanup": Clean up rcu_node structure after previous GP.
88 * "CleanupMore": Clean up, and another no-CB GP is needed.
89 */
90TRACE_EVENT(rcu_nocb_grace_period,
91
92 TP_PROTO(char *rcuname, unsigned long gpnum, unsigned long completed,
93 unsigned long c, u8 level, int grplo, int grphi,
94 char *gpevent),
95
96 TP_ARGS(rcuname, gpnum, completed, c, level, grplo, grphi, gpevent),
97
98 TP_STRUCT__entry(
99 __field(char *, rcuname)
100 __field(unsigned long, gpnum)
101 __field(unsigned long, completed)
102 __field(unsigned long, c)
103 __field(u8, level)
104 __field(int, grplo)
105 __field(int, grphi)
106 __field(char *, gpevent)
107 ),
108
109 TP_fast_assign(
110 __entry->rcuname = rcuname;
111 __entry->gpnum = gpnum;
112 __entry->completed = completed;
113 __entry->c = c;
114 __entry->level = level;
115 __entry->grplo = grplo;
116 __entry->grphi = grphi;
117 __entry->gpevent = gpevent;
118 ),
119
120 TP_printk("%s %lu %lu %lu %u %d %d %s",
121 __entry->rcuname, __entry->gpnum, __entry->completed,
122 __entry->c, __entry->level, __entry->grplo, __entry->grphi,
123 __entry->gpevent)
124);
125
126/*
75 * Tracepoint for grace-period-initialization events. These are 127 * Tracepoint for grace-period-initialization events. These are
76 * distinguished by the type of RCU, the new grace-period number, the 128 * distinguished by the type of RCU, the new grace-period number, the
77 * rcu_node structure level, the starting and ending CPU covered by the 129 * rcu_node structure level, the starting and ending CPU covered by the
@@ -601,6 +653,9 @@ TRACE_EVENT(rcu_barrier,
601#define trace_rcu_grace_period(rcuname, gpnum, gpevent) do { } while (0) 653#define trace_rcu_grace_period(rcuname, gpnum, gpevent) do { } while (0)
602#define trace_rcu_grace_period_init(rcuname, gpnum, level, grplo, grphi, \ 654#define trace_rcu_grace_period_init(rcuname, gpnum, level, grplo, grphi, \
603 qsmask) do { } while (0) 655 qsmask) do { } while (0)
656#define trace_rcu_nocb_grace_period(rcuname, gpnum, completed, c, \
657 level, grplo, grphi, event) \
658 do { } while (0)
604#define trace_rcu_preempt_task(rcuname, pid, gpnum) do { } while (0) 659#define trace_rcu_preempt_task(rcuname, pid, gpnum) do { } while (0)
605#define trace_rcu_unlock_preempted_task(rcuname, gpnum, pid) do { } while (0) 660#define trace_rcu_unlock_preempted_task(rcuname, gpnum, pid) do { } while (0)
606#define trace_rcu_quiescent_state_report(rcuname, gpnum, mask, qsmask, level, \ 661#define trace_rcu_quiescent_state_report(rcuname, gpnum, mask, qsmask, level, \
diff --git a/kernel/rcutree_plugin.h b/kernel/rcutree_plugin.h
index 7225a5a14cef..e32236e83dda 100644
--- a/kernel/rcutree_plugin.h
+++ b/kernel/rcutree_plugin.h
@@ -2201,6 +2201,9 @@ static int rcu_nocb_gp_cleanup(struct rcu_state *rsp, struct rcu_node *rnp)
2201 wake_up_all(&rnp->nocb_gp_wq[c & 0x1]); 2201 wake_up_all(&rnp->nocb_gp_wq[c & 0x1]);
2202 rnp->n_nocb_gp_requests[c & 0x1] = 0; 2202 rnp->n_nocb_gp_requests[c & 0x1] = 0;
2203 needmore = rnp->n_nocb_gp_requests[(c + 1) & 0x1]; 2203 needmore = rnp->n_nocb_gp_requests[(c + 1) & 0x1];
2204 trace_rcu_nocb_grace_period(rsp->name, rnp->gpnum, rnp->completed,
2205 c, rnp->level, rnp->grplo, rnp->grphi,
2206 needmore ? "CleanupMore" : "Cleanup");
2204 return needmore; 2207 return needmore;
2205} 2208}
2206 2209
@@ -2347,6 +2350,9 @@ static void rcu_nocb_wait_gp(struct rcu_data *rdp)
2347 2350
2348 /* Count our request for a grace period. */ 2351 /* Count our request for a grace period. */
2349 rnp->n_nocb_gp_requests[c & 0x1]++; 2352 rnp->n_nocb_gp_requests[c & 0x1]++;
2353 trace_rcu_nocb_grace_period(rdp->rsp->name, rnp->gpnum, rnp->completed,
2354 c, rnp->level, rnp->grplo, rnp->grphi,
2355 "Startleaf");
2350 2356
2351 if (rnp->gpnum != rnp->completed) { 2357 if (rnp->gpnum != rnp->completed) {
2352 2358
@@ -2355,6 +2361,10 @@ static void rcu_nocb_wait_gp(struct rcu_data *rdp)
2355 * is in progress, so we are done. When this grace 2361 * is in progress, so we are done. When this grace
2356 * period ends, our request will be acted upon. 2362 * period ends, our request will be acted upon.
2357 */ 2363 */
2364 trace_rcu_nocb_grace_period(rdp->rsp->name,
2365 rnp->gpnum, rnp->completed, c,
2366 rnp->level, rnp->grplo, rnp->grphi,
2367 "Startedleaf");
2358 raw_spin_unlock_irqrestore(&rnp->lock, flags); 2368 raw_spin_unlock_irqrestore(&rnp->lock, flags);
2359 2369
2360 } else { 2370 } else {
@@ -2366,6 +2376,11 @@ static void rcu_nocb_wait_gp(struct rcu_data *rdp)
2366 if (rnp != rnp_root) 2376 if (rnp != rnp_root)
2367 raw_spin_lock(&rnp_root->lock); /* irqs disabled. */ 2377 raw_spin_lock(&rnp_root->lock); /* irqs disabled. */
2368 if (rnp_root->gpnum != rnp_root->completed) { 2378 if (rnp_root->gpnum != rnp_root->completed) {
2379 trace_rcu_nocb_grace_period(rdp->rsp->name,
2380 rnp->gpnum, rnp->completed,
2381 c, rnp->level,
2382 rnp->grplo, rnp->grphi,
2383 "Startedleafroot");
2369 raw_spin_unlock(&rnp_root->lock); /* irqs disabled. */ 2384 raw_spin_unlock(&rnp_root->lock); /* irqs disabled. */
2370 } else { 2385 } else {
2371 2386
@@ -2381,6 +2396,11 @@ static void rcu_nocb_wait_gp(struct rcu_data *rdp)
2381 c = rnp_root->completed + 1; 2396 c = rnp_root->completed + 1;
2382 rnp->n_nocb_gp_requests[c & 0x1]++; 2397 rnp->n_nocb_gp_requests[c & 0x1]++;
2383 rnp_root->n_nocb_gp_requests[c & 0x1]++; 2398 rnp_root->n_nocb_gp_requests[c & 0x1]++;
2399 trace_rcu_nocb_grace_period(rdp->rsp->name,
2400 rnp->gpnum, rnp->completed,
2401 c, rnp->level,
2402 rnp->grplo, rnp->grphi,
2403 "Startedroot");
2384 local_save_flags(flags1); 2404 local_save_flags(flags1);
2385 rcu_start_gp(rdp->rsp, flags1); /* Rlses ->lock. */ 2405 rcu_start_gp(rdp->rsp, flags1); /* Rlses ->lock. */
2386 } 2406 }
@@ -2396,6 +2416,9 @@ static void rcu_nocb_wait_gp(struct rcu_data *rdp)
2396 * Wait for the grace period. Do so interruptibly to avoid messing 2416 * Wait for the grace period. Do so interruptibly to avoid messing
2397 * up the load average. 2417 * up the load average.
2398 */ 2418 */
2419 trace_rcu_nocb_grace_period(rdp->rsp->name, rnp->gpnum, rnp->completed,
2420 c, rnp->level, rnp->grplo, rnp->grphi,
2421 "StartWait");
2399 for (;;) { 2422 for (;;) {
2400 wait_event_interruptible( 2423 wait_event_interruptible(
2401 rnp->nocb_gp_wq[c & 0x1], 2424 rnp->nocb_gp_wq[c & 0x1],
@@ -2403,7 +2426,14 @@ static void rcu_nocb_wait_gp(struct rcu_data *rdp)
2403 if (likely(d)) 2426 if (likely(d))
2404 break; 2427 break;
2405 flush_signals(current); 2428 flush_signals(current);
2429 trace_rcu_nocb_grace_period(rdp->rsp->name,
2430 rnp->gpnum, rnp->completed, c,
2431 rnp->level, rnp->grplo, rnp->grphi,
2432 "ResumeWait");
2406 } 2433 }
2434 trace_rcu_nocb_grace_period(rdp->rsp->name, rnp->gpnum, rnp->completed,
2435 c, rnp->level, rnp->grplo, rnp->grphi,
2436 "EndWait");
2407 smp_mb(); /* Ensure that CB invocation happens after GP end. */ 2437 smp_mb(); /* Ensure that CB invocation happens after GP end. */
2408} 2438}
2409 2439