aboutsummaryrefslogtreecommitdiff
path: root/include/trace/events/smp.h
blob: da0baf27a39a39d905f277cc8f9773c6b2c4974a (plain)
1
2
3
4
5
6
7
8
9
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
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
#undef TRACE_SYSTEM
#define TRACE_SYSTEM smp

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

#include <linux/tracepoint.h>

DECLARE_EVENT_CLASS(smp_call_class,

	TP_PROTO(void * fnc),

	TP_ARGS(fnc),

	TP_STRUCT__entry(
		__field( void *, func )
	),

	TP_fast_assign(
		__entry->func = fnc;
	),

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

/**
 * smp_call_func_entry - called in the generic smp-cross-call-handler
 * 						 immediately before calling the destination
 * 						 function
 * @func:  function pointer
 *
 * When used in combination with the smp_call_func_exit tracepoint
 * we can determine the cross-call runtime.
 */
DEFINE_EVENT(smp_call_class, smp_call_func_entry,

	TP_PROTO(void * fnc),

	TP_ARGS(fnc)
);

/**
 * smp_call_func_exit - called in the generic smp-cross-call-handler
 * 						immediately after the destination function
 * 						returns
 * @func:  function pointer
 *
 * When used in combination with the smp_call_entry tracepoint
 * we can determine the cross-call runtime.
 */
DEFINE_EVENT(smp_call_class, smp_call_func_exit,

	TP_PROTO(void * fnc),

	TP_ARGS(fnc)
);

/**
 * smp_call_func_send - called as destination function is set
 * 						in the per-cpu storage
 * @func:  function pointer
 * @dest:  cpu to send to
 *
 * When used in combination with the smp_cross_call_entry tracepoint
 * we can determine the call-to-run latency.
 */
TRACE_EVENT(smp_call_func_send,

	TP_PROTO(void * func, int dest),

	TP_ARGS(func, dest),

	TP_STRUCT__entry(
		__field(	void * 	,	func )
		__field(	int		,	dest )
	),

	TP_fast_assign(
		__entry->func = func;
		__entry->dest = dest;
	),

	TP_printk("dest=%d func=%pf", __entry->dest,
			__entry->func)
);

#endif /*  _TRACE_SMP_H */

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