Commit 72fe701b authored by Paul E. McKenney's avatar Paul E. McKenney Committed by Paul E. McKenney

rcu: Add RCU type to callback-invocation tracing

Add a string to the rcu_batch_start() and rcu_batch_end() trace
messages that indicates the RCU type ("rcu_sched", "rcu_bh", or
"rcu_preempt").  The trace messages for the actual invocations
themselves are not marked, as it should be clear from the
rcu_batch_start() and rcu_batch_end() events before and after.
Signed-off-by: default avatarPaul E. McKenney <paul.mckenney@linaro.org>
Signed-off-by: default avatarPaul E. McKenney <paulmck@linux.vnet.ibm.com>
parent e99033c5
...@@ -33,27 +33,31 @@ TRACE_EVENT(rcu_utilization, ...@@ -33,27 +33,31 @@ TRACE_EVENT(rcu_utilization,
/* /*
* Tracepoint for marking the beginning rcu_do_batch, performed to start * Tracepoint for marking the beginning rcu_do_batch, performed to start
* RCU callback invocation. The first argument is the total number of * RCU callback invocation. The first argument is the RCU flavor,
* callbacks (including those that are not yet ready to be invoked), * the second is the total number of callbacks (including those that
* and the second argument is the current RCU-callback batch limit. * are not yet ready to be invoked), and the third argument is the
* current RCU-callback batch limit.
*/ */
TRACE_EVENT(rcu_batch_start, TRACE_EVENT(rcu_batch_start,
TP_PROTO(long qlen, int blimit), TP_PROTO(char *rcuname, long qlen, int blimit),
TP_ARGS(qlen, blimit), TP_ARGS(rcuname, qlen, blimit),
TP_STRUCT__entry( TP_STRUCT__entry(
__field(char *, rcuname)
__field(long, qlen) __field(long, qlen)
__field(int, blimit) __field(int, blimit)
), ),
TP_fast_assign( TP_fast_assign(
__entry->rcuname = rcuname;
__entry->qlen = qlen; __entry->qlen = qlen;
__entry->blimit = blimit; __entry->blimit = blimit;
), ),
TP_printk("CBs=%ld bl=%d", __entry->qlen, __entry->blimit) TP_printk("%s CBs=%ld bl=%d",
__entry->rcuname, __entry->qlen, __entry->blimit)
); );
/* /*
...@@ -106,23 +110,27 @@ TRACE_EVENT(rcu_invoke_kfree_callback, ...@@ -106,23 +110,27 @@ TRACE_EVENT(rcu_invoke_kfree_callback,
/* /*
* Tracepoint for exiting rcu_do_batch after RCU callbacks have been * Tracepoint for exiting rcu_do_batch after RCU callbacks have been
* invoked. The first argument is the number of callbacks actually invoked. * invoked. The first argument is the name of the RCU flavor and
* the second argument is number of callbacks actually invoked.
*/ */
TRACE_EVENT(rcu_batch_end, TRACE_EVENT(rcu_batch_end,
TP_PROTO(int callbacks_invoked), TP_PROTO(char *rcuname, int callbacks_invoked),
TP_ARGS(callbacks_invoked), TP_ARGS(rcuname, callbacks_invoked),
TP_STRUCT__entry( TP_STRUCT__entry(
__field(char *, rcuname)
__field(int, callbacks_invoked) __field(int, callbacks_invoked)
), ),
TP_fast_assign( TP_fast_assign(
__entry->rcuname = rcuname;
__entry->callbacks_invoked = callbacks_invoked; __entry->callbacks_invoked = callbacks_invoked;
), ),
TP_printk("CBs-invoked=%d", __entry->callbacks_invoked) TP_printk("%s CBs-invoked=%d",
__entry->rcuname, __entry->callbacks_invoked)
); );
#endif /* _TRACE_RCU_H */ #endif /* _TRACE_RCU_H */
......
...@@ -168,14 +168,14 @@ static void rcu_process_callbacks(struct rcu_ctrlblk *rcp) ...@@ -168,14 +168,14 @@ static void rcu_process_callbacks(struct rcu_ctrlblk *rcp)
/* If no RCU callbacks ready to invoke, just return. */ /* If no RCU callbacks ready to invoke, just return. */
if (&rcp->rcucblist == rcp->donetail) { if (&rcp->rcucblist == rcp->donetail) {
RCU_TRACE(trace_rcu_batch_start(0, -1)); RCU_TRACE(trace_rcu_batch_start(rcp->name, 0, -1));
RCU_TRACE(trace_rcu_batch_end(0)); RCU_TRACE(trace_rcu_batch_end(rcp->name, 0));
return; return;
} }
/* Move the ready-to-invoke callbacks to a local list. */ /* Move the ready-to-invoke callbacks to a local list. */
local_irq_save(flags); local_irq_save(flags);
RCU_TRACE(trace_rcu_batch_start(0, -1)); RCU_TRACE(trace_rcu_batch_start(rcp->name, 0, -1));
list = rcp->rcucblist; list = rcp->rcucblist;
rcp->rcucblist = *rcp->donetail; rcp->rcucblist = *rcp->donetail;
*rcp->donetail = NULL; *rcp->donetail = NULL;
...@@ -197,7 +197,7 @@ static void rcu_process_callbacks(struct rcu_ctrlblk *rcp) ...@@ -197,7 +197,7 @@ static void rcu_process_callbacks(struct rcu_ctrlblk *rcp)
RCU_TRACE(cb_count++); RCU_TRACE(cb_count++);
} }
RCU_TRACE(rcu_trace_sub_qlen(rcp, cb_count)); RCU_TRACE(rcu_trace_sub_qlen(rcp, cb_count));
RCU_TRACE(trace_rcu_batch_end(cb_count)); RCU_TRACE(trace_rcu_batch_end(rcp->name, cb_count));
} }
/* /*
......
...@@ -1199,8 +1199,8 @@ static void rcu_do_batch(struct rcu_state *rsp, struct rcu_data *rdp) ...@@ -1199,8 +1199,8 @@ static void rcu_do_batch(struct rcu_state *rsp, struct rcu_data *rdp)
/* If no callbacks are ready, just return.*/ /* If no callbacks are ready, just return.*/
if (!cpu_has_callbacks_ready_to_invoke(rdp)) { if (!cpu_has_callbacks_ready_to_invoke(rdp)) {
trace_rcu_batch_start(0, 0); trace_rcu_batch_start(rsp->name, 0, 0);
trace_rcu_batch_end(0); trace_rcu_batch_end(rsp->name, 0);
return; return;
} }
...@@ -1210,7 +1210,7 @@ static void rcu_do_batch(struct rcu_state *rsp, struct rcu_data *rdp) ...@@ -1210,7 +1210,7 @@ static void rcu_do_batch(struct rcu_state *rsp, struct rcu_data *rdp)
*/ */
local_irq_save(flags); local_irq_save(flags);
bl = rdp->blimit; bl = rdp->blimit;
trace_rcu_batch_start(rdp->qlen, bl); trace_rcu_batch_start(rsp->name, rdp->qlen, bl);
list = rdp->nxtlist; list = rdp->nxtlist;
rdp->nxtlist = *rdp->nxttail[RCU_DONE_TAIL]; rdp->nxtlist = *rdp->nxttail[RCU_DONE_TAIL];
*rdp->nxttail[RCU_DONE_TAIL] = NULL; *rdp->nxttail[RCU_DONE_TAIL] = NULL;
...@@ -1233,7 +1233,7 @@ static void rcu_do_batch(struct rcu_state *rsp, struct rcu_data *rdp) ...@@ -1233,7 +1233,7 @@ static void rcu_do_batch(struct rcu_state *rsp, struct rcu_data *rdp)
} }
local_irq_save(flags); local_irq_save(flags);
trace_rcu_batch_end(count); trace_rcu_batch_end(rsp->name, count);
/* Update count, and requeue any remaining callbacks. */ /* Update count, and requeue any remaining callbacks. */
rdp->qlen -= count; rdp->qlen -= count;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment