2 #define TRACE_SYSTEM irq
4 #if !defined(_TRACE_IRQ_H) || defined(TRACE_HEADER_MULTI_READ)
7 #include <linux/tracepoint.h>
10 struct softirq_action
;
12 #define SOFTIRQ_NAME_LIST \
15 softirq_name(NET_TX) \
16 softirq_name(NET_RX) \
18 softirq_name(IRQ_POLL) \
19 softirq_name(TASKLET) \
21 softirq_name(HRTIMER) \
25 #undef softirq_name_end
27 #define softirq_name(sirq) TRACE_DEFINE_ENUM(sirq##_SOFTIRQ);
28 #define softirq_name_end(sirq) TRACE_DEFINE_ENUM(sirq##_SOFTIRQ);
33 #undef softirq_name_end
35 #define softirq_name(sirq) { sirq##_SOFTIRQ, #sirq },
36 #define softirq_name_end(sirq) { sirq##_SOFTIRQ, #sirq }
38 #define show_softirq_name(val) \
39 __print_symbolic(val, SOFTIRQ_NAME_LIST)
42 * irq_handler_entry - called immediately before the irq action handler
44 * @action: pointer to struct irqaction
46 * The struct irqaction pointed to by @action contains various
47 * information about the handler, including the device name,
48 * @action->name, and the device id, @action->dev_id. When used in
49 * conjunction with the irq_handler_exit tracepoint, we can figure
50 * out irq handler latencies.
52 TRACE_EVENT(irq_handler_entry
,
54 TP_PROTO(int irq
, struct irqaction
*action
),
60 __string( name
, action
->name
)
65 __assign_str(name
, action
->name
);
68 TP_printk("irq=%d name=%s", __entry
->irq
, __get_str(name
))
72 * irq_handler_exit - called immediately after the irq action handler returns
74 * @action: pointer to struct irqaction
77 * If the @ret value is set to IRQ_HANDLED, then we know that the corresponding
78 * @action->handler scuccessully handled this irq. Otherwise, the irq might be
79 * a shared irq line, or the irq was not handled successfully. Can be used in
80 * conjunction with the irq_handler_entry to understand irq handler latencies.
82 TRACE_EVENT(irq_handler_exit
,
84 TP_PROTO(int irq
, struct irqaction
*action
, int ret
),
86 TP_ARGS(irq
, action
, ret
),
98 TP_printk("irq=%d ret=%s",
99 __entry
->irq
, __entry
->ret
? "handled" : "unhandled")
102 DECLARE_EVENT_CLASS(softirq
,
104 TP_PROTO(unsigned int vec_nr
),
109 __field( unsigned int, vec
)
113 __entry
->vec
= vec_nr
;
116 TP_printk("vec=%u [action=%s]", __entry
->vec
,
117 show_softirq_name(__entry
->vec
))
121 * softirq_entry - called immediately before the softirq handler
122 * @vec_nr: softirq vector number
124 * When used in combination with the softirq_exit tracepoint
125 * we can determine the softirq handler routine.
127 DEFINE_EVENT(softirq
, softirq_entry
,
129 TP_PROTO(unsigned int vec_nr
),
135 * softirq_exit - called immediately after the softirq handler returns
136 * @vec_nr: softirq vector number
138 * When used in combination with the softirq_entry tracepoint
139 * we can determine the softirq handler routine.
141 DEFINE_EVENT(softirq
, softirq_exit
,
143 TP_PROTO(unsigned int vec_nr
),
149 * softirq_raise - called immediately when a softirq is raised
150 * @vec_nr: softirq vector number
152 * When used in combination with the softirq_entry tracepoint
153 * we can determine the softirq raise to run latency.
155 DEFINE_EVENT(softirq
, softirq_raise
,
157 TP_PROTO(unsigned int vec_nr
),
162 #endif /* _TRACE_IRQ_H */
164 /* This part must be outside protection */
165 #include <trace/define_trace.h>