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(sirq) { sirq##_SOFTIRQ, #sirq }
13 #define show_softirq_name(val) \
14 __print_symbolic(val, \
16 softirq_name(TIMER), \
17 softirq_name(NET_TX), \
18 softirq_name(NET_RX), \
19 softirq_name(BLOCK), \
20 softirq_name(BLOCK_IOPOLL), \
21 softirq_name(TASKLET), \
22 softirq_name(SCHED), \
23 softirq_name(HRTIMER), \
27 * irq_handler_entry - called immediately before the irq action handler
29 * @action: pointer to struct irqaction
31 * The struct irqaction pointed to by @action contains various
32 * information about the handler, including the device name,
33 * @action->name, and the device id, @action->dev_id. When used in
34 * conjunction with the irq_handler_exit tracepoint, we can figure
35 * out irq handler latencies.
37 TRACE_EVENT(irq_handler_entry,
39 TP_PROTO(int irq, struct irqaction *action),
45 __string( name, action->name )
50 __assign_str(name, action->name);
53 TP_printk("irq=%d name=%s", __entry->irq, __get_str(name))
57 * irq_handler_exit - called immediately after the irq action handler returns
59 * @action: pointer to struct irqaction
62 * If the @ret value is set to IRQ_HANDLED, then we know that the corresponding
63 * @action->handler scuccessully handled this irq. Otherwise, the irq might be
64 * a shared irq line, or the irq was not handled successfully. Can be used in
65 * conjunction with the irq_handler_entry to understand irq handler latencies.
67 TRACE_EVENT(irq_handler_exit,
69 TP_PROTO(int irq, struct irqaction *action, int ret),
71 TP_ARGS(irq, action, ret),
83 TP_printk("irq=%d ret=%s",
84 __entry->irq, __entry->ret ? "handled" : "unhandled")
87 DECLARE_EVENT_CLASS(softirq,
89 TP_PROTO(struct softirq_action *h, struct softirq_action *vec),
99 __entry->vec = (int)(h - vec);
101 __entry->vec = (int)(long)h;
104 TP_printk("vec=%d [action=%s]", __entry->vec,
105 show_softirq_name(__entry->vec))
109 * softirq_entry - called immediately before the softirq handler
110 * @h: pointer to struct softirq_action
111 * @vec: pointer to first struct softirq_action in softirq_vec array
113 * The @h parameter, contains a pointer to the struct softirq_action
114 * which has a pointer to the action handler that is called. By subtracting
115 * the @vec pointer from the @h pointer, we can determine the softirq
116 * number. Also, when used in combination with the softirq_exit tracepoint
117 * we can determine the softirq latency.
119 DEFINE_EVENT(softirq, softirq_entry,
121 TP_PROTO(struct softirq_action *h, struct softirq_action *vec),
127 * softirq_exit - called immediately after the softirq handler returns
128 * @h: pointer to struct softirq_action
129 * @vec: pointer to first struct softirq_action in softirq_vec array
131 * The @h parameter contains a pointer to the struct softirq_action
132 * that has handled the softirq. By subtracting the @vec pointer from
133 * the @h pointer, we can determine the softirq number. Also, when used in
134 * combination with the softirq_entry tracepoint we can determine the softirq
137 DEFINE_EVENT(softirq, softirq_exit,
139 TP_PROTO(struct softirq_action *h, struct softirq_action *vec),
145 * softirq_raise - called immediately when a softirq is raised
146 * @h: pointer to struct softirq_action
147 * @vec: pointer to first struct softirq_action in softirq_vec array
149 * The @h parameter contains a pointer to the softirq vector number which is
150 * raised. @vec is NULL and it means @h includes vector number not
151 * softirq_action. When used in combination with the softirq_entry tracepoint
152 * we can determine the softirq raise latency.
154 DEFINE_EVENT(softirq, softirq_raise,
156 TP_PROTO(struct softirq_action *h, struct softirq_action *vec),
161 #endif /* _TRACE_IRQ_H */
163 /* This part must be outside protection */
164 #include <trace/define_trace.h>