Commit | Line | Data |
---|---|---|
9f36eaed | 1 | /* SPDX-License-Identifier: GPL-2.0 */ |
0bcebe87 MJ |
2 | #ifdef CONFIG_PREEMPTIRQ_EVENTS |
3 | ||
4 | #undef TRACE_SYSTEM | |
5 | #define TRACE_SYSTEM preemptirq | |
6 | ||
7 | #if !defined(LTTNG_TRACE_PREEMPTIRQ_H) || defined(TRACE_HEADER_MULTI_READ) | |
8 | #define LTTNG_TRACE_PREEMPTIRQ_H | |
9 | ||
10 | #include <linux/ktime.h> | |
11 | #include <linux/string.h> | |
12 | #include <asm/sections.h> | |
13 | #include <probes/lttng-tracepoint-event.h> | |
14 | ||
67325059 MJ |
15 | /* |
16 | * The preemptirq probe is built when CONFIG_PREEMPTIRQ_EVENTS is defined. | |
17 | */ | |
0bcebe87 MJ |
18 | |
19 | LTTNG_TRACEPOINT_EVENT_CLASS(preemptirq_template, | |
20 | ||
21 | TP_PROTO(unsigned long ip, unsigned long parent_ip), | |
22 | ||
23 | TP_ARGS(ip, parent_ip), | |
24 | ||
25 | TP_FIELDS( | |
26 | ctf_integer_hex(unsigned long, caller, ip) | |
27 | ctf_integer_hex(unsigned long, parent, parent_ip) | |
28 | ) | |
29 | ) | |
30 | ||
67325059 MJ |
31 | /* |
32 | * Tracing of irq enable / disable events is enabled | |
33 | * on >= 4.19 when CONFIG_TRACE_IRQFLAGS is defined. | |
34 | * on previous kernels when CONFIG_PROVE_LOCKING is NOT defined. | |
35 | */ | |
36 | #if defined(CONFIG_TRACE_IRQFLAGS) | |
37 | #define LTTNG_TRACE_IRQ | |
2d042821 | 38 | #elif (LTTNG_LINUX_VERSION_CODE < LTTNG_KERNEL_VERSION(4,19,0) && \ |
67325059 MJ |
39 | !defined(CONFIG_PROVE_LOCKING)) |
40 | #define LTTNG_TRACE_IRQ | |
41 | #endif | |
42 | ||
43 | #ifdef LTTNG_TRACE_IRQ | |
0bcebe87 MJ |
44 | LTTNG_TRACEPOINT_EVENT_INSTANCE_MAP(preemptirq_template, irq_disable, |
45 | ||
46 | preemptirq_irq_disable, | |
47 | ||
48 | TP_PROTO(unsigned long ip, unsigned long parent_ip), | |
49 | ||
50 | TP_ARGS(ip, parent_ip) | |
51 | ) | |
52 | ||
53 | LTTNG_TRACEPOINT_EVENT_INSTANCE_MAP(preemptirq_template, irq_enable, | |
54 | ||
55 | preemptirq_irq_enable, | |
56 | ||
57 | TP_PROTO(unsigned long ip, unsigned long parent_ip), | |
58 | ||
59 | TP_ARGS(ip, parent_ip) | |
60 | ) | |
67325059 MJ |
61 | #endif /* LTTNG_TRACE_IRQ */ |
62 | ||
63 | /* | |
64 | * Tracing of preempt enable / disable events is enabled | |
65 | * on >= 4.19 when CONFIG_TRACE_PREEMPT_TOGGLE is defined. | |
66 | * on previous kernels when CONFIG_DEBUG_PREEMPT is defined. | |
67 | */ | |
68 | #if defined(CONFIG_TRACE_PREEMPT_TOGGLE) | |
69 | #define LTTNG_TRACE_PREEMPT | |
2d042821 | 70 | #elif (LTTNG_LINUX_VERSION_CODE < LTTNG_KERNEL_VERSION(4,19,0) && \ |
67325059 MJ |
71 | defined(CONFIG_DEBUG_PREEMPT)) |
72 | #define LTTNG_TRACE_PREEMPT | |
73 | #endif | |
74 | ||
75 | #ifdef LTTNG_TRACE_PREEMPT | |
0bcebe87 MJ |
76 | LTTNG_TRACEPOINT_EVENT_INSTANCE_MAP(preemptirq_template, preempt_disable, |
77 | ||
78 | preemptirq_preempt_disable, | |
79 | ||
80 | TP_PROTO(unsigned long ip, unsigned long parent_ip), | |
81 | ||
82 | TP_ARGS(ip, parent_ip) | |
83 | ) | |
84 | ||
85 | LTTNG_TRACEPOINT_EVENT_INSTANCE_MAP(preemptirq_template, preempt_enable, | |
86 | ||
87 | preemptirq_preempt_enable, | |
88 | ||
89 | TP_PROTO(unsigned long ip, unsigned long parent_ip), | |
90 | ||
91 | TP_ARGS(ip, parent_ip) | |
92 | ) | |
67325059 | 93 | #endif /* LTTNG_TRACE_PREEMPT */ |
0bcebe87 MJ |
94 | |
95 | #endif /* LTTNG_TRACE_PREEMPTIRQ_H */ | |
96 | ||
97 | /* This part must be outside protection */ | |
98 | #include <probes/define_trace.h> | |
99 | ||
100 | #endif /* CONFIG_PREEMPTIRQ_EVENTS */ |