Commit | Line | Data |
---|---|---|
b2441318 | 1 | /* SPDX-License-Identifier: GPL-2.0 */ |
cf910e83 SA |
2 | #undef TRACE_SYSTEM |
3 | #define TRACE_SYSTEM irq_vectors | |
4 | ||
5 | #if !defined(_TRACE_IRQ_VECTORS_H) || defined(TRACE_HEADER_MULTI_READ) | |
6 | #define _TRACE_IRQ_VECTORS_H | |
7 | ||
8 | #include <linux/tracepoint.h> | |
2feb1b31 | 9 | #include <asm/trace/common.h> |
cf910e83 | 10 | |
73285527 TG |
11 | #ifdef CONFIG_X86_LOCAL_APIC |
12 | ||
80954747 TG |
13 | extern int trace_resched_ipi_reg(void); |
14 | extern void trace_resched_ipi_unreg(void); | |
15 | ||
cf910e83 SA |
16 | DECLARE_EVENT_CLASS(x86_irq_vector, |
17 | ||
18 | TP_PROTO(int vector), | |
19 | ||
20 | TP_ARGS(vector), | |
21 | ||
22 | TP_STRUCT__entry( | |
23 | __field( int, vector ) | |
24 | ), | |
25 | ||
26 | TP_fast_assign( | |
27 | __entry->vector = vector; | |
28 | ), | |
29 | ||
30 | TP_printk("vector=%d", __entry->vector) ); | |
31 | ||
32 | #define DEFINE_IRQ_VECTOR_EVENT(name) \ | |
80954747 TG |
33 | DEFINE_EVENT_FN(x86_irq_vector, name##_entry, \ |
34 | TP_PROTO(int vector), \ | |
35 | TP_ARGS(vector), NULL, NULL); \ | |
36 | DEFINE_EVENT_FN(x86_irq_vector, name##_exit, \ | |
37 | TP_PROTO(int vector), \ | |
38 | TP_ARGS(vector), NULL, NULL); | |
39 | ||
40 | #define DEFINE_RESCHED_IPI_EVENT(name) \ | |
cf910e83 SA |
41 | DEFINE_EVENT_FN(x86_irq_vector, name##_entry, \ |
42 | TP_PROTO(int vector), \ | |
43 | TP_ARGS(vector), \ | |
80954747 TG |
44 | trace_resched_ipi_reg, \ |
45 | trace_resched_ipi_unreg); \ | |
cf910e83 SA |
46 | DEFINE_EVENT_FN(x86_irq_vector, name##_exit, \ |
47 | TP_PROTO(int vector), \ | |
48 | TP_ARGS(vector), \ | |
80954747 TG |
49 | trace_resched_ipi_reg, \ |
50 | trace_resched_ipi_unreg); | |
cf910e83 SA |
51 | |
52 | /* | |
53 | * local_timer - called when entering/exiting a local timer interrupt | |
54 | * vector handler | |
55 | */ | |
56 | DEFINE_IRQ_VECTOR_EVENT(local_timer); | |
57 | ||
cf910e83 SA |
58 | /* |
59 | * spurious_apic - called when entering/exiting a spurious apic vector handler | |
60 | */ | |
61 | DEFINE_IRQ_VECTOR_EVENT(spurious_apic); | |
62 | ||
63 | /* | |
64 | * error_apic - called when entering/exiting an error apic vector handler | |
65 | */ | |
66 | DEFINE_IRQ_VECTOR_EVENT(error_apic); | |
67 | ||
68 | /* | |
69 | * x86_platform_ipi - called when entering/exiting a x86 platform ipi interrupt | |
70 | * vector handler | |
71 | */ | |
72 | DEFINE_IRQ_VECTOR_EVENT(x86_platform_ipi); | |
73 | ||
73285527 | 74 | #ifdef CONFIG_IRQ_WORK |
cf910e83 SA |
75 | /* |
76 | * irq_work - called when entering/exiting a irq work interrupt | |
77 | * vector handler | |
78 | */ | |
79 | DEFINE_IRQ_VECTOR_EVENT(irq_work); | |
80 | ||
d5b5f391 PZ |
81 | /* |
82 | * We must dis-allow sampling irq_work_exit() because perf event sampling | |
83 | * itself can cause irq_work, which would lead to an infinite loop; | |
84 | * | |
85 | * 1) irq_work_exit happens | |
86 | * 2) generates perf sample | |
87 | * 3) generates irq_work | |
88 | * 4) goto 1 | |
89 | */ | |
90 | TRACE_EVENT_PERF_PERM(irq_work_exit, is_sampling_event(p_event) ? -EPERM : 0); | |
73285527 TG |
91 | #endif |
92 | ||
93 | /* | |
94 | * The ifdef is required because that tracepoint macro hell emits tracepoint | |
95 | * code in files which include this header even if the tracepoint is not | |
96 | * enabled. Brilliant stuff that. | |
97 | */ | |
98 | #ifdef CONFIG_SMP | |
99 | /* | |
100 | * reschedule - called when entering/exiting a reschedule vector handler | |
101 | */ | |
102 | DEFINE_RESCHED_IPI_EVENT(reschedule); | |
d5b5f391 | 103 | |
cf910e83 SA |
104 | /* |
105 | * call_function - called when entering/exiting a call function interrupt | |
106 | * vector handler | |
107 | */ | |
108 | DEFINE_IRQ_VECTOR_EVENT(call_function); | |
109 | ||
110 | /* | |
111 | * call_function_single - called when entering/exiting a call function | |
112 | * single interrupt vector handler | |
113 | */ | |
114 | DEFINE_IRQ_VECTOR_EVENT(call_function_single); | |
73285527 | 115 | #endif |
cf910e83 | 116 | |
73285527 | 117 | #ifdef CONFIG_X86_MCE_THRESHOLD |
cf910e83 SA |
118 | /* |
119 | * threshold_apic - called when entering/exiting a threshold apic interrupt | |
120 | * vector handler | |
121 | */ | |
122 | DEFINE_IRQ_VECTOR_EVENT(threshold_apic); | |
73285527 | 123 | #endif |
cf910e83 | 124 | |
73285527 | 125 | #ifdef CONFIG_X86_MCE_AMD |
24fd78a8 AG |
126 | /* |
127 | * deferred_error_apic - called when entering/exiting a deferred apic interrupt | |
128 | * vector handler | |
129 | */ | |
130 | DEFINE_IRQ_VECTOR_EVENT(deferred_error_apic); | |
73285527 | 131 | #endif |
24fd78a8 | 132 | |
73285527 | 133 | #ifdef CONFIG_X86_THERMAL_VECTOR |
cf910e83 SA |
134 | /* |
135 | * thermal_apic - called when entering/exiting a thermal apic interrupt | |
136 | * vector handler | |
137 | */ | |
138 | DEFINE_IRQ_VECTOR_EVENT(thermal_apic); | |
73285527 TG |
139 | #endif |
140 | ||
141 | #endif /* CONFIG_X86_LOCAL_APIC */ | |
cf910e83 SA |
142 | |
143 | #undef TRACE_INCLUDE_PATH | |
144 | #define TRACE_INCLUDE_PATH . | |
145 | #define TRACE_INCLUDE_FILE irq_vectors | |
146 | #endif /* _TRACE_IRQ_VECTORS_H */ | |
147 | ||
148 | /* This part must be outside protection */ | |
149 | #include <trace/define_trace.h> |