From 60d423945bd4f4c4b7bfc6f29da9231152d05690 Mon Sep 17 00:00:00 2001
From: Bruce Ashfield <bruce.ashfield@gmail.com>
Date: Sat, 15 May 2021 10:26:38 -0400
Subject: [PATCH] src/Kbuild: change missing CONFIG_TRACEPOINTS to warning

Taken from a previous patch to the main lttng-modules Makefile, by
Otavio Salvador:

  The lttng-modules are being pulled by the tools-profile image feature,
  however, not every kernel has the CONFIG_TRACEPOINTS feature enabled.

  This change makes the build do not fail when CONFIG_TRACEPOINTS is not
  available, allowing it to be kept being pulled by default.

Upstream-Status: Inappropriate [embedded specific]

Signed-off-by: Bruce Ashfield <bruce.ashfield@gmail.com>
---
 src/Kbuild | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

Index: lttng-modules-2.14.0/src/Kbuild
===================================================================
--- lttng-modules-2.14.0.orig/src/Kbuild
+++ lttng-modules-2.14.0/src/Kbuild
@@ -3,10 +3,13 @@
 
 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
 
+ifneq ($(DISABLE_MODULE),y)
+
 TOP_LTTNG_MODULES_DIR := $(shell dirname $(lastword $(MAKEFILE_LIST)))/..
 
 lttng_check_linux_version = $(shell pwd)/include/linux/version.h
@@ -168,3 +171,5 @@
 obj-$(CONFIG_LTTNG_SYSCALLS_EXTRACTOR) += lttng-syscalls-extractor.o
 
 # vim:syntax=make
+
+endif # DISABLE_MODULE
