fix: tie compaction probe build to CONFIG_COMPACTION
[lttng-modules.git] / src / probes / Kbuild
index 31e0ee85757f9ea83f28e81d70ab004dd1909ae2..3e556b8e1d72c7225e768baac8ee06930e27f62b 100644 (file)
@@ -167,22 +167,24 @@ ifneq ($(CONFIG_BTRFS_FS),)
   endif # $(wildcard $(btrfs_dep))
 endif # CONFIG_BTRFS_FS
 
-# A dependency on internal header 'mm/internal.h' was introduced in v5.18
-compaction_dep = $(srctree)/mm/internal.h
-compaction_dep_wildcard = $(wildcard $(compaction_dep))
-compaction_dep_check = $(shell \
-if [ \( $(VERSION) -ge 6 \
-   -o \( $(VERSION) -eq 5 -a $(PATCHLEVEL) -ge 18 \) \) -a \
-   -z "$(compaction_dep_wildcard)" ] ; then \
-  echo "warn" ; \
-else \
-  echo "ok" ; \
-fi ;)
-ifeq ($(compaction_dep_check),ok)
-  obj-$(CONFIG_LTTNG) += lttng-probe-compaction.o
-else
-  $(warning Files $(compaction_dep) not found. Probe "compaction" is disabled. Use full kernel source tree to enable it.)
-endif # $(wildcard $(compaction_dep))
+ifneq ($(CONFIG_COMPACTION),)
+  # A dependency on internal header 'mm/internal.h' was introduced in v5.18
+  compaction_dep = $(srctree)/mm/internal.h
+  compaction_dep_wildcard = $(wildcard $(compaction_dep))
+  compaction_dep_check = $(shell \
+  if [ \( $(VERSION) -ge 6 \
+     -o \( $(VERSION) -eq 5 -a $(PATCHLEVEL) -ge 18 \) \) -a \
+     -z "$(compaction_dep_wildcard)" ] ; then \
+    echo "warn" ; \
+  else \
+    echo "ok" ; \
+  fi ;)
+  ifeq ($(compaction_dep_check),ok)
+    obj-$(CONFIG_LTTNG) += lttng-probe-compaction.o
+  else
+    $(warning Files $(compaction_dep) not found. Probe "compaction" is disabled. Use full kernel source tree to enable it.)
+  endif # $(wildcard $(compaction_dep))
+endif # CONFIG_COMPACTION
 
 ifneq ($(CONFIG_EXT4_FS),)
   ext4_dep = $(srctree)/fs/ext4/*.h
@@ -203,18 +205,10 @@ ifneq ($(CONFIG_FRAME_WARN),0)
 endif
 
 # Introduced in v3.6, remove in v5.18
-obj-$(CONFIG_LTTNG) +=  $(shell \
-    if [ \( ! \( $(VERSION) -ge 6 \
-      -o \( $(VERSION) -eq 5 -a $(PATCHLEVEL) -ge 18 \) \
-      -o \( $(VERSION) -eq 5 -a $(PATCHLEVEL) -eq 15 -a $(SUBLEVEL) -ge 44 \) \
-      -o \( $(VERSION) -eq 5 -a $(PATCHLEVEL) -eq 10 -a $(SUBLEVEL) -ge 119\) \) \) \
-      -a \
-      $(VERSION) -ge 4 \
-      -o \( $(VERSION) -eq 3 -a $(PATCHLEVEL) -ge 6 \) \
-      -o \( $(VERSION) -eq 3 -a $(PATCHLEVEL) -eq 5 -a $(SUBLEVEL) -ge 2 \) \
-      -o \( $(VERSION) -eq 3 -a $(PATCHLEVEL) -eq 4 -a $(SUBLEVEL) -ge 9 \) \
-      -o \( $(VERSION) -eq 3 -a $(PATCHLEVEL) -eq 0 -a $(SUBLEVEL) -ge 41 \) ] ; then \
-      echo "lttng-probe-random.o" ; fi;)
+random_dep = $(srctree)/include/trace/events/random.h
+ifneq ($(wildcard $(random_dep)),)
+  obj-$(CONFIG_LTTNG) += lttng-probe-random.o
+endif
 
 obj-$(CONFIG_LTTNG) +=  $(shell \
   if [ $(VERSION) -ge 4 \
This page took 0.027571 seconds and 4 git commands to generate.