94376f628979fbe967c1d205798f7191a7312275
[lttng-modules.git] / include / instrumentation / events / irq.h
1 // SPDX-FileCopyrightText: 2011 Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
2 //
3 // SPDX-License-Identifier: GPL-2.0-only
4
5 #undef TRACE_SYSTEM
6 #define TRACE_SYSTEM irq
7
8 #if !defined(LTTNG_TRACE_IRQ_H) || defined(TRACE_HEADER_MULTI_READ)
9 #define LTTNG_TRACE_IRQ_H
10
11 #include <lttng/tracepoint-event.h>
12
13 #ifndef _TRACE_IRQ_DEF_
14 #define _TRACE_IRQ_DEF_
15
16 struct irqaction;
17 struct softirq_action;
18
19 #endif /* _TRACE_IRQ_DEF_ */
20
21 /**
22 * irq_handler_entry - called immediately before the irq action handler
23 * @irq: irq number
24 * @action: pointer to struct irqaction
25 *
26 * The struct irqaction pointed to by @action contains various
27 * information about the handler, including the device name,
28 * @action->name, and the device id, @action->dev_id. When used in
29 * conjunction with the irq_handler_exit tracepoint, we can figure
30 * out irq handler latencies.
31 */
32 LTTNG_TRACEPOINT_EVENT(irq_handler_entry,
33
34 TP_PROTO(int irq, struct irqaction *action),
35
36 TP_ARGS(irq, action),
37
38 TP_FIELDS(
39 ctf_integer(int, irq, irq)
40 ctf_string(name, action->name)
41 )
42 )
43
44 /**
45 * irq_handler_exit - called immediately after the irq action handler returns
46 * @irq: irq number
47 * @action: pointer to struct irqaction
48 * @ret: return value
49 *
50 * If the @ret value is set to IRQ_HANDLED, then we know that the corresponding
51 * @action->handler scuccessully handled this irq. Otherwise, the irq might be
52 * a shared irq line, or the irq was not handled successfully. Can be used in
53 * conjunction with the irq_handler_entry to understand irq handler latencies.
54 */
55 LTTNG_TRACEPOINT_EVENT(irq_handler_exit,
56
57 TP_PROTO(int irq, struct irqaction *action, int ret),
58
59 TP_ARGS(irq, action, ret),
60
61 TP_FIELDS(
62 ctf_integer(int, irq, irq)
63 ctf_integer(int, ret, ret)
64 )
65 )
66
67 LTTNG_TRACEPOINT_EVENT_CLASS(irq_softirq,
68
69 TP_PROTO(unsigned int vec_nr),
70
71 TP_ARGS(vec_nr),
72
73 TP_FIELDS(
74 ctf_integer(unsigned int, vec, vec_nr)
75 )
76 )
77
78 /**
79 * softirq_entry - called immediately before the softirq handler
80 * @vec_nr: softirq vector number
81 *
82 * When used in combination with the softirq_exit tracepoint
83 * we can determine the softirq handler runtine.
84 */
85 LTTNG_TRACEPOINT_EVENT_INSTANCE_MAP(irq_softirq, softirq_entry,
86
87 irq_softirq_entry,
88
89 TP_PROTO(unsigned int vec_nr),
90
91 TP_ARGS(vec_nr)
92 )
93
94 /**
95 * softirq_exit - called immediately after the softirq handler returns
96 * @vec_nr: softirq vector number
97 *
98 * When used in combination with the softirq_entry tracepoint
99 * we can determine the softirq handler runtine.
100 */
101 LTTNG_TRACEPOINT_EVENT_INSTANCE_MAP(irq_softirq, softirq_exit,
102
103 irq_softirq_exit,
104
105 TP_PROTO(unsigned int vec_nr),
106
107 TP_ARGS(vec_nr)
108 )
109
110 /**
111 * softirq_raise - called immediately when a softirq is raised
112 * @vec_nr: softirq vector number
113 *
114 * When used in combination with the softirq_entry tracepoint
115 * we can determine the softirq raise to run latency.
116 */
117 LTTNG_TRACEPOINT_EVENT_INSTANCE_MAP(irq_softirq, softirq_raise,
118
119 irq_softirq_raise,
120
121 TP_PROTO(unsigned int vec_nr),
122
123 TP_ARGS(vec_nr)
124 )
125
126 #endif /* LTTNG_TRACE_IRQ_H */
127
128 /* This part must be outside protection */
129 #include <lttng/define_trace.h>
This page took 0.033374 seconds and 5 git commands to generate.