Commit | Line | Data |
---|---|---|
f62b389e MD |
1 | #undef TRACE_SYSTEM |
2 | #define TRACE_SYSTEM irq | |
3 | ||
3bc29f0a MD |
4 | #if !defined(LTTNG_TRACE_IRQ_H) || defined(TRACE_HEADER_MULTI_READ) |
5 | #define LTTNG_TRACE_IRQ_H | |
f62b389e | 6 | |
3bc29f0a | 7 | #include "../../../probes/lttng-tracepoint-event.h" |
f62b389e MD |
8 | |
9 | #ifndef _TRACE_IRQ_DEF_ | |
10 | #define _TRACE_IRQ_DEF_ | |
11 | ||
12 | struct irqaction; | |
13 | struct softirq_action; | |
14 | ||
15 | #define softirq_name(sirq) { sirq##_SOFTIRQ, #sirq } | |
16 | #define show_softirq_name(val) \ | |
17 | __print_symbolic(val, \ | |
18 | softirq_name(HI), \ | |
19 | softirq_name(TIMER), \ | |
20 | softirq_name(NET_TX), \ | |
21 | softirq_name(NET_RX), \ | |
22 | softirq_name(BLOCK), \ | |
23 | softirq_name(BLOCK_IOPOLL), \ | |
24 | softirq_name(TASKLET), \ | |
25 | softirq_name(SCHED), \ | |
26 | softirq_name(HRTIMER), \ | |
27 | softirq_name(RCU)) | |
28 | ||
29 | #endif /* _TRACE_IRQ_DEF_ */ | |
30 | ||
31 | /** | |
32 | * irq_handler_entry - called immediately before the irq action handler | |
33 | * @irq: irq number | |
34 | * @action: pointer to struct irqaction | |
35 | * | |
36 | * The struct irqaction pointed to by @action contains various | |
37 | * information about the handler, including the device name, | |
38 | * @action->name, and the device id, @action->dev_id. When used in | |
39 | * conjunction with the irq_handler_exit tracepoint, we can figure | |
40 | * out irq handler latencies. | |
41 | */ | |
3bc29f0a | 42 | LTTNG_TRACEPOINT_EVENT(irq_handler_entry, |
f62b389e MD |
43 | |
44 | TP_PROTO(int irq, struct irqaction *action), | |
45 | ||
46 | TP_ARGS(irq, action), | |
47 | ||
48 | TP_STRUCT__entry( | |
49 | __field( int, irq ) | |
50 | __string( name, action->name ) | |
51 | ), | |
52 | ||
53 | TP_fast_assign( | |
54 | tp_assign(irq, irq) | |
55 | tp_strcpy(name, action->name) | |
56 | ), | |
57 | ||
58 | TP_printk("irq=%d name=%s", __entry->irq, __get_str(name)) | |
59 | ) | |
60 | ||
61 | /** | |
62 | * irq_handler_exit - called immediately after the irq action handler returns | |
63 | * @irq: irq number | |
64 | * @action: pointer to struct irqaction | |
65 | * @ret: return value | |
66 | * | |
67 | * If the @ret value is set to IRQ_HANDLED, then we know that the corresponding | |
68 | * @action->handler scuccessully handled this irq. Otherwise, the irq might be | |
69 | * a shared irq line, or the irq was not handled successfully. Can be used in | |
70 | * conjunction with the irq_handler_entry to understand irq handler latencies. | |
71 | */ | |
3bc29f0a | 72 | LTTNG_TRACEPOINT_EVENT(irq_handler_exit, |
f62b389e MD |
73 | |
74 | TP_PROTO(int irq, struct irqaction *action, int ret), | |
75 | ||
76 | TP_ARGS(irq, action, ret), | |
77 | ||
78 | TP_STRUCT__entry( | |
79 | __field( int, irq ) | |
80 | __field( int, ret ) | |
81 | ), | |
82 | ||
83 | TP_fast_assign( | |
84 | tp_assign(irq, irq) | |
85 | tp_assign(ret, ret) | |
86 | ), | |
87 | ||
88 | TP_printk("irq=%d ret=%s", | |
89 | __entry->irq, __entry->ret ? "handled" : "unhandled") | |
90 | ) | |
91 | ||
3a523f5b | 92 | #if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,37)) |
3bc29f0a | 93 | LTTNG_TRACEPOINT_EVENT_CLASS(softirq, |
f62b389e MD |
94 | |
95 | TP_PROTO(unsigned int vec_nr), | |
96 | ||
97 | TP_ARGS(vec_nr), | |
98 | ||
99 | TP_STRUCT__entry( | |
100 | __field( unsigned int, vec ) | |
101 | ), | |
102 | ||
103 | TP_fast_assign( | |
104 | tp_assign(vec, vec_nr) | |
105 | ), | |
106 | ||
107 | TP_printk("vec=%u [action=%s]", __entry->vec, | |
108 | show_softirq_name(__entry->vec)) | |
109 | ) | |
110 | ||
111 | /** | |
112 | * softirq_entry - called immediately before the softirq handler | |
113 | * @vec_nr: softirq vector number | |
114 | * | |
115 | * When used in combination with the softirq_exit tracepoint | |
116 | * we can determine the softirq handler runtine. | |
117 | */ | |
3bc29f0a | 118 | LTTNG_TRACEPOINT_EVENT_INSTANCE(softirq, softirq_entry, |
f62b389e MD |
119 | |
120 | TP_PROTO(unsigned int vec_nr), | |
121 | ||
122 | TP_ARGS(vec_nr) | |
123 | ) | |
124 | ||
125 | /** | |
126 | * softirq_exit - called immediately after the softirq handler returns | |
127 | * @vec_nr: softirq vector number | |
128 | * | |
129 | * When used in combination with the softirq_entry tracepoint | |
130 | * we can determine the softirq handler runtine. | |
131 | */ | |
3bc29f0a | 132 | LTTNG_TRACEPOINT_EVENT_INSTANCE(softirq, softirq_exit, |
f62b389e MD |
133 | |
134 | TP_PROTO(unsigned int vec_nr), | |
135 | ||
136 | TP_ARGS(vec_nr) | |
137 | ) | |
138 | ||
139 | /** | |
140 | * softirq_raise - called immediately when a softirq is raised | |
141 | * @vec_nr: softirq vector number | |
142 | * | |
143 | * When used in combination with the softirq_entry tracepoint | |
144 | * we can determine the softirq raise to run latency. | |
145 | */ | |
3bc29f0a | 146 | LTTNG_TRACEPOINT_EVENT_INSTANCE(softirq, softirq_raise, |
f62b389e MD |
147 | |
148 | TP_PROTO(unsigned int vec_nr), | |
149 | ||
150 | TP_ARGS(vec_nr) | |
151 | ) | |
3a523f5b | 152 | #else /* #if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,37)) */ |
3bc29f0a | 153 | LTTNG_TRACEPOINT_EVENT_CLASS(softirq, |
3a523f5b MD |
154 | |
155 | TP_PROTO(struct softirq_action *h, struct softirq_action *vec), | |
156 | ||
157 | TP_ARGS(h, vec), | |
158 | ||
159 | TP_STRUCT__entry( | |
160 | __field( unsigned int, vec ) | |
161 | ), | |
162 | ||
163 | TP_fast_assign( | |
164 | tp_assign(vec, (int)(h - vec)) | |
165 | ), | |
166 | ||
167 | TP_printk("vec=%u [action=%s]", __entry->vec, | |
168 | show_softirq_name(__entry->vec)) | |
169 | ) | |
170 | ||
171 | /** | |
172 | * softirq_entry - called immediately before the softirq handler | |
173 | * @h: pointer to struct softirq_action | |
174 | * @vec: pointer to first struct softirq_action in softirq_vec array | |
175 | * | |
176 | * When used in combination with the softirq_exit tracepoint | |
177 | * we can determine the softirq handler runtine. | |
178 | */ | |
3bc29f0a | 179 | LTTNG_TRACEPOINT_EVENT_INSTANCE(softirq, softirq_entry, |
3a523f5b MD |
180 | |
181 | TP_PROTO(struct softirq_action *h, struct softirq_action *vec), | |
182 | ||
183 | TP_ARGS(h, vec) | |
184 | ) | |
185 | ||
186 | /** | |
187 | * softirq_exit - called immediately after the softirq handler returns | |
188 | * @h: pointer to struct softirq_action | |
189 | * @vec: pointer to first struct softirq_action in softirq_vec array | |
190 | * | |
191 | * When used in combination with the softirq_entry tracepoint | |
192 | * we can determine the softirq handler runtine. | |
193 | */ | |
3bc29f0a | 194 | LTTNG_TRACEPOINT_EVENT_INSTANCE(softirq, softirq_exit, |
3a523f5b MD |
195 | |
196 | TP_PROTO(struct softirq_action *h, struct softirq_action *vec), | |
197 | ||
198 | TP_ARGS(h, vec) | |
199 | ) | |
200 | ||
201 | /** | |
202 | * softirq_raise - called immediately when a softirq is raised | |
203 | * @h: pointer to struct softirq_action | |
204 | * @vec: pointer to first struct softirq_action in softirq_vec array | |
205 | * | |
206 | * When used in combination with the softirq_entry tracepoint | |
207 | * we can determine the softirq raise to run latency. | |
208 | */ | |
3bc29f0a | 209 | LTTNG_TRACEPOINT_EVENT_INSTANCE(softirq, softirq_raise, |
3a523f5b MD |
210 | |
211 | TP_PROTO(struct softirq_action *h, struct softirq_action *vec), | |
212 | ||
213 | TP_ARGS(h, vec) | |
214 | ) | |
215 | #endif /* #if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,37)) */ | |
f62b389e | 216 | |
3bc29f0a | 217 | #endif /* LTTNG_TRACE_IRQ_H */ |
f62b389e MD |
218 | |
219 | /* This part must be outside protection */ | |
5b88d86e | 220 | #include "../../../probes/define_trace.h" |