blob: ac52aba00a3e4fbfdcc4be1f162779afb92e7723 [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. McKenney385680a2011-06-21 22:43:26 -070016 *
17 * An "@" character within "<activity>" is a comment character: Data
18 * reduction scripts will ignore the "@" and the remainder of the line.
Paul E. McKenney29c00b42011-06-17 15:53:19 -070019 */
Paul E. McKenney300df912011-06-18 22:26:31 -070020TRACE_EVENT(rcu_utilization,
Paul E. McKenney29c00b42011-06-17 15:53:19 -070021
Paul E. McKenney300df912011-06-18 22:26:31 -070022 TP_PROTO(char *s),
Paul E. McKenney29c00b42011-06-17 15:53:19 -070023
Paul E. McKenney300df912011-06-18 22:26:31 -070024 TP_ARGS(s),
Paul E. McKenney29c00b42011-06-17 15:53:19 -070025
26 TP_STRUCT__entry(
Paul E. McKenney300df912011-06-18 22:26:31 -070027 __field(char *, s)
Paul E. McKenney29c00b42011-06-17 15:53:19 -070028 ),
29
30 TP_fast_assign(
Paul E. McKenney300df912011-06-18 22:26:31 -070031 __entry->s = s;
Paul E. McKenney29c00b42011-06-17 15:53:19 -070032 ),
33
Paul E. McKenney300df912011-06-18 22:26:31 -070034 TP_printk("%s", __entry->s)
Paul E. McKenney29c00b42011-06-17 15:53:19 -070035);
36
37/*
Paul E. McKenney300df912011-06-18 22:26:31 -070038 * Tracepoint for marking the beginning rcu_do_batch, performed to start
Paul E. McKenney72fe7012011-06-21 01:14:54 -070039 * RCU callback invocation. The first argument is the RCU flavor,
40 * the second is the total number of callbacks (including those that
41 * are not yet ready to be invoked), and the third argument is the
42 * current RCU-callback batch limit.
Paul E. McKenney300df912011-06-18 22:26:31 -070043 */
44TRACE_EVENT(rcu_batch_start,
45
Paul E. McKenney72fe7012011-06-21 01:14:54 -070046 TP_PROTO(char *rcuname, long qlen, int blimit),
Paul E. McKenney300df912011-06-18 22:26:31 -070047
Paul E. McKenney72fe7012011-06-21 01:14:54 -070048 TP_ARGS(rcuname, qlen, blimit),
Paul E. McKenney300df912011-06-18 22:26:31 -070049
50 TP_STRUCT__entry(
Paul E. McKenney72fe7012011-06-21 01:14:54 -070051 __field(char *, rcuname)
Paul E. McKenney300df912011-06-18 22:26:31 -070052 __field(long, qlen)
53 __field(int, blimit)
54 ),
55
56 TP_fast_assign(
Paul E. McKenney72fe7012011-06-21 01:14:54 -070057 __entry->rcuname = rcuname;
Paul E. McKenney300df912011-06-18 22:26:31 -070058 __entry->qlen = qlen;
59 __entry->blimit = blimit;
60 ),
61
Paul E. McKenney72fe7012011-06-21 01:14:54 -070062 TP_printk("%s CBs=%ld bl=%d",
63 __entry->rcuname, __entry->qlen, __entry->blimit)
Paul E. McKenney300df912011-06-18 22:26:31 -070064);
65
66/*
67 * Tracepoint for the invocation of a single RCU callback function.
68 * The argument is a pointer to the RCU callback itself.
Paul E. McKenney29c00b42011-06-17 15:53:19 -070069 */
70TRACE_EVENT(rcu_invoke_callback,
71
72 TP_PROTO(struct rcu_head *rhp),
73
74 TP_ARGS(rhp),
75
76 TP_STRUCT__entry(
Paul E. McKenney300df912011-06-18 22:26:31 -070077 __field(void *, rhp)
78 __field(void *, func)
Paul E. McKenney29c00b42011-06-17 15:53:19 -070079 ),
80
81 TP_fast_assign(
Paul E. McKenney300df912011-06-18 22:26:31 -070082 __entry->rhp = rhp;
83 __entry->func = rhp->func;
Paul E. McKenney29c00b42011-06-17 15:53:19 -070084 ),
85
86 TP_printk("rhp=%p func=%pf", __entry->rhp, __entry->func)
87);
88
89/*
Paul E. McKenney300df912011-06-18 22:26:31 -070090 * Tracepoint for the invocation of a single RCU callback of the special
91 * kfree() form. The first argument is a pointer to the RCU callback
92 * and the second argument is the offset of the callback within the
93 * enclosing RCU-protected data structure.
Paul E. McKenney29c00b42011-06-17 15:53:19 -070094 */
95TRACE_EVENT(rcu_invoke_kfree_callback,
96
97 TP_PROTO(struct rcu_head *rhp, unsigned long offset),
98
99 TP_ARGS(rhp, offset),
100
101 TP_STRUCT__entry(
Paul E. McKenney300df912011-06-18 22:26:31 -0700102 __field(void *, rhp)
103 __field(unsigned long, offset)
Paul E. McKenney29c00b42011-06-17 15:53:19 -0700104 ),
105
106 TP_fast_assign(
Paul E. McKenney300df912011-06-18 22:26:31 -0700107 __entry->rhp = rhp;
Paul E. McKenney29c00b42011-06-17 15:53:19 -0700108 __entry->offset = offset;
109 ),
110
111 TP_printk("rhp=%p func=%ld", __entry->rhp, __entry->offset)
112);
113
114/*
Paul E. McKenney300df912011-06-18 22:26:31 -0700115 * Tracepoint for exiting rcu_do_batch after RCU callbacks have been
Paul E. McKenney72fe7012011-06-21 01:14:54 -0700116 * invoked. The first argument is the name of the RCU flavor and
117 * the second argument is number of callbacks actually invoked.
Paul E. McKenney29c00b42011-06-17 15:53:19 -0700118 */
119TRACE_EVENT(rcu_batch_end,
120
Paul E. McKenney72fe7012011-06-21 01:14:54 -0700121 TP_PROTO(char *rcuname, int callbacks_invoked),
Paul E. McKenney29c00b42011-06-17 15:53:19 -0700122
Paul E. McKenney72fe7012011-06-21 01:14:54 -0700123 TP_ARGS(rcuname, callbacks_invoked),
Paul E. McKenney29c00b42011-06-17 15:53:19 -0700124
125 TP_STRUCT__entry(
Paul E. McKenney72fe7012011-06-21 01:14:54 -0700126 __field(char *, rcuname)
Paul E. McKenney300df912011-06-18 22:26:31 -0700127 __field(int, callbacks_invoked)
Paul E. McKenney29c00b42011-06-17 15:53:19 -0700128 ),
129
130 TP_fast_assign(
Paul E. McKenney72fe7012011-06-21 01:14:54 -0700131 __entry->rcuname = rcuname;
Paul E. McKenney300df912011-06-18 22:26:31 -0700132 __entry->callbacks_invoked = callbacks_invoked;
Paul E. McKenney29c00b42011-06-17 15:53:19 -0700133 ),
134
Paul E. McKenney72fe7012011-06-21 01:14:54 -0700135 TP_printk("%s CBs-invoked=%d",
136 __entry->rcuname, __entry->callbacks_invoked)
Paul E. McKenney29c00b42011-06-17 15:53:19 -0700137);
138
139#endif /* _TRACE_RCU_H */
140
141/* This part must be outside protection */
142#include <trace/define_trace.h>