2 #define TRACE_SYSTEM irq
4 #if !defined(_TRACE_IRQ_H) || defined(TRACE_HEADER_MULTI_READ)
7 #include <linux/tracepoint.h>
8 #include <linux/interrupt.h>
10 #define softirq_name(sirq) { sirq##_SOFTIRQ, #sirq }
11 #define show_softirq_name(val) \
12 __print_symbolic(val, \
14 softirq_name(TIMER), \
15 softirq_name(NET_TX), \
16 softirq_name(NET_RX), \
17 softirq_name(BLOCK), \
18 softirq_name(BLOCK_IOPOLL), \
19 softirq_name(TASKLET), \
20 softirq_name(SCHED), \
21 softirq_name(HRTIMER), \
25 * irq_handler_entry - called immediately before the irq action handler
27 * @action: pointer to struct irqaction
29 * The struct irqaction pointed to by @action contains various
30 * information about the handler, including the device name,
31 * @action->name, and the device id, @action->dev_id. When used in
32 * conjunction with the irq_handler_exit tracepoint, we can figure
33 * out irq handler latencies.
35 TRACE_EVENT(irq_handler_entry
,
37 TP_PROTO(int irq
, struct irqaction
*action
),
43 __string( name
, action
->name
)
48 __assign_str(name
, action
->name
);
51 TP_printk("irq=%d name=%s", __entry
->irq
, __get_str(name
))
55 * irq_handler_exit - called immediately after the irq action handler returns
57 * @action: pointer to struct irqaction
60 * If the @ret value is set to IRQ_HANDLED, then we know that the corresponding
61 * @action->handler scuccessully handled this irq. Otherwise, the irq might be
62 * a shared irq line, or the irq was not handled successfully. Can be used in
63 * conjunction with the irq_handler_entry to understand irq handler latencies.
65 TRACE_EVENT(irq_handler_exit
,
67 TP_PROTO(int irq
, struct irqaction
*action
, int ret
),
69 TP_ARGS(irq
, action
, ret
),
81 TP_printk("irq=%d ret=%s",
82 __entry
->irq
, __entry
->ret
? "handled" : "unhandled")
85 DECLARE_EVENT_CLASS(softirq
,
87 TP_PROTO(struct softirq_action
*h
, struct softirq_action
*vec
),
96 __entry
->vec
= (int)(h
- vec
);
99 TP_printk("vec=%d [action=%s]", __entry
->vec
,
100 show_softirq_name(__entry
->vec
))
104 * softirq_entry - called immediately before the softirq handler
105 * @h: pointer to struct softirq_action
106 * @vec: pointer to first struct softirq_action in softirq_vec array
108 * The @h parameter, contains a pointer to the struct softirq_action
109 * which has a pointer to the action handler that is called. By subtracting
110 * the @vec pointer from the @h pointer, we can determine the softirq
111 * number. Also, when used in combination with the softirq_exit tracepoint
112 * we can determine the softirq latency.
114 DEFINE_EVENT(softirq
, softirq_entry
,
116 TP_PROTO(struct softirq_action
*h
, struct softirq_action
*vec
),
122 * softirq_exit - called immediately after the softirq handler returns
123 * @h: pointer to struct softirq_action
124 * @vec: pointer to first struct softirq_action in softirq_vec array
126 * The @h parameter contains a pointer to the struct softirq_action
127 * that has handled the softirq. By subtracting the @vec pointer from
128 * the @h pointer, we can determine the softirq number. Also, when used in
129 * combination with the softirq_entry tracepoint we can determine the softirq
132 DEFINE_EVENT(softirq
, softirq_exit
,
134 TP_PROTO(struct softirq_action
*h
, struct softirq_action
*vec
),
139 #endif /* _TRACE_IRQ_H */
141 /* This part must be outside protection */
142 #include <trace/define_trace.h>