[PATCH] lttng-modules: Make it build when CONFIG_TRACEPOINTS is not enabled again

Peter Kjellerstedt
2021-08-25T09:41:27Z

Makefile-Do-not-fail-if-CONFIG_TRACEPOINTS-is-not-en.patch was updated
with the 2.13.0 update (commit 5dad15af), but unfortunately it no longer
did what it was intended to do.

Signed-off-by: Peter Kjellerstedt <peter.kjellerstedt@axis.com>
---
...fail-if-CONFIG_TRACEPOINTS-is-not-en.patch | 42 +++++++++++--------
1 file changed, 25 insertions(+), 17 deletions(-)

diff --git a/meta/recipes-kernel/lttng/lttng-modules/Makefile-Do-not-fail-if-CONFIG_TRACEPOINTS-is-not-en.patch b/meta/recipes-kernel/lttng/lttng-modules/Makefile-Do-not-fail-if-CONFIG_TRACEPOINTS-is-not-en.patch
index a852834344..4fb55270f5 100644
--- a/meta/recipes-kernel/lttng/lttng-modules/Makefile-Do-not-fail-if-CONFIG_TRACEPOINTS-is-not-en.patch
+++ b/meta/recipes-kernel/lttng/lttng-modules/Makefile-Do-not-fail-if-CONFIG_TRACEPOINTS-is-not-en.patch
@@ -1,8 +1,7 @@
-From 1b0e574d680101105a6c1e8931c78824f5a97a42 Mon Sep 17 00:00:00 2001
+From 885926e62f32a29b185dcfe738e61a2358a6b615 Mon Sep 17 00:00:00 2001
From: Otavio Salvador <otavio@ossystems.com.br>
Date: Mon, 5 Sep 2016 17:08:56 +0000
Subject: [PATCH] Makefile: Do not fail if CONFIG_TRACEPOINTS is not enabled
-Organization: O.S. Systems Software LTDA.

The lttng-modules are being pulled by the tools-profile image feature,
however, not every kernel has the CONFIG_TRACEPOINTS feature enabled.
@@ -16,22 +15,31 @@ Signed-off-by: Otavio Salvador <otavio@ossystems.com.br>
[bva: modified for lttng-modules 2.13+ context]
Signed-off-by: Bruce Ashfield <bruce.ashfield@gmail.com>
---
- Makefile | 9 +++++----
- 1 file changed, 5 insertions(+), 4 deletions(-)
+ src/Kbuild | 7 ++++++-
+ 1 file changed, 6 insertions(+), 1 deletion(-)

-Index: lttng-modules-2.13.0/Makefile
-===================================================================
---- lttng-modules-2.13.0.orig/Makefile
-+++ lttng-modules-2.13.0/Makefile
-@@ -7,6 +7,11 @@
+diff --git a/src/Kbuild b/src/Kbuild
+index 7137874..04eb5c9 100644
+--- a/src/Kbuild
++++ b/src/Kbuild
+@@ -2,10 +2,13 @@

- obj-$(CONFIG_LTTNG) += src/
+ ifdef CONFIG_LOCALVERSION # Check if dot-config is included.
+ ifeq ($(CONFIG_TRACEPOINTS),)
+- $(error The option CONFIG_TRACEPOINTS needs to be enabled in your kernel configuration)
++ $(warning The option CONFIG_TRACEPOINTS needs to be enabled in your kernel configuration)
++ DISABLE_MODULE = y
+ endif # CONFIG_TRACEPOINTS
+ endif # ifdef CONFIG_LOCALVERSION

-+ ifdef CONFIG_LOCALVERSION # Check if dot-config is included.
-+ ifneq ($(CONFIG_TRACEPOINTS),)
-+ $(warning The option CONFIG_TRACEPOINTS needs to be enabled in your kernel configuration)
-+ endif # CONFIG_TRACEPOINTS
-+ endif # ifdef CONFIG_LOCALVERSION
- else # KERNELRELEASE
++ifneq ($(DISABLE_MODULE),y)
++
+ TOP_LTTNG_MODULES_DIR := $(shell dirname $(lastword $(MAKEFILE_LIST)))/..

- # This part of the Makefile is used when the 'make' command is runned in the
+ lttng_check_linux_version = $(shell pwd)/include/linux/version.h
+@@ -150,3 +153,5 @@ lttng-statedump-objs := lttng-statedump-impl.o
+ obj-$(CONFIG_LTTNG) += probes/
+ obj-$(CONFIG_LTTNG) += lib/
+ obj-$(CONFIG_LTTNG) += tests/
++
++endif # DISABLE_MODULE