Fix: remove regmap instrumentation for kernels < 4.1
authorMathieu Desnoyers <mathieu.desnoyers@efficios.com>
Tue, 26 May 2015 19:22:01 +0000 (15:22 -0400)
committerMathieu Desnoyers <mathieu.desnoyers@efficios.com>
Tue, 26 May 2015 19:22:01 +0000 (15:22 -0400)
Modifications to regmap.h instrumentation in mainline Linux kernel has
been no less than erratic. First, the public instrumentation header
regmap.h include a private driver header in Linux 4.0. Then, regmap.h
is moved to the private driver directory in Linux 4.1. To make things
worse, the 4.0 commit has been picked into stable branches of the Linux
kernel.

Since this does not appear to be an instrumentation of utmost
importance, only build this instrumentation probe if the private header
is found in the driver directory (need full kernel sources).

This removes regmap instrumentation for older kernels.

Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
instrumentation/events/lttng-module/regmap.h
probes/Makefile
probes/lttng-probe-regmap.c

index 358d744f9e815c7482071986e0654334a0710ec3..48bb462c27189e3a1c02012467e5cabe35ab361a 100644 (file)
@@ -14,7 +14,6 @@ struct device;
 struct regmap;
 #endif
 
-#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,19,4))
 /*
  * Log register events
  */
@@ -46,42 +45,7 @@ LTTNG_TRACEPOINT_EVENT_INSTANCE(regmap_reg, regmap_reg_read,
 
        TP_ARGS(map, reg, val)
 )
