#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
)
#define LTTNG_MMAP_FLAGS_TYPE \
-{ \
- .name = "type", \
- .type = { \
- .atype = atype_enum_nestable, \
- .u = { \
- .enum_nestable = { \
- .desc = &__enum_lttng_mmap_flags_mapping_type, \
- .container_type = __LTTNG_COMPOUND_LITERAL( \
- struct lttng_type, __type_integer(uint32_t, \
- 4, 1, -1, __BYTE_ORDER, 16, none)), \
- }, \
- }, \
- }, \
-}
+ lttng_kernel_static_event_field("type", \
+ lttng_kernel_static_type_enum(&__enum_lttng_mmap_flags_mapping_type, \
+ lttng_kernel_static_type_integer(4, 1, 0, __BYTE_ORDER, 16)), \
+ false, false)
#define LTTNG_MMAP_FLAGS_OPTIONS \
-{ \
- .name = "options", \
- .type = { \
- .atype = atype_enum_nestable, \
- .u = { \
- .enum_nestable = { \
- .desc = &__enum_lttng_mmap_flags_options, \
- .container_type = __LTTNG_COMPOUND_LITERAL( \
- struct lttng_type, __type_integer(uint32_t, \
- 28, 1, -1, __BYTE_ORDER, 16, none)),\
- }, \
- }, \
- }, \
-}
+ lttng_kernel_static_event_field("options", \
+ lttng_kernel_static_type_enum(&__enum_lttng_mmap_flags_options, \
+ lttng_kernel_static_type_integer(28, 1, 0, __BYTE_ORDER, 16)), \
+ false, false)
#if (__BYTE_ORDER == __LITTLE_ENDIAN)
#define LTTNG_MMAP_FLAGS \
+lttng_kernel_static_event_field_array( \
[0] = LTTNG_MMAP_FLAGS_TYPE, \
- [1] = LTTNG_MMAP_FLAGS_OPTIONS,
-
+ [1] = LTTNG_MMAP_FLAGS_OPTIONS, \
+)
#else
#define LTTNG_MMAP_FLAGS \
+lttng_kernel_static_event_field_array( \
[0] = LTTNG_MMAP_FLAGS_OPTIONS, \
- [1] = LTTNG_MMAP_FLAGS_TYPE,
+ [1] = LTTNG_MMAP_FLAGS_TYPE, \
+)
#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,
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(
ctf_custom_type(
- {
- .atype = atype_struct_nestable,
- .u.struct_nestable.nr_fields = 2,
- .u.struct_nestable.fields =
- __LTTNG_COMPOUND_LITERAL(struct lttng_event_field,
- LTTNG_MMAP_FLAGS
- ),
- .u.struct_nestable.alignment = lttng_alignof(uint32_t) * CHAR_BIT,
- }
+ lttng_kernel_static_type_struct(2, LTTNG_MMAP_FLAGS, lttng_alignof(uint32_t) * CHAR_BIT)
),
flags,
ctf_custom_code(
)
)
)
+#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))
)
)
+#ifdef CONFIG_LTTNG_EXPERIMENTAL_BITWISE_ENUM
/*
* Enumeration of the open flags, as described in the 'open'
* system call man page.
sc_in(ctf_enum(lttng_fcntl_cmd_flags, unsigned int, cmd, cmd))
sc_inout(ctf_integer(unsigned long, arg, arg)))
)
+#endif /* CONFIG_LTTNG_EXPERIMENTAL_BITWISE_ENUM */
#endif /* CREATE_SYSCALL_TABLE */