blob: 21e27ffc5efaaadb4d10fc914cdf2972d4f2fc88 [file] [log] [blame]
Patrick Williams92b42cb2022-09-03 06:53:57 -05001From 8e42c4821fb5f5cb816b6ddf73d9a13ba3298a63 Mon Sep 17 00:00:00 2001
2From: Michael Jeanson <mjeanson@efficios.com>
3Date: Wed, 10 Aug 2022 11:07:14 -0400
4Subject: [PATCH] fix: tie compaction probe build to CONFIG_COMPACTION
5
6The definition of 'struct compact_control' in 'mm/internal.h' depends on
7CONFIG_COMPACTION being defined. Only build the compaction probe when
8this configuration option is enabled.
9
10Thanks to Bruce Ashfield <bruce.ashfield@gmail.com> for reporting this
11issue.
12
13Upstream-Status: Backport [https://review.lttng.org/c/lttng-modules/+/8660]
14
15Change-Id: I81e77aa9c1bf10452c152d432fe5224df0db42c9
16Signed-off-by: Michael Jeanson <mjeanson@efficios.com>
17---
18 src/probes/Kbuild | 34 ++++++++++++++++++----------------
19 1 file changed, 18 insertions(+), 16 deletions(-)
20
21diff --git a/src/probes/Kbuild b/src/probes/Kbuild
22index 2908cf75..3e556b8e 100644
23--- a/src/probes/Kbuild
24+++ b/src/probes/Kbuild
25@@ -167,22 +167,24 @@ ifneq ($(CONFIG_BTRFS_FS),)
26 endif # $(wildcard $(btrfs_dep))
27 endif # CONFIG_BTRFS_FS
28
29-# A dependency on internal header 'mm/internal.h' was introduced in v5.18
30-compaction_dep = $(srctree)/mm/internal.h
31-compaction_dep_wildcard = $(wildcard $(compaction_dep))
32-compaction_dep_check = $(shell \
33-if [ \( $(VERSION) -ge 6 \
34- -o \( $(VERSION) -eq 5 -a $(PATCHLEVEL) -ge 18 \) \) -a \
35- -z "$(compaction_dep_wildcard)" ] ; then \
36- echo "warn" ; \
37-else \
38- echo "ok" ; \
39-fi ;)
40-ifeq ($(compaction_dep_check),ok)
41- obj-$(CONFIG_LTTNG) += lttng-probe-compaction.o
42-else
43- $(warning Files $(compaction_dep) not found. Probe "compaction" is disabled. Use full kernel source tree to enable it.)
44-endif # $(wildcard $(compaction_dep))
45+ifneq ($(CONFIG_COMPACTION),)
46+ # A dependency on internal header 'mm/internal.h' was introduced in v5.18
47+ compaction_dep = $(srctree)/mm/internal.h
48+ compaction_dep_wildcard = $(wildcard $(compaction_dep))
49+ compaction_dep_check = $(shell \
50+ if [ \( $(VERSION) -ge 6 \
51+ -o \( $(VERSION) -eq 5 -a $(PATCHLEVEL) -ge 18 \) \) -a \
52+ -z "$(compaction_dep_wildcard)" ] ; then \
53+ echo "warn" ; \
54+ else \
55+ echo "ok" ; \
56+ fi ;)
57+ ifeq ($(compaction_dep_check),ok)
58+ obj-$(CONFIG_LTTNG) += lttng-probe-compaction.o
59+ else
60+ $(warning Files $(compaction_dep) not found. Probe "compaction" is disabled. Use full kernel source tree to enable it.)
61+ endif # $(wildcard $(compaction_dep))
62+endif # CONFIG_COMPACTION
63
64 ifneq ($(CONFIG_EXT4_FS),)
65 ext4_dep = $(srctree)/fs/ext4/*.h
66--
672.34.1
68