diff mbox series

lttng: Add CONFIG_PREEMPTIRQ_TRACEPOINTS as a preemptirq condition

Message ID 20221020091321.27945-1-mikael.beckius@windriver.com
State New
Headers show
Series lttng: Add CONFIG_PREEMPTIRQ_TRACEPOINTS as a preemptirq condition | expand

Commit Message

Beckius, Mikael Oct. 20, 2022, 9:13 a.m. UTC
Signed-off-by: Mikael Beckius <mikael.beckius at windriver.com>
---
 include/instrumentation/events/preemptirq.h | 8 +++++---
 src/probes/Kbuild                           | 4 ++--
 2 files changed, 7 insertions(+), 5 deletions(-)
diff mbox series

Patch

diff --git a/include/instrumentation/events/preemptirq.h b/include/instrumentation/events/preemptirq.h
index 80bbbac6..2b991dee 100644
--- a/include/instrumentation/events/preemptirq.h
+++ b/include/instrumentation/events/preemptirq.h
@@ -1,5 +1,5 @@ 
 /* SPDX-License-Identifier: GPL-2.0-only */
-#ifdef CONFIG_PREEMPTIRQ_EVENTS
+#if defined(CONFIG_PREEMPTIRQ_TRACEPOINTS) || (CONFIG_PREEMPTIRQ_EVENTS)
 
 #undef TRACE_SYSTEM
 #define TRACE_SYSTEM preemptirq
@@ -13,7 +13,9 @@ 
 #include <lttng/tracepoint-event.h>
 
 /*
- * The preemptirq probe is built when CONFIG_PREEMPTIRQ_EVENTS is defined.
+ * The preemptirq probe is built when CONFIG_PREEMPTIRQ_TRACEPOINTS
+ * is defined or when CONFIG_PREEMPTIRQ_EVENTS is defined on kernels
+ * older than 4.19.
  */
 
 LTTNG_TRACEPOINT_EVENT_CLASS(preemptirq_template,
@@ -97,4 +99,4 @@  LTTNG_TRACEPOINT_EVENT_INSTANCE_MAP(preemptirq_template, preempt_enable,
 /* This part must be outside protection */
 #include <lttng/define_trace.h>
 
-#endif /* CONFIG_PREEMPTIRQ_EVENTS */
+#endif /* CONFIG_PREEMPTIRQ_TRACEPOINTS */
diff --git a/src/probes/Kbuild b/src/probes/Kbuild
index aa002534..03468d16 100644
--- a/src/probes/Kbuild
+++ b/src/probes/Kbuild
@@ -284,8 +284,8 @@  ifneq ($(CONFIG_KRETPROBES),)
   obj-$(CONFIG_LTTNG) += lttng-kretprobes.o
 endif # CONFIG_KRETPROBES
 
-ifneq ($(CONFIG_PREEMPTIRQ_EVENTS),)
+ifneq ($(or $(CONFIG_PREEMPTIRQ_TRACEPOINTS),$(CONFIG_PREEMPTIRQ_EVENTS)),)
   obj-$(CONFIG_LTTNG) += lttng-probe-preemptirq.o
-endif # CONFIG_PREEMPTIRQ_EVENTS
+endif # CONFIG_PREEMPTIRQ_TRACEPOINTS
 
 # vim:syntax=make