-#else
-/*
- * Log register events
- */
-LTTNG_TRACEPOINT_EVENT_CLASS(regmap_reg,
-
-       TP_PROTO(struct device *dev, unsigned int reg,
-                unsigned int val),
-
-       TP_ARGS(dev, reg, val),
-
-       TP_FIELDS(
-               ctf_string(name, dev_name(dev))
-               ctf_integer(unsigned int, reg, reg)
-               ctf_integer(unsigned int, val, val)
-       )
-)
-
-LTTNG_TRACEPOINT_EVENT_INSTANCE(regmap_reg, regmap_reg_write,
-
-       TP_PROTO(struct device *dev, unsigned int reg,
-                unsigned int val),
-
-       TP_ARGS(dev, reg, val)
-)
-
-LTTNG_TRACEPOINT_EVENT_INSTANCE(regmap_reg, regmap_reg_read,
 
-       TP_PROTO(struct device *dev, unsigned int reg,
-                unsigned int val),
-
-       TP_ARGS(dev, reg, val)
-)
-#endif
-
-#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,19,4))
 LTTNG_TRACEPOINT_EVENT_INSTANCE(regmap_reg, regmap_reg_read_cache,
 
        TP_PROTO(struct regmap *map, unsigned int reg,
@@ -89,17 +53,7 @@ LTTNG_TRACEPOINT_EVENT_INSTANCE(regmap_reg, regmap_reg_read_cache,
 
        TP_ARGS(map, reg, val)
 )
-#elif (LINUX_VERSION_CODE >= KERNEL_VERSION(3,3,0))
-LTTNG_TRACEPOINT_EVENT_INSTANCE(regmap_reg, regmap_reg_read_cache,
-
-       TP_PROTO(struct device *dev, unsigned int reg,
-                unsigned int val),
-
-       TP_ARGS(dev, reg, val)
-)
-#endif
 
-#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,19,4))
 LTTNG_TRACEPOINT_EVENT_CLASS(regmap_block,
 
        TP_PROTO(struct regmap *map, unsigned int reg, int count),
@@ -140,50 +94,7 @@ LTTNG_TRACEPOINT_EVENT_INSTANCE(regmap_block, regmap_hw_write_done,
 
        TP_ARGS(map, reg, count)
 )
-#else
-LTTNG_TRACEPOINT_EVENT_CLASS(regmap_block,
-
-       TP_PROTO(struct device *dev, unsigned int reg, int count),
-
-       TP_ARGS(dev, reg, count),
-
-       TP_FIELDS(
-               ctf_string(name, dev_name(dev))
-               ctf_integer(unsigned int, reg, reg)
-               ctf_integer(int, count, count)
-       )
-)
-
-LTTNG_TRACEPOINT_EVENT_INSTANCE(regmap_block, regmap_hw_read_start,
-
-       TP_PROTO(struct device *dev, unsigned int reg, int count),
-
-       TP_ARGS(dev, reg, count)
-)
-
-LTTNG_TRACEPOINT_EVENT_INSTANCE(regmap_block, regmap_hw_read_done,
-
-       TP_PROTO(struct device *dev, unsigned int reg, int count),
-
-       TP_ARGS(dev, reg, count)
-)
-
-LTTNG_TRACEPOINT_EVENT_INSTANCE(regmap_block, regmap_hw_write_start,
-
-       TP_PROTO(struct device *dev, unsigned int reg, int count),
-
-       TP_ARGS(dev, reg, count)
-)
-
-LTTNG_TRACEPOINT_EVENT_INSTANCE(regmap_block, regmap_hw_write_done,
-
-       TP_PROTO(struct device *dev, unsigned int reg, int count),
-
-       TP_ARGS(dev, reg, count)
-)
-#endif
 
-#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,19,4))
 LTTNG_TRACEPOINT_EVENT_MAP(regcache_sync,
 
        regmap_regcache_sync,
@@ -199,25 +110,7 @@ LTTNG_TRACEPOINT_EVENT_MAP(regcache_sync,
                ctf_string(type, type)
        )
 )
-#else
-LTTNG_TRACEPOINT_EVENT_MAP(regcache_sync,
-
-       regmap_regcache_sync,
 
-       TP_PROTO(struct device *dev, const char *type,
-                const char *status),
-
-       TP_ARGS(dev, type, status),
-
-       TP_FIELDS(
-               ctf_string(name, dev_name(dev))
-               ctf_string(status, status)
-               ctf_string(type, type)
-       )
-)
-#endif
-
-#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,19,4))
 LTTNG_TRACEPOINT_EVENT_CLASS(regmap_bool,
 
        TP_PROTO(struct regmap *map, bool flag),
@@ -244,33 +137,6 @@ LTTNG_TRACEPOINT_EVENT_INSTANCE(regmap_bool, regmap_cache_bypass,
        TP_ARGS(map, flag)
 
 )
-#elif (LINUX_VERSION_CODE >= KERNEL_VERSION(3,4,0))
-LTTNG_TRACEPOINT_EVENT_CLASS(regmap_bool,
-
-       TP_PROTO(struct device *dev, bool flag),
-
-       TP_ARGS(dev, flag),
-
-       TP_FIELDS(
-               ctf_string(name, dev_name(dev))
-               ctf_integer(int, flag, flag)
-       )
-)
-
-LTTNG_TRACEPOINT_EVENT_INSTANCE(regmap_bool, regmap_cache_only,
-
-       TP_PROTO(struct device *dev, bool flag),
-
-       TP_ARGS(dev, flag)
-)
-
-LTTNG_TRACEPOINT_EVENT_INSTANCE(regmap_bool, regmap_cache_bypass,
-
-       TP_PROTO(struct device *dev, bool flag),
-
-       TP_ARGS(dev, flag)
-)
-#endif
 
 #endif /* LTTNG_TRACE_REGMAP_H */
 
index 3272b9f82f0ca340c2df5377c27a500c82ed068c..4de157b3dcdffb3b734dbd4df413639e8f9f696e 100644 (file)
@@ -192,29 +192,11 @@ obj-m +=  $(shell \
                echo "lttng-probe-rcu.o" ; fi;)
 
 ifneq ($(CONFIG_REGMAP),)
-regmap_dep_3_x = $(srctree)/include/trace/events/regmap.h
-regmap_dep_4_0 = $(srctree)/drivers/base/regmap/internal.h
 regmap_dep_4_1 = $(srctree)/drivers/base/regmap/trace.h
-
 ifneq ($(wildcard $(regmap_dep_4_1)),)
-obj-m +=  $(shell \
-       if [ $(VERSION) -ge 5 \
-               -o \( $(VERSION) -eq 4 -a $(PATCHLEVEL) -ge 1 \) ] ; then \
-               echo "lttng-probe-regmap.o" ; fi;)
-else
-ifneq ($(wildcard $(regmap_dep_4_0)),)
-obj-m +=  $(shell \
-       if [ $(VERSION) -eq 4 -a $(PATCHLEVEL) -eq 0 ] ; then \
-               echo "lttng-probe-regmap.o" ; fi;)
+obj-m += lttng-probe-regmap.o
 else
-ifneq ($(wildcard $(regmap_dep_3_x)),)
-obj-m +=  $(shell \
-       if [ $(VERSION) -eq 3 -a $(PATCHLEVEL) -ge 2 ] ; then \
-               echo "lttng-probe-regmap.o" ; fi;)
-else
-$(warning Either of files $(regmap_dep_4_1), $(regmap_dep_4_0), or $(regmap_dep_3_x) not found. Probe "regmap" is disabled. Use full kernel source tree to enable it.)
-endif
-endif
+$(warning File $(regmap_dep_4_1) not found. Probe "regmap" is disabled. Need Linux 4.1+ kernel source tree to enable it.)
 endif
 endif
 
index c51924a0f2c414db783864f3113af6dfd12c1a35..f68566587f7933c2ef07f14187002cb6c9f1d0b2 100644 (file)
  * 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 <trace/events/regmap.h>
-#endif /* #else #if (LINUX_VERSION_CODE >= KERNEL_VERSION(4,1,0)) */
-
 /*
  * Create LTTng tracepoint probes.
  */
This page took 0.031504 seconds and 4 git commands to generate.