[lttng-dev] [RFC PATCH lttng-modules v2 20/30] Drop support for kernels < 3.0 from lock instrumentation

Michael Jeanson mjeanson at efficios.com
Thu Nov 8 16:45:25 EST 2018


Signed-off-by: Michael Jeanson <mjeanson at efficios.com>
---
 instrumentation/events/lttng-module/lock.h | 71 +---------------------
 probes/lttng-probe-lock.c                  |  5 --
 2 files changed, 2 insertions(+), 74 deletions(-)

diff --git a/instrumentation/events/lttng-module/lock.h b/instrumentation/events/lttng-module/lock.h
index 49e7811..c8cdc55 100644
--- a/instrumentation/events/lttng-module/lock.h
+++ b/instrumentation/events/lttng-module/lock.h
@@ -1,16 +1,7 @@
 /* SPDX-License-Identifier: GPL-2.0 */
-#include <linux/version.h>
 
 #undef TRACE_SYSTEM
-#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,33))
 #define TRACE_SYSTEM lock
-#else
-#define TRACE_SYSTEM lockdep
-#define TRACE_INCLUDE_FILE lock
-#if defined(_TRACE_LOCKDEP_H)
-#define LTTNG_TRACE_LOCK_H
-#endif
-#endif
 
 #if !defined(LTTNG_TRACE_LOCK_H) || defined(TRACE_HEADER_MULTI_READ)
 #define LTTNG_TRACE_LOCK_H
@@ -31,14 +22,10 @@ LTTNG_TRACEPOINT_EVENT(lock_acquire,
 	TP_FIELDS(
 		ctf_integer(unsigned int, flags, (trylock ? 1 : 0) | (read ? 2 : 0))
 		ctf_string(name, lock->name)
-#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,34))
 		ctf_integer_hex(void *, lockdep_addr, lock)
-#endif
 	)
 )
 
-#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,35))
-
 LTTNG_TRACEPOINT_EVENT_CLASS(lock,
 
 	TP_PROTO(struct lockdep_map *lock, unsigned long ip),
@@ -74,63 +61,9 @@ LTTNG_TRACEPOINT_EVENT_INSTANCE(lock, lock_acquired,
 	TP_ARGS(lock, ip)
 )
 
-#endif
-
-#else /* #if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,35)) */
-
-LTTNG_TRACEPOINT_EVENT(lock_release,
-
-	TP_PROTO(struct lockdep_map *lock, int nested, unsigned long ip),
-
-	TP_ARGS(lock, nested, ip),
-
-	TP_FIELDS(
-		ctf_string(name, lock->name)
-#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,34))
-		ctf_integer_hex(void *, lockdep_addr, lock)
-#endif
-	)
-)
-
-#ifdef CONFIG_LOCK_STAT
-
-LTTNG_TRACEPOINT_EVENT(lock_contended,
-
-	TP_PROTO(struct lockdep_map *lock, unsigned long ip),
-
-	TP_ARGS(lock, ip),
-
-	TP_FIELDS(
-		ctf_string(name, lock->name)
-#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,34))
-		ctf_integer_hex(void *, lockdep_addr, lock)
-#endif
-	)
-)
-
-LTTNG_TRACEPOINT_EVENT(lock_acquired,
-
-	TP_PROTO(struct lockdep_map *lock, unsigned long ip, s64 waittime),
-
-	TP_ARGS(lock, ip, waittime),
-
-	TP_FIELDS(
-		ctf_string(name, lock->name)
-#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,34))
-		ctf_integer(s64, wait_nsec, wait_nsec)
-		ctf_integer_hex(void *, lockdep_addr, lock)
-#else
-		ctf_integer(unsigned long, wait_usec, (unsigned long) waittime)
-		ctf_integer(unsigned long, wait_nsec_rem, do_div(waittime, NSEC_PER_USEC))
-#endif
-	)
-)
-
-#endif
-
-#endif /* #if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,35)) */
+#endif /* CONFIG_LOCK_STAT */
 
-#endif
+#endif /* CONFIG_LOCKDEP */
 
 #endif /* LTTNG_TRACE_LOCK_H */
 
diff --git a/probes/lttng-probe-lock.c b/probes/lttng-probe-lock.c
index b3ad230..e81eb36 100644
--- a/probes/lttng-probe-lock.c
+++ b/probes/lttng-probe-lock.c
@@ -16,12 +16,7 @@
  * 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(2,6,33))
 #include <trace/events/lock.h>
-#else
-#include <trace/events/lockdep.h>
-#endif
-
 #include <wrapper/tracepoint.h>
 
 /*
-- 
2.17.1



More information about the lttng-dev mailing list