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