Commit | Line | Data |
---|---|---|
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 | ||
13 | struct irqaction; | |
14 | struct 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 | 29 | LTTNG_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 | 52 | LTTNG_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 | ||
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 | ) | |
122 | ||
3bc29f0a | 123 | #endif /* LTTNG_TRACE_IRQ_H */ |
f62b389e MD |
124 | |
125 | /* This part must be outside protection */ | |
6ec43db8 | 126 | #include <probes/define_trace.h> |