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 | |
6ec43db8 | 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 | ||
f62b389e MD |
15 | #endif /* _TRACE_IRQ_DEF_ */ |
16 | ||
17 | /** | |
18 | * irq_handler_entry - called immediately before the irq action handler | |
19 | * @irq: irq number | |
20 | * @action: pointer to struct irqaction | |
21 | * | |
22 | * The struct irqaction pointed to by @action contains various | |
23 | * information about the handler, including the device name, | |
24 | * @action->name, and the device id, @action->dev_id. When used in | |
25 | * conjunction with the irq_handler_exit tracepoint, we can figure | |
26 | * out irq handler latencies. | |
27 | */ | |
3bc29f0a | 28 | LTTNG_TRACEPOINT_EVENT(irq_handler_entry, |
f62b389e MD |
29 | |
30 | TP_PROTO(int irq, struct irqaction *action), | |
31 | ||
32 | TP_ARGS(irq, action), | |
33 | ||
f127e61e MD |
34 | TP_FIELDS( |
35 | ctf_integer(int, irq, irq) | |
36 | ctf_string(name, action->name) | |
37 | ) | |
f62b389e MD |
38 | ) |
39 | ||
40 | /** | |
41 | * irq_handler_exit - called immediately after the irq action handler returns | |
42 | * @irq: irq number | |
43 | * @action: pointer to struct irqaction | |
44 | * @ret: return value | |
45 | * | |
46 | * If the @ret value is set to IRQ_HANDLED, then we know that the corresponding | |
47 | * @action->handler scuccessully handled this irq. Otherwise, the irq might be | |
48 | * a shared irq line, or the irq was not handled successfully. Can be used in | |
49 | * conjunction with the irq_handler_entry to understand irq handler latencies. | |
50 | */ | |
3bc29f0a | 51 | LTTNG_TRACEPOINT_EVENT(irq_handler_exit, |
f62b389e MD |
52 | |
53 | TP_PROTO(int irq, struct irqaction *action, int ret), | |
54 | ||
55 | TP_ARGS(irq, action, ret), | |
56 | ||
f127e61e MD |
57 | TP_FIELDS( |
58 | ctf_integer(int, irq, irq) | |
59 | ctf_integer(int, ret, ret) | |
60 | ) | |
f62b389e MD |
61 | ) |
62 | ||
3a523f5b | 63 | #if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,37)) |
9bbf98da | 64 | LTTNG_TRACEPOINT_EVENT_CLASS(irq_softirq, |
f62b389e MD |
65 | |
66 | TP_PROTO(unsigned int vec_nr), | |
67 | ||
68 | TP_ARGS(vec_nr), | |
69 | ||
f127e61e MD |
70 | TP_FIELDS( |
71 | ctf_integer(unsigned int, vec, vec_nr) | |
72 | ) | |
f62b389e MD |
73 | ) |
74 | ||
75 | /** | |
76 | * softirq_entry - called immediately before the softirq handler | |
77 | * @vec_nr: softirq vector number | |
78 | * | |
79 | * When used in combination with the softirq_exit tracepoint | |
80 | * we can determine the softirq handler runtine. | |
81 | */ | |
9bbf98da MD |
82 | LTTNG_TRACEPOINT_EVENT_INSTANCE_MAP(irq_softirq, softirq_entry, |
83 | ||
84 | irq_softirq_entry, | |
f62b389e MD |
85 | |
86 | TP_PROTO(unsigned int vec_nr), | |
87 | ||
88 | TP_ARGS(vec_nr) | |
89 | ) | |
90 | ||
91 | /** | |
92 | * softirq_exit - called immediately after the softirq handler returns | |
93 | * @vec_nr: softirq vector number | |
94 | * | |
95 | * When used in combination with the softirq_entry tracepoint | |
96 | * we can determine the softirq handler runtine. | |
97 | */ | |
9bbf98da MD |
98 | LTTNG_TRACEPOINT_EVENT_INSTANCE_MAP(irq_softirq, softirq_exit, |
99 | ||
100 | irq_softirq_exit, | |
f62b389e MD |
101 | |
102 | TP_PROTO(unsigned int vec_nr), | |
103 | ||
104 | TP_ARGS(vec_nr) | |
105 | ) | |
106 | ||
107 | /** | |
108 | * softirq_raise - called immediately when a softirq is raised | |
109 | * @vec_nr: softirq vector number | |
110 | * | |
111 | * When used in combination with the softirq_entry tracepoint | |
112 | * we can determine the softirq raise to run latency. | |
113 | */ | |
9bbf98da MD |
114 | LTTNG_TRACEPOINT_EVENT_INSTANCE_MAP(irq_softirq, softirq_raise, |
115 | ||
116 | irq_softirq_raise, | |
f62b389e MD |
117 | |
118 | TP_PROTO(unsigned int vec_nr), | |
119 | ||
120 | TP_ARGS(vec_nr) | |
121 | ) | |
3a523f5b | 122 | #else /* #if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,37)) */ |
9bbf98da | 123 | LTTNG_TRACEPOINT_EVENT_CLASS(irq_softirq, |
3a523f5b MD |
124 | |
125 | TP_PROTO(struct softirq_action *h, struct softirq_action *vec), | |
126 | ||
127 | TP_ARGS(h, vec), | |
128 | ||
f127e61e MD |
129 | TP_FIELDS( |
130 | ctf_integer(unsigned int, vec, (int)(h - vec)) | |
131 | ) | |
3a523f5b MD |
132 | ) |
133 | ||
134 | /** | |
135 | * softirq_entry - called immediately before the softirq handler | |
136 | * @h: pointer to struct softirq_action | |
137 | * @vec: pointer to first struct softirq_action in softirq_vec array | |
138 | * | |
139 | * When used in combination with the softirq_exit tracepoint | |
140 | * we can determine the softirq handler runtine. | |
141 | */ | |
9bbf98da MD |
142 | LTTNG_TRACEPOINT_EVENT_INSTANCE_MAP(irq_softirq, softirq_entry, |
143 | ||
144 | irq_softirq_entry, | |
3a523f5b MD |
145 | |
146 | TP_PROTO(struct softirq_action *h, struct softirq_action *vec), | |
147 | ||
148 | TP_ARGS(h, vec) | |
149 | ) | |
150 | ||
151 | /** | |
152 | * softirq_exit - called immediately after the softirq handler returns | |
153 | * @h: pointer to struct softirq_action | |
154 | * @vec: pointer to first struct softirq_action in softirq_vec array | |
155 | * | |
156 | * When used in combination with the softirq_entry tracepoint | |
157 | * we can determine the softirq handler runtine. | |
158 | */ | |
9bbf98da MD |
159 | LTTNG_TRACEPOINT_EVENT_INSTANCE_MAP(irq_softirq, softirq_exit, |
160 | ||
161 | irq_softirq_exit, | |
3a523f5b MD |
162 | |
163 | TP_PROTO(struct softirq_action *h, struct softirq_action *vec), | |
164 | ||
165 | TP_ARGS(h, vec) | |
166 | ) | |
167 | ||
168 | /** | |
169 | * softirq_raise - called immediately when a softirq is raised | |
170 | * @h: pointer to struct softirq_action | |
171 | * @vec: pointer to first struct softirq_action in softirq_vec array | |
172 | * | |
173 | * When used in combination with the softirq_entry tracepoint | |
174 | * we can determine the softirq raise to run latency. | |
175 | */ | |
9bbf98da MD |
176 | LTTNG_TRACEPOINT_EVENT_INSTANCE_MAP(irq_softirq, softirq_raise, |
177 | ||
178 | irq_softirq_raise, | |
3a523f5b MD |
179 | |
180 | TP_PROTO(struct softirq_action *h, struct softirq_action *vec), | |
181 | ||
182 | TP_ARGS(h, vec) | |
183 | ) | |
184 | #endif /* #if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,37)) */ | |
f62b389e | 185 | |
3bc29f0a | 186 | #endif /* LTTNG_TRACE_IRQ_H */ |
f62b389e MD |
187 | |
188 | /* This part must be outside protection */ | |
6ec43db8 | 189 | #include <probes/define_trace.h> |