fix: tie compaction probe build to CONFIG_COMPACTION
authorMichael Jeanson <mjeanson@efficios.com>
Wed, 10 Aug 2022 15:07:14 +0000 (11:07 -0400)
committerMathieu Desnoyers <mathieu.desnoyers@efficios.com>
Wed, 17 Aug 2022 15:26:01 +0000 (11:26 -0400)
The definition of 'struct compact_control' in 'mm/internal.h' depends on
CONFIG_COMPACTION being defined. Only build the compaction probe when
this configuration option is enabled.

Thanks to Bruce Ashfield <bruce.ashfield@gmail.com> for reporting this
issue.

Change-Id: I81e77aa9c1bf10452c152d432fe5224df0db42c9
Signed-off-by: Michael Jeanson <mjeanson@efficios.com>
Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
src/probes/Kbuild

index 2908cf75effdcf58dbb82df55eff6291ceff31b1..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
This page took 0.035049 seconds and 4 git commands to generate.