From 911f9f47ff18efe784faaf0d8476304d8435fd27 Mon Sep 17 00:00:00 2001 From: Mathieu Desnoyers Date: Mon, 27 Apr 2015 16:44:11 -0400 Subject: [PATCH] Fix: 4.1-rc1 Linux build and regmap instrumentation regmap header has been privatized. Signed-off-by: Mathieu Desnoyers --- probes/Makefile | 5 +++++ probes/lttng-probe-regmap.c | 9 +++++++++ 2 files changed, 14 insertions(+) diff --git a/probes/Makefile b/probes/Makefile index 4d38199e..b2dd3af4 100644 --- a/probes/Makefile +++ b/probes/Makefile @@ -192,10 +192,15 @@ obj-m += $(shell \ echo "lttng-probe-rcu.o" ; fi;) ifneq ($(CONFIG_REGMAP),) +regmap_dep = $(srctree)/drivers/base/regmap/trace.h $(srctree)/include/trace/events/regmap.h +ifneq ($(wildcard $(regmap_dep)),) obj-m += $(shell \ if [ $(VERSION) -ge 4 \ -o \( $(VERSION) -eq 3 -a $(PATCHLEVEL) -ge 2 \) ] ; then \ echo "lttng-probe-regmap.o" ; fi;) +else +$(warning Either of files { $(regmap_dep) } not found. Probe "regmap" is disabled. Use full kernel source tree to enable it.) +endif endif ifneq ($(CONFIG_PM_RUNTIME),) diff --git a/probes/lttng-probe-regmap.c b/probes/lttng-probe-regmap.c index 8850b55a..c51924a0 100644 --- a/probes/lttng-probe-regmap.c +++ b/probes/lttng-probe-regmap.c @@ -23,13 +23,22 @@ #include #include +#include "../lttng-kernel-version.h" #include "../lttng-tracer.h" /* * Create the tracepoint static inlines from the kernel to validate that our * trace event macros match the kernel we run on. */ +#if (LINUX_VERSION_CODE >= KERNEL_VERSION(4,1,0)) +#include <../../drivers/base/regmap/trace.h> + +#undef TRACE_INCLUDE_PATH +#undef TRACE_INCLUDE_FILE + +#else /* #if (LINUX_VERSION_CODE >= KERNEL_VERSION(4,1,0)) */ #include +#endif /* #else #if (LINUX_VERSION_CODE >= KERNEL_VERSION(4,1,0)) */ /* * Create LTTng tracepoint probes. -- 2.34.1