From: Mathieu Desnoyers Date: Wed, 27 May 2015 16:19:01 +0000 (-0400) Subject: Fix: add RHEL version macros X-Git-Tag: v2.6.2~5 X-Git-Url: https://git.lttng.org./?a=commitdiff_plain;h=fa73b7a2bdfee670825a82a4cbe0cedfd36807bf;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 4f950958..1c7df439 100644 --- a/instrumentation/events/lttng-module/kvm.h +++ b/instrumentation/events/lttng-module/kvm.h @@ -354,7 +354,8 @@ LTTNG_TRACEPOINT_EVENT_INSTANCE(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)) LTTNG_TRACEPOINT_EVENT( kvm_async_pf_completed, diff --git a/lttng-kernel-version.h b/lttng-kernel-version.h index 1afdcd34..f98a1925 100644 --- a/lttng-kernel-version.h +++ b/lttng-kernel-version.h @@ -73,4 +73,21 @@ LTTNG_DEBIAN_VERSION_CODE < \ LTTNG_DEBIAN_KERNEL_VERSION(a_high, b_high, c_high, d_high, e_high, f_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 1b2821a1..d7d18429 100644 --- a/wrapper/trace-clock.h +++ b/wrapper/trace-clock.h @@ -39,7 +39,8 @@ #include "percpu-defs.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