rcu.h 2.7 KB
Newer Older
1 2 3 4 5 6 7 8 9
#undef TRACE_SYSTEM
#define TRACE_SYSTEM rcu

#if !defined(_TRACE_RCU_H) || defined(TRACE_HEADER_MULTI_READ)
#define _TRACE_RCU_H

#include <linux/tracepoint.h>

/*
10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38
 * Tracepoint for start/end markers used for utilization calculations.
 * By convention, the string is of the following forms:
 *
 * "Start <activity>" -- Mark the start of the specified activity,
 *			 such as "context switch".  Nesting is permitted.
 * "End <activity>" -- Mark the end of the specified activity.
 */
TRACE_EVENT(rcu_utilization,

	TP_PROTO(char *s),

	TP_ARGS(s),

	TP_STRUCT__entry(
		__field(char *,	s)
	),

	TP_fast_assign(
		__entry->s = s;
	),

	TP_printk("%s", __entry->s)
);

/*
 * Tracepoint for marking the beginning rcu_do_batch, performed to start
 * RCU callback invocation.  The first argument is the total number of
 * callbacks (including those that are not yet ready to be invoked),
 * and the second argument is the current RCU-callback batch limit.
39 40 41
 */
TRACE_EVENT(rcu_batch_start,

42
	TP_PROTO(long qlen, int blimit),
43

44
	TP_ARGS(qlen, blimit),
45 46

	TP_STRUCT__entry(
47 48
		__field(long, qlen)
		__field(int, blimit)
49 50 51
	),

	TP_fast_assign(
52 53
		__entry->qlen = qlen;
		__entry->blimit = blimit;
54 55
	),

56
	TP_printk("CBs=%ld bl=%d", __entry->qlen, __entry->blimit)
57 58 59
);

/*
60 61
 * Tracepoint for the invocation of a single RCU callback function.
 * The argument is a pointer to the RCU callback itself.
62 63 64 65 66 67 68 69
 */
TRACE_EVENT(rcu_invoke_callback,

	TP_PROTO(struct rcu_head *rhp),

	TP_ARGS(rhp),

	TP_STRUCT__entry(
70 71
		__field(void *,	rhp)
		__field(void *,	func)
72 73 74
	),

	TP_fast_assign(
75 76
		__entry->rhp = rhp;
		__entry->func = rhp->func;
77 78 79 80 81 82
	),

	TP_printk("rhp=%p func=%pf", __entry->rhp, __entry->func)
);

/*
83 84 85 86
 * Tracepoint for the invocation of a single RCU callback of the special
 * kfree() form.  The first argument is a pointer to the RCU callback
 * and the second argument is the offset of the callback within the
 * enclosing RCU-protected data structure.
87 88 89 90 91 92 93 94
 */
TRACE_EVENT(rcu_invoke_kfree_callback,

	TP_PROTO(struct rcu_head *rhp, unsigned long offset),

	TP_ARGS(rhp, offset),

	TP_STRUCT__entry(
95 96
		__field(void *,	rhp)
		__field(unsigned long, offset)
97 98 99
	),

	TP_fast_assign(
100
		__entry->rhp = rhp;
101 102 103 104 105 106 107
		__entry->offset	= offset;
	),

	TP_printk("rhp=%p func=%ld", __entry->rhp, __entry->offset)
);

/*
108 109
 * Tracepoint for exiting rcu_do_batch after RCU callbacks have been
 * invoked.  The first argument is the number of callbacks actually invoked.
110 111 112 113 114 115 116 117
 */
TRACE_EVENT(rcu_batch_end,

	TP_PROTO(int callbacks_invoked),

	TP_ARGS(callbacks_invoked),

	TP_STRUCT__entry(
118
		__field(int, callbacks_invoked)
119 120 121
	),

	TP_fast_assign(
122
		__entry->callbacks_invoked = callbacks_invoked;
123 124 125 126 127 128 129 130 131
	),

	TP_printk("CBs-invoked=%d", __entry->callbacks_invoked)
);

#endif /* _TRACE_RCU_H */

/* This part must be outside protection */
#include <trace/define_trace.h>