From: Mathieu Desnoyers Date: Wed, 27 May 2015 16:19:01 +0000 (-0400) Subject: Fix: add RHEL version macros X-Git-Tag: v2.5.5~3 X-Git-Url: https://git.lttng.org./?a=commitdiff_plain;h=7bcdff657b7a6a754e07d2ed285e9c2d8c9f3cfa;p=lttng-modules.git Fix: add RHEL version macros RHEL 7.1 has backported upstream patches that change the kvm.h tracepoint prototype. Add version check specific to RHEL to handle this case. RHEL 7.x has the required fixes backported that allow removing the 3.10 blacklist check for them, so take this into account. Signed-off-by: Mathieu Desnoyers --- diff --git a/instrumentation/events/lttng-module/kvm.h b/instrumentation/events/lttng-module/kvm.h index 99d1788a..ff328362 100644 --- a/instrumentation/events/lttng-module/kvm.h +++ b/instrumentation/events/lttng-module/kvm.h @@ -325,7 +325,8 @@ DEFINE_EVENT(kvm_async_pf_nopresent_ready, kvm_async_pf_ready, TP_ARGS(token, gva) ) -#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,13,0)) +#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,13,0) \ + || LTTNG_RHEL_KERNEL_RANGE(3,10,0,7,1, 3,11,0,0,0)) TRACE_EVENT( kvm_async_pf_completed, diff --git a/lttng-kernel-version.h b/lttng-kernel-version.h index 7dbb62b9..62b82efc 100644 --- a/lttng-kernel-version.h +++ b/lttng-kernel-version.h @@ -48,4 +48,21 @@ LTTNG_UBUNTU_VERSION_CODE < \ LTTNG_UBUNTU_KERNEL_VERSION(a_high, b_high, c_high, d_high)) +#define LTTNG_RHEL_KERNEL_VERSION(a, b, c, d, e) \ + (((a) * (1ULL << 32)) + ((b) << 24) + ((c) << 16) + ((d) << 8) + (e)) + +#ifdef RHEL_RELEASE_CODE +#define LTTNG_RHEL_VERSION_CODE \ + ((LINUX_VERSION_CODE * (1ULL << 16)) + RHEL_RELEASE_CODE) +#else +#define LTTNG_RHEL_VERSION_CODE 0 +#endif + +#define LTTNG_RHEL_KERNEL_RANGE(a_low, b_low, c_low, d_low, e_low, \ + a_high, b_high, c_high, d_high, e_high) \ + (LTTNG_RHEL_VERSION_CODE >= \ + LTTNG_RHEL_KERNEL_VERSION(a_low, b_low, c_low, d_low, e_low) && \ + LTTNG_RHEL_VERSION_CODE < \ + LTTNG_RHEL_KERNEL_VERSION(a_high, b_high, c_high, d_high, e_high)) + #endif /* _LTTNG_KERNEL_VERSION_H */ diff --git a/wrapper/trace-clock.h b/wrapper/trace-clock.h index 9c0c8067..a36140f9 100644 --- a/wrapper/trace-clock.h +++ b/wrapper/trace-clock.h @@ -36,7 +36,8 @@ #include "../lttng-kernel-version.h" #include "random.h" -#if LTTNG_KERNEL_RANGE(3,10,0, 3,10,14) || LTTNG_KERNEL_RANGE(3,11,0, 3,11,3) +#if ((LTTNG_KERNEL_RANGE(3,10,0, 3,10,14) && !LTTNG_RHEL_KERNEL_RANGE(3,10,0,7,0, 3,10,14,0,0)) \ + || LTTNG_KERNEL_RANGE(3,11,0, 3,11,3)) #error "Linux kernels 3.10 and 3.11 introduce a deadlock in the timekeeping subsystem. Fixed by commit 7bd36014460f793c19e7d6c94dab67b0afcfcb7f \"timekeeping: Fix HRTICK related deadlock from ntp lock changes\" in Linux." #endif