xref: /linux/include/trace/events/csd.h (revision ea77850e98410987525eb392c229949c87779835)
1 /* SPDX-License-Identifier: GPL-2.0 */
2 #undef TRACE_SYSTEM
3 #define TRACE_SYSTEM csd
4 
5 #if !defined(_TRACE_CSD_H) || defined(TRACE_HEADER_MULTI_READ)
6 #define _TRACE_CSD_H
7 
8 #include <linux/tracepoint.h>
9 
10 TRACE_EVENT(csd_queue_cpu,
11 
12 	TP_PROTO(const unsigned int cpu,
13 		unsigned long callsite,
14 		smp_call_func_t func,
15 		struct __call_single_data *csd),
16 
17 	TP_ARGS(cpu, callsite, func, csd),
18 
19 	TP_STRUCT__entry(
20 		__field(unsigned int, cpu)
21 		__field(void *, callsite)
22 		__field(void *, func)
23 		__field(void *, csd)
24 		),
25 
26 	    TP_fast_assign(
27 		__entry->cpu = cpu;
28 		__entry->callsite = (void *)callsite;
29 		__entry->func = func;
30 		__entry->csd  = csd;
31 		),
32 
33 	TP_printk("cpu=%u callsite=%pS func=%ps csd=%p",
34 		__entry->cpu, __entry->callsite, __entry->func, __entry->csd)
35 	);
36 
37 /*
38  * Tracepoints for a function which is called as an effect of smp_call_function.*
39  */
40 DECLARE_EVENT_CLASS(csd_function,
41 
42 	TP_PROTO(smp_call_func_t func, struct __call_single_data *csd),
43 
44 	TP_ARGS(func, csd),
45 
46 	TP_STRUCT__entry(
47 		__field(void *,	func)
48 		__field(void *,	csd)
49 	),
50 
51 	TP_fast_assign(
52 		__entry->func	= func;
53 		__entry->csd	= csd;
54 	),
55 
56 	TP_printk("func=%ps, csd=%p", __entry->func, __entry->csd)
57 );
58 
59 DEFINE_EVENT(csd_function, csd_function_entry,
60 	TP_PROTO(smp_call_func_t func, struct __call_single_data *csd),
61 	TP_ARGS(func, csd)
62 );
63 
64 DEFINE_EVENT(csd_function, csd_function_exit,
65 	TP_PROTO(smp_call_func_t func, struct __call_single_data *csd),
66 	TP_ARGS(func, csd)
67 );
68 
69 #endif /* _TRACE_CSD_H */
70 
71 /* This part must be outside protection */
72 #include <trace/define_trace.h>
73