blob: ab458eb689fb38c75497965239e5b80ed941eda4 [file] [log] [blame]
Paul E. McKenney29c00b42011-06-17 15:53:19 -07001#undef TRACE_SYSTEM
2#define TRACE_SYSTEM rcu
3
4#if !defined(_TRACE_RCU_H) || defined(TRACE_HEADER_MULTI_READ)
5#define _TRACE_RCU_H
6
7#include <linux/tracepoint.h>
8
9/*
Paul E. McKenney300df912011-06-18 22:26:31 -070010 * Tracepoint for start/end markers used for utilization calculations.
11 * By convention, the string is of the following forms:
12 *
13 * "Start <activity>" -- Mark the start of the specified activity,
14 * such as "context switch". Nesting is permitted.
15 * "End <activity>" -- Mark the end of the specified activity.
Paul E. McKenney29c00b42011-06-17 15:53:19 -070016 */
Paul E. McKenney300df912011-06-18 22:26:31 -070017TRACE_EVENT(rcu_utilization,
Paul E. McKenney29c00b42011-06-17 15:53:19 -070018
Paul E. McKenney300df912011-06-18 22:26:31 -070019 TP_PROTO(char *s),
Paul E. McKenney29c00b42011-06-17 15:53:19 -070020
Paul E. McKenney300df912011-06-18 22:26:31 -070021 TP_ARGS(s),
Paul E. McKenney29c00b42011-06-17 15:53:19 -070022
23 TP_STRUCT__entry(
Paul E. McKenney300df912011-06-18 22:26:31 -070024 __field(char *, s)
Paul E. McKenney29c00b42011-06-17 15:53:19 -070025 ),
26
27 TP_fast_assign(
Paul E. McKenney300df912011-06-18 22:26:31 -070028 __entry->s = s;
Paul E. McKenney29c00b42011-06-17 15:53:19 -070029 ),
30
Paul E. McKenney300df912011-06-18 22:26:31 -070031 TP_printk("%s", __entry->s)
Paul E. McKenney29c00b42011-06-17 15:53:19 -070032);
33
34/*
Paul E. McKenney300df912011-06-18 22:26:31 -070035 * 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.
39 */
40TRACE_EVENT(rcu_batch_start,
41
42 TP_PROTO(long qlen, int blimit),
43
44 TP_ARGS(qlen, blimit),
45
46 TP_STRUCT__entry(
47 __field(long, qlen)
48 __field(int, blimit)
49 ),
50
51 TP_fast_assign(
52 __entry->qlen = qlen;
53 __entry->blimit = blimit;
54 ),
55
56 TP_printk("CBs=%ld bl=%d", __entry->qlen, __entry->blimit)
57);
58
59/*
60 * Tracepoint for the invocation of a single RCU callback function.
61 * The argument is a pointer to the RCU callback itself.
Paul E. McKenney29c00b42011-06-17 15:53:19 -070062 */
63TRACE_EVENT(rcu_invoke_callback,
64
65 TP_PROTO(struct rcu_head *rhp),
66
67 TP_ARGS(rhp),
68
69 TP_STRUCT__entry(
Paul E. McKenney300df912011-06-18 22:26:31 -070070 __field(void *, rhp)
71 __field(void *, func)
Paul E. McKenney29c00b42011-06-17 15:53:19 -070072 ),
73
74 TP_fast_assign(
Paul E. McKenney300df912011-06-18 22:26:31 -070075 __entry->rhp = rhp;
76 __entry->func = rhp->func;
Paul E. McKenney29c00b42011-06-17 15:53:19 -070077 ),
78
79 TP_printk("rhp=%p func=%pf", __entry->rhp, __entry->func)
80);
81
82/*
Paul E. McKenney300df912011-06-18 22:26:31 -070083 * Tracepoint for the invocation of a single RCU callback of the special
84 * kfree() form. The first argument is a pointer to the RCU callback
85 * and the second argument is the offset of the callback within the
86 * enclosing RCU-protected data structure.
Paul E. McKenney29c00b42011-06-17 15:53:19 -070087 */
88TRACE_EVENT(rcu_invoke_kfree_callback,
89
90 TP_PROTO(struct rcu_head *rhp, unsigned long offset),
91
92 TP_ARGS(rhp, offset),
93
94 TP_STRUCT__entry(
Paul E. McKenney300df912011-06-18 22:26:31 -070095 __field(void *, rhp)
96 __field(unsigned long, offset)
Paul E. McKenney29c00b42011-06-17 15:53:19 -070097 ),
98
99 TP_fast_assign(
Paul E. McKenney300df912011-06-18 22:26:31 -0700100 __entry->rhp = rhp;
Paul E. McKenney29c00b42011-06-17 15:53:19 -0700101 __entry->offset = offset;
102 ),
103
104 TP_printk("rhp=%p func=%ld", __entry->rhp, __entry->offset)
105);
106
107/*
Paul E. McKenney300df912011-06-18 22:26:31 -0700108 * Tracepoint for exiting rcu_do_batch after RCU callbacks have been
109 * invoked. The first argument is the number of callbacks actually invoked.
Paul E. McKenney29c00b42011-06-17 15:53:19 -0700110 */
111TRACE_EVENT(rcu_batch_end,
112
113 TP_PROTO(int callbacks_invoked),
114
115 TP_ARGS(callbacks_invoked),
116
117 TP_STRUCT__entry(
Paul E. McKenney300df912011-06-18 22:26:31 -0700118 __field(int, callbacks_invoked)
Paul E. McKenney29c00b42011-06-17 15:53:19 -0700119 ),
120
121 TP_fast_assign(
Paul E. McKenney300df912011-06-18 22:26:31 -0700122 __entry->callbacks_invoked = callbacks_invoked;
Paul E. McKenney29c00b42011-06-17 15:53:19 -0700123 ),
124
125 TP_printk("CBs-invoked=%d", __entry->callbacks_invoked)
126);
127
128#endif /* _TRACE_RCU_H */
129
130/* This part must be outside protection */
131#include <trace/define_trace.h>