Commit | Line | Data |
---|---|---|
d0b6e04a LZ |
1 | #undef TRACE_SYSTEM |
2 | #define TRACE_SYSTEM irq | |
3 | ||
ea20d929 | 4 | #if !defined(_TRACE_IRQ_H) || defined(TRACE_HEADER_MULTI_READ) |
af39241b JB |
5 | #define _TRACE_IRQ_H |
6 | ||
af39241b | 7 | #include <linux/tracepoint.h> |
2bf2160d LJ |
8 | |
9 | struct irqaction; | |
10 | struct softirq_action; | |
ea20d929 | 11 | |
1d080d6c | 12 | #define softirq_name(sirq) { sirq##_SOFTIRQ, #sirq } |
5dd4de58 LZ |
13 | #define show_softirq_name(val) \ |
14 | __print_symbolic(val, \ | |
15 | softirq_name(HI), \ | |
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), \ | |
09223371 SL |
23 | softirq_name(HRTIMER), \ |
24 | softirq_name(RCU)) | |
c2adae09 | 25 | |
9ee1983c JB |
26 | /** |
27 | * irq_handler_entry - called immediately before the irq action handler | |
28 | * @irq: irq number | |
29 | * @action: pointer to struct irqaction | |
30 | * | |
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. | |
ea20d929 | 36 | */ |
160031b5 SR |
37 | TRACE_EVENT(irq_handler_entry, |
38 | ||
ea20d929 | 39 | TP_PROTO(int irq, struct irqaction *action), |
160031b5 | 40 | |
ea20d929 | 41 | TP_ARGS(irq, action), |
160031b5 SR |
42 | |
43 | TP_STRUCT__entry( | |
44 | __field( int, irq ) | |
45 | __string( name, action->name ) | |
46 | ), | |
47 | ||
48 | TP_fast_assign( | |
49 | __entry->irq = irq; | |
50 | __assign_str(name, action->name); | |
51 | ), | |
52 | ||
434a83c3 | 53 | TP_printk("irq=%d name=%s", __entry->irq, __get_str(name)) |
160031b5 | 54 | ); |
ea20d929 | 55 | |
9ee1983c JB |
56 | /** |
57 | * irq_handler_exit - called immediately after the irq action handler returns | |
58 | * @irq: irq number | |
59 | * @action: pointer to struct irqaction | |
60 | * @ret: return value | |
61 | * | |
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. | |
ea20d929 SR |
66 | */ |
67 | TRACE_EVENT(irq_handler_exit, | |
68 | ||
69 | TP_PROTO(int irq, struct irqaction *action, int ret), | |
70 | ||
71 | TP_ARGS(irq, action, ret), | |
72 | ||
73 | TP_STRUCT__entry( | |
74 | __field( int, irq ) | |
75 | __field( int, ret ) | |
76 | ), | |
77 | ||
78 | TP_fast_assign( | |
79 | __entry->irq = irq; | |
80 | __entry->ret = ret; | |
81 | ), | |
82 | ||
434a83c3 | 83 | TP_printk("irq=%d ret=%s", |
ea20d929 SR |
84 | __entry->irq, __entry->ret ? "handled" : "unhandled") |
85 | ); | |
86 | ||
c467307c | 87 | DECLARE_EVENT_CLASS(softirq, |
160031b5 | 88 | |
f4bc6bb2 | 89 | TP_PROTO(unsigned int vec_nr), |
160031b5 | 90 | |
f4bc6bb2 | 91 | TP_ARGS(vec_nr), |
af39241b | 92 | |
160031b5 | 93 | TP_STRUCT__entry( |
f4bc6bb2 | 94 | __field( unsigned int, vec ) |
160031b5 SR |
95 | ), |
96 | ||
97 | TP_fast_assign( | |
f4bc6bb2 | 98 | __entry->vec = vec_nr; |
160031b5 SR |
99 | ), |
100 | ||
f4bc6bb2 | 101 | TP_printk("vec=%u [action=%s]", __entry->vec, |
c2adae09 | 102 | show_softirq_name(__entry->vec)) |
160031b5 SR |
103 | ); |
104 | ||
c467307c LZ |
105 | /** |
106 | * softirq_entry - called immediately before the softirq handler | |
f4bc6bb2 | 107 | * @vec_nr: softirq vector number |
c467307c | 108 | * |
f4bc6bb2 | 109 | * When used in combination with the softirq_exit tracepoint |
e793c0f7 | 110 | * we can determine the softirq handler routine. |
c467307c LZ |
111 | */ |
112 | DEFINE_EVENT(softirq, softirq_entry, | |
113 | ||
f4bc6bb2 | 114 | TP_PROTO(unsigned int vec_nr), |
c467307c | 115 | |
f4bc6bb2 | 116 | TP_ARGS(vec_nr) |
c467307c LZ |
117 | ); |
118 | ||
9ee1983c JB |
119 | /** |
120 | * softirq_exit - called immediately after the softirq handler returns | |
f4bc6bb2 | 121 | * @vec_nr: softirq vector number |
9ee1983c | 122 | * |
f4bc6bb2 | 123 | * When used in combination with the softirq_entry tracepoint |
e793c0f7 | 124 | * we can determine the softirq handler routine. |
9ee1983c | 125 | */ |
c467307c | 126 | DEFINE_EVENT(softirq, softirq_exit, |
160031b5 | 127 | |
f4bc6bb2 | 128 | TP_PROTO(unsigned int vec_nr), |
160031b5 | 129 | |
f4bc6bb2 | 130 | TP_ARGS(vec_nr) |
160031b5 | 131 | ); |
af39241b | 132 | |
2bf2160d LJ |
133 | /** |
134 | * softirq_raise - called immediately when a softirq is raised | |
f4bc6bb2 | 135 | * @vec_nr: softirq vector number |
2bf2160d | 136 | * |
f4bc6bb2 TG |
137 | * When used in combination with the softirq_entry tracepoint |
138 | * we can determine the softirq raise to run latency. | |
2bf2160d LJ |
139 | */ |
140 | DEFINE_EVENT(softirq, softirq_raise, | |
141 | ||
f4bc6bb2 | 142 | TP_PROTO(unsigned int vec_nr), |
2bf2160d | 143 | |
f4bc6bb2 | 144 | TP_ARGS(vec_nr) |
2bf2160d LJ |
145 | ); |
146 | ||
a8d154b0 SR |
147 | #endif /* _TRACE_IRQ_H */ |
148 | ||
149 | /* This part must be outside protection */ | |
150 | #include <trace/define_trace.h> |