X-Git-Url: http://git.liburcu.org/?a=blobdiff_plain;f=probes%2FKbuild;h=fe869d050d403fd582ed96a88175d14f0e76a66f;hb=2b31a1ab5e6fed4984496c571a4c264f0d2e644d;hp=2f6c7c76828681cb6795354f4e084f9e3c6e75a2;hpb=591fa914204fa8f8a1adb474bb9d5797cf5df43c;p=lttng-modules.git diff --git a/probes/Kbuild b/probes/Kbuild index 2f6c7c76..fe869d05 100644 --- a/probes/Kbuild +++ b/probes/Kbuild @@ -259,7 +259,21 @@ ifneq ($(CONFIG_KRETPROBES),) endif # CONFIG_KRETPROBES ifneq ($(CONFIG_DYNAMIC_FTRACE),) - obj-$(CONFIG_LTTNG) += lttng-ftrace.o + 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; \ + echo "lttng-ftrace.o" ; \ + fi;) + ifeq ($(ftrace),warn) + $(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 # CONFIG_DYNAMIC_FTRACE # vim:syntax=make