Fix build for RHEL 8.8 with linux 4.18.0-477.10.1+
[lttng-modules.git] / include / instrumentation / events / arch / x86 / exceptions.h
index 3c124638ec7c45847472ccc050b08c3f2d5eef00..89769e2ce3de7dd98ffd17fc54e181cb7b2b77ba 100644 (file)
@@ -3,11 +3,12 @@
 #define LTTNG_TRACE_EXCEPTIONS_H
 
 #include <lttng/tracepoint-event.h>
-#include <linux/version.h>
+#include <lttng/kernel-version.h>
 
-#if (LINUX_VERSION_CODE >= KERNEL_VERSION(4,15,0))
+#ifdef CONFIG_LTTNG_EXPERIMENTAL_BITWISE_ENUM
+#if (LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(4,15,0))
 #include <../arch/x86/include/asm/traps.h>
-#else /* #if (LINUX_VERSION_CODE >= KERNEL_VERSION(4,15,0)) */
+#else /* #if (LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(4,15,0)) */
 
 /* Only define this enum once. */
 
@@ -20,18 +21,20 @@ enum {
        X86_PF_USER =   1 << 2,
        X86_PF_RSVD =   1 << 3,
        X86_PF_INSTR =  1 << 4,
-#if (LINUX_VERSION_CODE >= KERNEL_VERSION(4,6,0))
+#if (LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(4,6,0))
        X86_PF_PK =     1 << 5,
-#endif /* #if (LINUX_VERSION_CODE >= KERNEL_VERSION(4,6,0)) */
+#endif /* #if (LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(4,6,0)) */
 };
 
 #endif /* ONCE_LTTNG_EXCEPTIONS_H */
 
-#endif /* #else #if (LINUX_VERSION_CODE >= KERNEL_VERSION(4,15,0)) */
+#endif /* #else #if (LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(4,15,0)) */
+#endif /* CONFIG_LTTNG_EXPERIMENTAL_BITWISE_ENUM */
 
 #undef TRACE_SYSTEM
 #define TRACE_SYSTEM x86_exceptions
 
+#ifdef CONFIG_LTTNG_EXPERIMENTAL_BITWISE_ENUM
 LTTNG_TRACEPOINT_ENUM(lttng_x86_pf_error_code,
        TP_ENUM_VALUES(
                ctf_enum_value("PROTECTION_FAULT",      X86_PF_PROT)
@@ -39,11 +42,12 @@ LTTNG_TRACEPOINT_ENUM(lttng_x86_pf_error_code,
                ctf_enum_value("USER_MODE",             X86_PF_USER)
                ctf_enum_value("RESERVED_BIT",          X86_PF_RSVD)
                ctf_enum_value("INSTRUCTION_FETCH",     X86_PF_INSTR)
-#if (LINUX_VERSION_CODE >= KERNEL_VERSION(4,6,0))
+#if (LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(4,6,0))
                ctf_enum_value("PROTECTION_KEYS_BLOCK", X86_PF_PK)
-#endif /* #if (LINUX_VERSION_CODE >= KERNEL_VERSION(4,6,0)) */
+#endif /* #if (LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(4,6,0)) */
        )
 )
+#endif /* CONFIG_LTTNG_EXPERIMENTAL_BITWISE_ENUM */
 
 LTTNG_TRACEPOINT_EVENT_CLASS(x86_exceptions_class,
 
@@ -61,7 +65,11 @@ LTTNG_TRACEPOINT_EVENT_CLASS(x86_exceptions_class,
                 * Currently, only 5 low bits are used. Should be made
                 * larger if error codes are added to the kernel.
                 */
+#ifdef CONFIG_LTTNG_EXPERIMENTAL_BITWISE_ENUM
                ctf_enum(lttng_x86_pf_error_code, unsigned char, error_code, error_code)
+#else
+               ctf_integer_hex(unsigned char, error_code, error_code)
+#endif
        )
 )
 
This page took 0.024823 seconds and 4 git commands to generate.