blob: 508824e5a77de07b4481eb4ac27c76bab830abf5 [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
Paul E. McKenney72fe7012011-06-21 01:14:54 -070036 * 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.
Paul E. McKenney300df912011-06-18 22:26:31 -070040 */
41TRACE_EVENT(rcu_batch_start,
42
Paul E. McKenney72fe7012011-06-21 01:14:54 -070043 TP_PROTO(char *rcuname, long qlen, int blimit),
Paul E. McKenney300df912011-06-18 22:26:31 -070044
Paul E. McKenney72fe7012011-06-21 01:14:54 -070045 TP_ARGS(rcuname, qlen, blimit),
Paul E. McKenney300df912011-06-18 22:26:31 -070046
47 TP_STRUCT__entry(
Paul E. McKenney72fe7012011-06-21 01:14:54 -070048 __field(char *, rcuname)
Paul E. McKenney300df912011-06-18 22:26:31 -070049 __field(long, qlen)
50 __field(int, blimit)
51 ),
52
53 TP_fast_assign(
Paul E. McKenney72fe7012011-06-21 01:14:54 -070054 __entry->rcuname = rcuname;
Paul E. McKenney300df912011-06-18 22:26:31 -070055 __entry->qlen = qlen;
56 __entry->blimit = blimit;
57 ),
58
Paul E. McKenney72fe7012011-06-21 01:14:54 -070059 TP_printk("%s CBs=%ld bl=%d",
60 __entry->rcuname, __entry->qlen, __entry->blimit)
Paul E. McKenney300df912011-06-18 22:26:31 -070061);
62
63/*
64 * Tracepoint for the invocation of a single RCU callback function.
65 * The argument is a pointer to the RCU callback itself.
Paul E. McKenney29c00b42011-06-17 15:53:19 -070066 */
67TRACE_EVENT(rcu_invoke_callback,
68
69 TP_PROTO(struct rcu_head *rhp),
70
71 TP_ARGS(rhp),
72
73 TP_STRUCT__entry(
Paul E. McKenney300df912011-06-18 22:26:31 -070074 __field(void *, rhp)
75 __field(void *, func)
Paul E. McKenney29c00b42011-06-17 15:53:19 -070076 ),
77
78 TP_fast_assign(
Paul E. McKenney300df912011-06-18 22:26:31 -070079 __entry->rhp = rhp;
80 __entry->func = rhp->func;
Paul E. McKenney29c00b42011-06-17 15:53:19 -070081 ),
82
83 TP_printk("rhp=%p func=%pf", __entry->rhp, __entry->func)
84);
85
86/*
Paul E. McKenney300df912011-06-18 22:26:31 -070087 * Tracepoint for the invocation of a single RCU callback of the special
88 * kfree() form. The first argument is a pointer to the RCU callback
89 * and the second argument is the offset of the callback within the
90 * enclosing RCU-protected data structure.
Paul E. McKenney29c00b42011-06-17 15:53:19 -070091 */
92TRACE_EVENT(rcu_invoke_kfree_callback,
93
94 TP_PROTO(struct rcu_head *rhp, unsigned long offset),
95
96 TP_ARGS(rhp, offset),
97
98 TP_STRUCT__entry(
Paul E. McKenney300df912011-06-18 22:26:31 -070099 __field(void *, rhp)
100 __field(unsigned long, offset)
Paul E. McKenney29c00b42011-06-17 15:53:19 -0700101 ),
102
103 TP_fast_assign(
Paul E. McKenney300df912011-06-18 22:26:31 -0700104 __entry->rhp = rhp;
Paul E. McKenney29c00b42011-06-17 15:53:19 -0700105 __entry->offset = offset;
106 ),
107
108 TP_printk("rhp=%p func=%ld", __entry->rhp, __entry->offset)
109);
110
111/*
Paul E. McKenney300df912011-06-18 22:26:31 -0700112 * Tracepoint for exiting rcu_do_batch after RCU callbacks have been
Paul E. McKenney72fe7012011-06-21 01:14:54 -0700113 * invoked. The first argument is the name of the RCU flavor and
114 * the second argument is number of callbacks actually invoked.
Paul E. McKenney29c00b42011-06-17 15:53:19 -0700115 */
116TRACE_EVENT(rcu_batch_end,
117
Paul E. McKenney72fe7012011-06-21 01:14:54 -0700118 TP_PROTO(char *rcuname, int callbacks_invoked),
Paul E. McKenney29c00b42011-06-17 15:53:19 -0700119
Paul E. McKenney72fe7012011-06-21 01:14:54 -0700120 TP_ARGS(rcuname, callbacks_invoked),
Paul E. McKenney29c00b42011-06-17 15:53:19 -0700121
122 TP_STRUCT__entry(
Paul E. McKenney72fe7012011-06-21 01:14:54 -0700123 __field(char *, rcuname)
Paul E. McKenney300df912011-06-18 22:26:31 -0700124 __field(int, callbacks_invoked)
Paul E. McKenney29c00b42011-06-17 15:53:19 -0700125 ),
126
127 TP_fast_assign(
Paul E. McKenney72fe7012011-06-21 01:14:54 -0700128 __entry->rcuname = rcuname;
Paul E. McKenney300df912011-06-18 22:26:31 -0700129 __entry->callbacks_invoked = callbacks_invoked;
Paul E. McKenney29c00b42011-06-17 15:53:19 -0700130 ),
131
Paul E. McKenney72fe7012011-06-21 01:14:54 -0700132 TP_printk("%s CBs-invoked=%d",
133 __entry->rcuname, __entry->callbacks_invoked)
Paul E. McKenney29c00b42011-06-17 15:53:19 -0700134);
135
136#endif /* _TRACE_RCU_H */
137
138/* This part must be outside protection */
139#include <trace/define_trace.h>