From 4f65dbd279a289c2801985aaa419df575ea90e17 Mon Sep 17 00:00:00 2001 From: Michael Jeanson Date: Wed, 12 May 2021 14:20:44 -0400 Subject: [PATCH] Disable mmap bitwise enum in default build 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. Original commit: commit 3cf55950d0f6aa43eb5ad119bad1dbda69f75a54 Author: Francis Deslauriers Date: Fri Jun 5 11:38:14 2020 -0400 syscalls: Make mmap()'s fields `prot` and `flags` enums Change-Id: I033f42855c2967356b1e90cd89450eb5100a0f0b Signed-off-by: Michael Jeanson Signed-off-by: Mathieu Desnoyers --- .../headers/syscalls_integers_override.h | 18 ++++++++++++++---- 1 file changed, 14 insertions(+), 4 deletions(-) diff --git a/include/instrumentation/syscalls/headers/syscalls_integers_override.h b/include/instrumentation/syscalls/headers/syscalls_integers_override.h index 5d5d7a53..eb0cf80f 100644 --- a/include/instrumentation/syscalls/headers/syscalls_integers_override.h +++ b/include/instrumentation/syscalls/headers/syscalls_integers_override.h @@ -2,6 +2,8 @@ #ifndef CREATE_SYSCALL_TABLE +#ifdef CONFIG_LTTNG_EXPERIMENTAL_BITWISE_ENUM + /* * The `flags` argument of the mmap syscall is split in two parts: * - The type of mapping is described by the four least significant bits of the 4 @@ -113,10 +115,8 @@ lttng_kernel_static_event_field_array( \ ) #endif -/* - * Use a custom field here so that tracer writes a single integer and the - * work of splitting it up in two fields is left to the trace reader. - */ +#endif /* CONFIG_LTTNG_EXPERIMENTAL_BITWISE_ENUM */ + #define OVERRIDE_32_mmap #define OVERRIDE_64_mmap SC_LTTNG_TRACEPOINT_EVENT(mmap, @@ -128,6 +128,12 @@ SC_LTTNG_TRACEPOINT_EVENT(mmap, TP_FIELDS(sc_exit(ctf_integer_hex(unsigned long, ret, ret)) sc_in(ctf_integer_hex(unsigned long, addr, addr)) sc_in(ctf_integer(size_t, len, len)) +#ifdef CONFIG_LTTNG_EXPERIMENTAL_BITWISE_ENUM + /* + * Use a custom field here so that tracer writes a single + * integer and the work of splitting it up in two fields is + * left to the trace reader. + */ sc_in(ctf_enum(lttng_mmap_protection, int, prot, prot)) sc_in( ctf_custom_field( @@ -140,6 +146,10 @@ SC_LTTNG_TRACEPOINT_EVENT(mmap, ) ) ) +#else + sc_in(ctf_integer(int, prot, prot)) + sc_in(ctf_integer(int, flags, flags)) +#endif /* CONFIG_LTTNG_EXPERIMENTAL_BITWISE_ENUM */ sc_in(ctf_integer(int, fd, fd)) sc_in(ctf_integer(off_t, offset, off)) ) -- 2.34.1