Skip to content

Commit 72fe701

Browse files
Paul E. McKenneypaulmck
authored andcommitted
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: Paul E. McKenney <paul.mckenney@linaro.org> Signed-off-by: Paul E. McKenney <paulmck@linux.vnet.ibm.com>
1 parent e99033c commit 72fe701

3 files changed

Lines changed: 26 additions & 18 deletions

File tree

‎include/trace/events/rcu.h‎

Lines changed: 18 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -33,27 +33,31 @@ TRACE_EVENT(rcu_utilization,
3333

3434
/*
3535
* Tracepoint for marking the beginning rcu_do_batch, performed to start
36-
* RCU callback invocation. The first argument is the total number of
37-
* callbacks (including those that are not yet ready to be invoked),
38-
* and the second argument is the current RCU-callback batch limit.
36+
* RCU callback invocation. The first argument is the RCU flavor,
37+
* the second is the total number of callbacks (including those that
38+
* are not yet ready to be invoked), and the third argument is the
39+
* current RCU-callback batch limit.
3940
*/
4041
TRACE_EVENT(rcu_batch_start,
4142

42-
TP_PROTO(long qlen, int blimit),
43+
TP_PROTO(char *rcuname, long qlen, int blimit),
4344

44-
TP_ARGS(qlen, blimit),
45+
TP_ARGS(rcuname, qlen, blimit),
4546

4647
TP_STRUCT__entry(
48+
__field(char *, rcuname)
4749
__field(long, qlen)
4850
__field(int, blimit)
4951
),
5052

5153
TP_fast_assign(
54+
__entry->rcuname = rcuname;
5255
__entry->qlen = qlen;
5356
__entry->blimit = blimit;
5457
),
5558

56-
TP_printk("CBs=%ld bl=%d", __entry->qlen, __entry->blimit)
59+
TP_printk("%s CBs=%ld bl=%d",
60+
__entry->rcuname, __entry->qlen, __entry->blimit)
5761
);
5862

5963
/*
@@ -106,23 +110,27 @@ TRACE_EVENT(rcu_invoke_kfree_callback,
106110

107111
/*
108112
* Tracepoint for exiting rcu_do_batch after RCU callbacks have been
109-
* invoked. The first argument is the number of callbacks actually invoked.
113+
* invoked. The first argument is the name of the RCU flavor and
114+
* the second argument is number of callbacks actually invoked.
110115
*/
111116
TRACE_EVENT(rcu_batch_end,
112117

113-
TP_PROTO(int callbacks_invoked),
118+
TP_PROTO(char *rcuname, int callbacks_invoked),
114119

115-
TP_ARGS(callbacks_invoked),
120+
TP_ARGS(rcuname, callbacks_invoked),
116121

117122
TP_STRUCT__entry(
123+
__field(char *, rcuname)
118124
__field(int, callbacks_invoked)
119125
),
120126

121127
TP_fast_assign(
128+
__entry->rcuname = rcuname;
122129
__entry->callbacks_invoked = callbacks_invoked;
123130
),
124131

125-
TP_printk("CBs-invoked=%d", __entry->callbacks_invoked)
132+
TP_printk("%s CBs-invoked=%d",
133+
__entry->rcuname, __entry->callbacks_invoked)
126134
);
127135

128136
#endif /* _TRACE_RCU_H */

‎kernel/rcutiny.c‎

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -168,14 +168,14 @@ static void rcu_process_callbacks(struct rcu_ctrlblk *rcp)
168168

169169
/* If no RCU callbacks ready to invoke, just return. */
170170
if (&rcp->rcucblist == rcp->donetail) {
171-
RCU_TRACE(trace_rcu_batch_start(0, -1));
172-
RCU_TRACE(trace_rcu_batch_end(0));
171+
RCU_TRACE(trace_rcu_batch_start(rcp->name, 0, -1));
172+
RCU_TRACE(trace_rcu_batch_end(rcp->name, 0));
173173
return;
174174
}
175175

176176
/* Move the ready-to-invoke callbacks to a local list. */
177177
local_irq_save(flags);
178-
RCU_TRACE(trace_rcu_batch_start(0, -1));
178+
RCU_TRACE(trace_rcu_batch_start(rcp->name, 0, -1));
179179
list = rcp->rcucblist;
180180
rcp->rcucblist = *rcp->donetail;
181181
*rcp->donetail = NULL;
@@ -197,7 +197,7 @@ static void rcu_process_callbacks(struct rcu_ctrlblk *rcp)
197197
RCU_TRACE(cb_count++);
198198
}
199199
RCU_TRACE(rcu_trace_sub_qlen(rcp, cb_count));
200-
RCU_TRACE(trace_rcu_batch_end(cb_count));
200+
RCU_TRACE(trace_rcu_batch_end(rcp->name, cb_count));
201201
}
202202

203203
/*

‎kernel/rcutree.c‎

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1199,8 +1199,8 @@ static void rcu_do_batch(struct rcu_state *rsp, struct rcu_data *rdp)
11991199

12001200
/* If no callbacks are ready, just return.*/
12011201
if (!cpu_has_callbacks_ready_to_invoke(rdp)) {
1202-
trace_rcu_batch_start(0, 0);
1203-
trace_rcu_batch_end(0);
1202+
trace_rcu_batch_start(rsp->name, 0, 0);
1203+
trace_rcu_batch_end(rsp->name, 0);
12041204
return;
12051205
}
12061206

@@ -1210,7 +1210,7 @@ static void rcu_do_batch(struct rcu_state *rsp, struct rcu_data *rdp)
12101210
*/
12111211
local_irq_save(flags);
12121212
bl = rdp->blimit;
1213-
trace_rcu_batch_start(rdp->qlen, bl);
1213+
trace_rcu_batch_start(rsp->name, rdp->qlen, bl);
12141214
list = rdp->nxtlist;
12151215
rdp->nxtlist = *rdp->nxttail[RCU_DONE_TAIL];
12161216
*rdp->nxttail[RCU_DONE_TAIL] = NULL;
@@ -1233,7 +1233,7 @@ static void rcu_do_batch(struct rcu_state *rsp, struct rcu_data *rdp)
12331233
}
12341234

12351235
local_irq_save(flags);
1236-
trace_rcu_batch_end(count);
1236+
trace_rcu_batch_end(rsp->name, count);
12371237

12381238
/* Update count, and requeue any remaining callbacks. */
12391239
rdp->qlen -= count;

0 commit comments

Comments
 (0)