1 #undef TRACE_SYSTEM
2 #define TRACE_SYSTEM irq_vectors
3 
4 #if !defined(_TRACE_IRQ_VECTORS_H) || defined(TRACE_HEADER_MULTI_READ)
5 #define _TRACE_IRQ_VECTORS_H
6 
7 #include <linux/tracepoint.h>
8 
9 extern void trace_irq_vector_regfunc(void);
10 extern void trace_irq_vector_unregfunc(void);
11 
12 DECLARE_EVENT_CLASS(x86_irq_vector,
13 
14 	TP_PROTO(int vector),
15 
16 	TP_ARGS(vector),
17 
18 	TP_STRUCT__entry(
19 		__field(		int,	vector	)
20 	),
21 
22 	TP_fast_assign(
23 		__entry->vector = vector;
24 	),
25 
26 	TP_printk("vector=%d", __entry->vector) );
27 
28 #define DEFINE_IRQ_VECTOR_EVENT(name)		\
29 DEFINE_EVENT_FN(x86_irq_vector, name##_entry,	\
30 	TP_PROTO(int vector),			\
31 	TP_ARGS(vector),			\
32 	trace_irq_vector_regfunc,		\
33 	trace_irq_vector_unregfunc);		\
34 DEFINE_EVENT_FN(x86_irq_vector, name##_exit,	\
35 	TP_PROTO(int vector),			\
36 	TP_ARGS(vector),			\
37 	trace_irq_vector_regfunc,		\
38 	trace_irq_vector_unregfunc);
39 
40 
41 /*
42  * local_timer - called when entering/exiting a local timer interrupt
43  * vector handler
44  */
45 DEFINE_IRQ_VECTOR_EVENT(local_timer);
46 
47 /*
48  * reschedule - called when entering/exiting a reschedule vector handler
49  */
50 DEFINE_IRQ_VECTOR_EVENT(reschedule);
51 
52 /*
53  * spurious_apic - called when entering/exiting a spurious apic vector handler
54  */
55 DEFINE_IRQ_VECTOR_EVENT(spurious_apic);
56 
57 /*
58  * error_apic - called when entering/exiting an error apic vector handler
59  */
60 DEFINE_IRQ_VECTOR_EVENT(error_apic);
61 
62 /*
63  * x86_platform_ipi - called when entering/exiting a x86 platform ipi interrupt
64  * vector handler
65  */
66 DEFINE_IRQ_VECTOR_EVENT(x86_platform_ipi);
67 
68 /*
69  * irq_work - called when entering/exiting a irq work interrupt
70  * vector handler
71  */
72 DEFINE_IRQ_VECTOR_EVENT(irq_work);
73 
74 /*
75  * We must dis-allow sampling irq_work_exit() because perf event sampling
76  * itself can cause irq_work, which would lead to an infinite loop;
77  *
78  *  1) irq_work_exit happens
79  *  2) generates perf sample
80  *  3) generates irq_work
81  *  4) goto 1
82  */
83 TRACE_EVENT_PERF_PERM(irq_work_exit, is_sampling_event(p_event) ? -EPERM : 0);
84 
85 /*
86  * call_function - called when entering/exiting a call function interrupt
87  * vector handler
88  */
89 DEFINE_IRQ_VECTOR_EVENT(call_function);
90 
91 /*
92  * call_function_single - called when entering/exiting a call function
93  * single interrupt vector handler
94  */
95 DEFINE_IRQ_VECTOR_EVENT(call_function_single);
96 
97 /*
98  * threshold_apic - called when entering/exiting a threshold apic interrupt
99  * vector handler
100  */
101 DEFINE_IRQ_VECTOR_EVENT(threshold_apic);
102 
103 /*
104  * thermal_apic - called when entering/exiting a thermal apic interrupt
105  * vector handler
106  */
107 DEFINE_IRQ_VECTOR_EVENT(thermal_apic);
108 
109 #undef TRACE_INCLUDE_PATH
110 #define TRACE_INCLUDE_PATH .
111 #define TRACE_INCLUDE_FILE irq_vectors
112 #endif /*  _TRACE_IRQ_VECTORS_H */
113 
114 /* This part must be outside protection */
115 #include <trace/define_trace.h>
116