Fix: handle missing ftrace header on v4.12
[lttng-modules.git] / probes / Kbuild
index ac62e967d3db4bccdad61df30659ed17e9146032..d5d159ab0f666d3c06fe88a4b86bc09681b537ec 100644 (file)
@@ -254,22 +254,11 @@ ifneq ($(CONFIG_KRETPROBES),)
 endif # CONFIG_KRETPROBES
 
 ifneq ($(CONFIG_DYNAMIC_FTRACE),)
-  ftrace_dep = $(srctree)/kernel/trace/trace.h
-  ftrace_dep_check = $(wildcard $(ftrace_dep))
-  ftrace = $(shell \
-    if [ $(VERSION) -ge 5 -o \( $(VERSION) -eq 4 -a $(PATCHLEVEL) -ge 12 \) ] ; then \
-      if [ -z "$(ftrace_dep_check)" ] ; then \
-        echo "warn" ; \
-        exit ; \
-      fi; \
-    fi; \
-    echo "lttng-ftrace.o" ; \
-    )
-  ifeq ($(ftrace),warn)
+  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.)
-    ftrace =
-  endif # $(ftrace),warn
-  obj-$(CONFIG_LTTNG) += $(ftrace)
+  endif
 endif # CONFIG_DYNAMIC_FTRACE
 
 # vim:syntax=make
This page took 0.025811 seconds and 4 git commands to generate.