Fix: handle missing ftrace header on v4.12
[lttng-modules.git] / probes / Kbuild
index 2afb6dd26d091cc5f489afbca9108f2bc31e1742..cc1c0656e4ad2a7556aab9fac1fe87c65bc800aa 100644 (file)
@@ -97,13 +97,15 @@ ifneq ($(CONFIG_EXT3_FS),)
   ext3_dep = $(srctree)/fs/ext3/*.h
   ext3_dep_check = $(wildcard $(ext3_dep))
   ext3 = $(shell \
-    if [ $(VERSION) -ge 4 -o \( $(VERSION) -eq 3 -a $(PATCHLEVEL) -ge 1 \) ] ; then \
-      if [ \( $(VERSION) -ge 4 -o \( $(VERSION) -eq 3 -a $(PATCHLEVEL) -ge 4 \) \) -a \
-        -z "$(ext3_dep_check)" ] ; then \
-        echo "warn" ; \
-        exit ; \
+    if [ $(VERSION) -lt 4 -o \( $(VERSION) -eq 4 -a $(PATCHLEVEL) -lt 3 \) ] ; then \
+      if [ $(VERSION) -ge 4 -o \( $(VERSION) -eq 3 -a $(PATCHLEVEL) -ge 1 \) ] ; then \
+        if [ \( $(VERSION) -ge 4 -o \( $(VERSION) -eq 3 -a $(PATCHLEVEL) -ge 4 \) \) -a \
+          -z "$(ext3_dep_check)" ] ; then \
+          echo "warn" ; \
+          exit ; \
+        fi; \
+        echo "lttng-probe-ext3.o" ; \
       fi; \
-      echo "lttng-probe-ext3.o" ; \
     fi;)
   ifeq ($(ext3),warn)
     $(warning Files $(ext3_dep) not found. Probe "ext3" is disabled. Use full kernel source tree to enable it.)
@@ -143,19 +145,11 @@ ifneq ($(CONFIG_SCSI),)
       echo "lttng-probe-scsi.o" ; fi;)
 endif # CONFIG_SCSI
 
-vmscan = $(shell \
+obj-$(CONFIG_LTTNG) += $(shell \
   if [ $(VERSION) -ge 3 \
     -o \( $(VERSION) -eq 2 -a $(PATCHLEVEL) -eq 6 -a $(SUBLEVEL) -ge 36 \) ] ; then \
     echo "lttng-probe-vmscan.o" ; fi;)
 
-ifneq ($(CONFIG_SWAP),)
-  obj-$(CONFIG_LTTNG) += $(vmscan)
-else
-  ifneq ($(CONFIG_CGROUP_MEM_RES_CTLR),)
-    obj-$(CONFIG_LTTNG) += $(vmscan)
-  endif # CONFIG_CGROUP_MEM_RES_CTLR
-endif # CONFIG_SWAP
-
 # lock probe does not work, so disabling it for now
 #ifneq ($(CONFIG_LOCKDEP),)
 #  obj-$(CONFIG_LTTNG) += lttng-probe-lock.o
@@ -251,7 +245,9 @@ ifneq ($(CONFIG_KALLSYMS_ALL),)
       -o \( $(VERSION) -eq 2 -a $(PATCHLEVEL) -eq 6 -a $(SUBLEVEL) -ge 36 \) ] ; then \
       echo "lttng-probe-writeback.o" ; fi;)
 else
-  $(warning CONFIG_KALLSYMS_ALL is disabled, therefore probe "writeback" is disabled. Rebuild your kernel with this configuration option enabled in order to trace this subsystem.)
+  ifdef CONFIG_LOCALVERSION # Check if dot-config is included.
+    $(warning CONFIG_KALLSYMS_ALL is disabled, therefore probe "writeback" is disabled. Rebuild your kernel with this configuration option enabled in order to trace this subsystem.)
+  endif
 endif # CONFIG_KALLSYMS_ALL
 
 ifneq ($(CONFIG_KPROBES),)
@@ -263,7 +259,11 @@ ifneq ($(CONFIG_KRETPROBES),)
 endif # CONFIG_KRETPROBES
 
 ifneq ($(CONFIG_DYNAMIC_FTRACE),)
-  obj-$(CONFIG_LTTNG) += lttng-ftrace.o
+  ifeq ($(have_ftrace_header),yes)
+    obj-$(CONFIG_LTTNG) += lttng-ftrace.o
+  else
+    $(warning Files $(ftrace_dep) not found. Probe "ftrace" is disabled. Use full kernel source tree to enable it.)
+  endif
 endif # CONFIG_DYNAMIC_FTRACE
 
 # vim:syntax=make
This page took 0.023495 seconds and 4 git commands to generate.