X-Git-Url: http://git.lttng.org./?a=blobdiff_plain;f=src%2Fprobes%2FKbuild;h=aa002534ab5424e59318f8c6b86715f935a807e6;hb=4697aac7ad1bdb932a843d93076418f4048baad3;hp=2908cf75effdcf58dbb82df55eff6291ceff31b1;hpb=ed1149ef88fb62c365ac66cf62c58ac6abd8d7e8;p=lttng-modules.git diff --git a/src/probes/Kbuild b/src/probes/Kbuild index 2908cf75..aa002534 100644 --- a/src/probes/Kbuild +++ b/src/probes/Kbuild @@ -9,7 +9,24 @@ ccflags-y += -I$(TOP_LTTNG_MODULES_DIR)/include obj-$(CONFIG_LTTNG) += lttng-probe-sched.o obj-$(CONFIG_LTTNG) += lttng-probe-irq.o obj-$(CONFIG_LTTNG) += lttng-probe-timer.o -obj-$(CONFIG_LTTNG) += lttng-probe-kmem.o + +# A dependency on internal header 'mm/slab.h' was introduced in v6.0 +kmem_dep = $(srctree)/mm/slab.h +kmem_dep_wildcard = $(wildcard $(kmem_dep)) +kmem_dep_check = $(shell \ +if [ \( $(VERSION) -ge 7 \ + -o \( $(VERSION) -eq 6 -a $(PATCHLEVEL) -ge 0 \) \) -a \ + -z "$(kmem_dep_wildcard)" ] ; then \ + echo "warn" ; \ +else \ + echo "ok" ; \ +fi ;) +ifeq ($(kmem_dep_check),ok) + obj-$(CONFIG_LTTNG) += lttng-probe-kmem.o +else + $(warning File $(kmem_dep) not found. Probe "kmem" is disabled. Use full kernel source tree to enable it.) +endif + obj-$(CONFIG_LTTNG) += lttng-probe-module.o obj-$(CONFIG_LTTNG) += lttng-probe-power.o obj-$(CONFIG_LTTNG) += lttng-probe-statedump.o @@ -167,22 +184,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