WIP FPC-III support
[linux/fpc-iii.git] / arch / x86 / include / asm / trace / irq_vectors.h
blob88e7f0f3bf6275cb611e631f41fc8a2e79729497
1 /* SPDX-License-Identifier: GPL-2.0 */
2 #undef TRACE_SYSTEM
3 #define TRACE_SYSTEM irq_vectors
5 #if !defined(_TRACE_IRQ_VECTORS_H) || defined(TRACE_HEADER_MULTI_READ)
6 #define _TRACE_IRQ_VECTORS_H
8 #include <linux/tracepoint.h>
9 #include <asm/trace/common.h>
11 #ifdef CONFIG_X86_LOCAL_APIC
13 DECLARE_EVENT_CLASS(x86_irq_vector,
15 TP_PROTO(int vector),
17 TP_ARGS(vector),
19 TP_STRUCT__entry(
20 __field( int, vector )
23 TP_fast_assign(
24 __entry->vector = vector;
27 TP_printk("vector=%d", __entry->vector) );
29 #define DEFINE_IRQ_VECTOR_EVENT(name) \
30 DEFINE_EVENT_FN(x86_irq_vector, name##_entry, \
31 TP_PROTO(int vector), \
32 TP_ARGS(vector), NULL, NULL); \
33 DEFINE_EVENT_FN(x86_irq_vector, name##_exit, \
34 TP_PROTO(int vector), \
35 TP_ARGS(vector), NULL, NULL);
38 * local_timer - called when entering/exiting a local timer interrupt
39 * vector handler
41 DEFINE_IRQ_VECTOR_EVENT(local_timer);
44 * spurious_apic - called when entering/exiting a spurious apic vector handler
46 DEFINE_IRQ_VECTOR_EVENT(spurious_apic);
49 * error_apic - called when entering/exiting an error apic vector handler
51 DEFINE_IRQ_VECTOR_EVENT(error_apic);
54 * x86_platform_ipi - called when entering/exiting a x86 platform ipi interrupt
55 * vector handler
57 DEFINE_IRQ_VECTOR_EVENT(x86_platform_ipi);
59 #ifdef CONFIG_IRQ_WORK
61 * irq_work - called when entering/exiting a irq work interrupt
62 * vector handler
64 DEFINE_IRQ_VECTOR_EVENT(irq_work);
67 * We must dis-allow sampling irq_work_exit() because perf event sampling
68 * itself can cause irq_work, which would lead to an infinite loop;
70 * 1) irq_work_exit happens
71 * 2) generates perf sample
72 * 3) generates irq_work
73 * 4) goto 1
75 TRACE_EVENT_PERF_PERM(irq_work_exit, is_sampling_event(p_event) ? -EPERM : 0);
76 #endif
79 * The ifdef is required because that tracepoint macro hell emits tracepoint
80 * code in files which include this header even if the tracepoint is not
81 * enabled. Brilliant stuff that.
83 #ifdef CONFIG_SMP
85 * reschedule - called when entering/exiting a reschedule vector handler
87 DEFINE_IRQ_VECTOR_EVENT(reschedule);
90 * call_function - called when entering/exiting a call function interrupt
91 * vector handler
93 DEFINE_IRQ_VECTOR_EVENT(call_function);
96 * call_function_single - called when entering/exiting a call function
97 * single interrupt vector handler
99 DEFINE_IRQ_VECTOR_EVENT(call_function_single);
100 #endif
102 #ifdef CONFIG_X86_MCE_THRESHOLD
104 * threshold_apic - called when entering/exiting a threshold apic interrupt
105 * vector handler
107 DEFINE_IRQ_VECTOR_EVENT(threshold_apic);
108 #endif
110 #ifdef CONFIG_X86_MCE_AMD
112 * deferred_error_apic - called when entering/exiting a deferred apic interrupt
113 * vector handler
115 DEFINE_IRQ_VECTOR_EVENT(deferred_error_apic);
116 #endif
118 #ifdef CONFIG_X86_THERMAL_VECTOR
120 * thermal_apic - called when entering/exiting a thermal apic interrupt
121 * vector handler
123 DEFINE_IRQ_VECTOR_EVENT(thermal_apic);
124 #endif
126 TRACE_EVENT(vector_config,
128 TP_PROTO(unsigned int irq, unsigned int vector,
129 unsigned int cpu, unsigned int apicdest),
131 TP_ARGS(irq, vector, cpu, apicdest),
133 TP_STRUCT__entry(
134 __field( unsigned int, irq )
135 __field( unsigned int, vector )
136 __field( unsigned int, cpu )
137 __field( unsigned int, apicdest )
140 TP_fast_assign(
141 __entry->irq = irq;
142 __entry->vector = vector;
143 __entry->cpu = cpu;
144 __entry->apicdest = apicdest;
147 TP_printk("irq=%u vector=%u cpu=%u apicdest=0x%08x",
148 __entry->irq, __entry->vector, __entry->cpu,
149 __entry->apicdest)
152 DECLARE_EVENT_CLASS(vector_mod,
154 TP_PROTO(unsigned int irq, unsigned int vector,
155 unsigned int cpu, unsigned int prev_vector,
156 unsigned int prev_cpu),
158 TP_ARGS(irq, vector, cpu, prev_vector, prev_cpu),
160 TP_STRUCT__entry(
161 __field( unsigned int, irq )
162 __field( unsigned int, vector )
163 __field( unsigned int, cpu )
164 __field( unsigned int, prev_vector )
165 __field( unsigned int, prev_cpu )
168 TP_fast_assign(
169 __entry->irq = irq;
170 __entry->vector = vector;
171 __entry->cpu = cpu;
172 __entry->prev_vector = prev_vector;
173 __entry->prev_cpu = prev_cpu;
177 TP_printk("irq=%u vector=%u cpu=%u prev_vector=%u prev_cpu=%u",
178 __entry->irq, __entry->vector, __entry->cpu,
179 __entry->prev_vector, __entry->prev_cpu)
182 #define DEFINE_IRQ_VECTOR_MOD_EVENT(name) \
183 DEFINE_EVENT_FN(vector_mod, name, \
184 TP_PROTO(unsigned int irq, unsigned int vector, \
185 unsigned int cpu, unsigned int prev_vector, \
186 unsigned int prev_cpu), \
187 TP_ARGS(irq, vector, cpu, prev_vector, prev_cpu), NULL, NULL); \
189 DEFINE_IRQ_VECTOR_MOD_EVENT(vector_update);
190 DEFINE_IRQ_VECTOR_MOD_EVENT(vector_clear);
192 DECLARE_EVENT_CLASS(vector_reserve,
194 TP_PROTO(unsigned int irq, int ret),
196 TP_ARGS(irq, ret),
198 TP_STRUCT__entry(
199 __field( unsigned int, irq )
200 __field( int, ret )
203 TP_fast_assign(
204 __entry->irq = irq;
205 __entry->ret = ret;
208 TP_printk("irq=%u ret=%d", __entry->irq, __entry->ret)
211 #define DEFINE_IRQ_VECTOR_RESERVE_EVENT(name) \
212 DEFINE_EVENT_FN(vector_reserve, name, \
213 TP_PROTO(unsigned int irq, int ret), \
214 TP_ARGS(irq, ret), NULL, NULL); \
216 DEFINE_IRQ_VECTOR_RESERVE_EVENT(vector_reserve_managed);
217 DEFINE_IRQ_VECTOR_RESERVE_EVENT(vector_reserve);
219 TRACE_EVENT(vector_alloc,
221 TP_PROTO(unsigned int irq, unsigned int vector, bool reserved,
222 int ret),
224 TP_ARGS(irq, vector, reserved, ret),
226 TP_STRUCT__entry(
227 __field( unsigned int, irq )
228 __field( unsigned int, vector )
229 __field( bool, reserved )
230 __field( int, ret )
233 TP_fast_assign(
234 __entry->irq = irq;
235 __entry->vector = ret < 0 ? 0 : vector;
236 __entry->reserved = reserved;
237 __entry->ret = ret > 0 ? 0 : ret;
240 TP_printk("irq=%u vector=%u reserved=%d ret=%d",
241 __entry->irq, __entry->vector,
242 __entry->reserved, __entry->ret)
245 TRACE_EVENT(vector_alloc_managed,
247 TP_PROTO(unsigned int irq, unsigned int vector,
248 int ret),
250 TP_ARGS(irq, vector, ret),
252 TP_STRUCT__entry(
253 __field( unsigned int, irq )
254 __field( unsigned int, vector )
255 __field( int, ret )
258 TP_fast_assign(
259 __entry->irq = irq;
260 __entry->vector = ret < 0 ? 0 : vector;
261 __entry->ret = ret > 0 ? 0 : ret;
264 TP_printk("irq=%u vector=%u ret=%d",
265 __entry->irq, __entry->vector, __entry->ret)
268 DECLARE_EVENT_CLASS(vector_activate,
270 TP_PROTO(unsigned int irq, bool is_managed, bool can_reserve,
271 bool reserve),
273 TP_ARGS(irq, is_managed, can_reserve, reserve),
275 TP_STRUCT__entry(
276 __field( unsigned int, irq )
277 __field( bool, is_managed )
278 __field( bool, can_reserve )
279 __field( bool, reserve )
282 TP_fast_assign(
283 __entry->irq = irq;
284 __entry->is_managed = is_managed;
285 __entry->can_reserve = can_reserve;
286 __entry->reserve = reserve;
289 TP_printk("irq=%u is_managed=%d can_reserve=%d reserve=%d",
290 __entry->irq, __entry->is_managed, __entry->can_reserve,
291 __entry->reserve)
294 #define DEFINE_IRQ_VECTOR_ACTIVATE_EVENT(name) \
295 DEFINE_EVENT_FN(vector_activate, name, \
296 TP_PROTO(unsigned int irq, bool is_managed, \
297 bool can_reserve, bool reserve), \
298 TP_ARGS(irq, is_managed, can_reserve, reserve), NULL, NULL); \
300 DEFINE_IRQ_VECTOR_ACTIVATE_EVENT(vector_activate);
301 DEFINE_IRQ_VECTOR_ACTIVATE_EVENT(vector_deactivate);
303 TRACE_EVENT(vector_teardown,
305 TP_PROTO(unsigned int irq, bool is_managed, bool has_reserved),
307 TP_ARGS(irq, is_managed, has_reserved),
309 TP_STRUCT__entry(
310 __field( unsigned int, irq )
311 __field( bool, is_managed )
312 __field( bool, has_reserved )
315 TP_fast_assign(
316 __entry->irq = irq;
317 __entry->is_managed = is_managed;
318 __entry->has_reserved = has_reserved;
321 TP_printk("irq=%u is_managed=%d has_reserved=%d",
322 __entry->irq, __entry->is_managed, __entry->has_reserved)
325 TRACE_EVENT(vector_setup,
327 TP_PROTO(unsigned int irq, bool is_legacy, int ret),
329 TP_ARGS(irq, is_legacy, ret),
331 TP_STRUCT__entry(
332 __field( unsigned int, irq )
333 __field( bool, is_legacy )
334 __field( int, ret )
337 TP_fast_assign(
338 __entry->irq = irq;
339 __entry->is_legacy = is_legacy;
340 __entry->ret = ret;
343 TP_printk("irq=%u is_legacy=%d ret=%d",
344 __entry->irq, __entry->is_legacy, __entry->ret)
347 TRACE_EVENT(vector_free_moved,
349 TP_PROTO(unsigned int irq, unsigned int cpu, unsigned int vector,
350 bool is_managed),
352 TP_ARGS(irq, cpu, vector, is_managed),
354 TP_STRUCT__entry(
355 __field( unsigned int, irq )
356 __field( unsigned int, cpu )
357 __field( unsigned int, vector )
358 __field( bool, is_managed )
361 TP_fast_assign(
362 __entry->irq = irq;
363 __entry->cpu = cpu;
364 __entry->vector = vector;
365 __entry->is_managed = is_managed;
368 TP_printk("irq=%u cpu=%u vector=%u is_managed=%d",
369 __entry->irq, __entry->cpu, __entry->vector,
370 __entry->is_managed)
374 #endif /* CONFIG_X86_LOCAL_APIC */
376 #undef TRACE_INCLUDE_PATH
377 #undef TRACE_INCLUDE_FILE
378 #define TRACE_INCLUDE_PATH .
379 #define TRACE_INCLUDE_FILE irq_vectors
380 #endif /* _TRACE_IRQ_VECTORS_H */
382 /* This part must be outside protection */
383 #include <trace/define_trace.h>