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