Disable x86 error code bitwise enum in default build
authorMichael Jeanson <mjeanson@efficios.com>
Thu, 13 May 2021 14:30:24 +0000 (10:30 -0400)
committerMathieu Desnoyers <mathieu.desnoyers@efficios.com>
Thu, 13 May 2021 15:51:30 +0000 (11:51 -0400)
Only generate the bitwise enumerations when
CONFIG_LTTNG_EXPERIMENTAL_BITWISE_ENUM is enabled, so the default build
does not generate traces which lead to warnings when viewed with
babeltrace 1.x and babeltrace 2 with default options.

commit 8c7f2a9f2732b11f5cc9798cecb621420cc0e972
Author: Francis Deslauriers <francis.deslauriers@efficios.com>
Date:   Fri Jun 5 18:42:54 2020 -0400

    x86: add error code enum to pagefault tracepoints

Change-Id: I7901fad216b4774a9bbf3665568f357321805871
Signed-off-by: Michael Jeanson <mjeanson@efficios.com>
Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
include/instrumentation/events/arch/x86/exceptions.h

index 53c554f44b54c859b51a9905cf985fa2daae0588..89769e2ce3de7dd98ffd17fc54e181cb7b2b77ba 100644 (file)
@@ -5,6 +5,7 @@
 #include <lttng/tracepoint-event.h>
 #include <lttng/kernel-version.h>
 
+#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 (LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(4,15,0)) */
@@ -28,10 +29,12 @@ enum {
 #endif /* ONCE_LTTNG_EXCEPTIONS_H */
 
 #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)
@@ -44,6 +47,7 @@ LTTNG_TRACEPOINT_ENUM(lttng_x86_pf_error_code,
 #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.030455 seconds and 4 git commands to generate.