static const struct lttng_kernel_event_field *tcpfields[] = {
[0] = lttng_kernel_static_event_field("source_port",
lttng_kernel_static_type_integer_from_type(uint16_t, __BIG_ENDIAN, 10),
- false, false, false),
+ false, false),
[1] = lttng_kernel_static_event_field("dest_port",
lttng_kernel_static_type_integer_from_type(uint16_t, __BIG_ENDIAN, 10),
- false, false, false),
+ false, false),
[2] = lttng_kernel_static_event_field("seq",
lttng_kernel_static_type_integer_from_type(uint32_t, __BIG_ENDIAN, 10),
- false, false, false),
+ false, false),
[3] = lttng_kernel_static_event_field("ack_seq",
lttng_kernel_static_type_integer_from_type(uint32_t, __BIG_ENDIAN, 10),
- false, false, false),
+ false, false),
[4] = lttng_kernel_static_event_field("data_offset",
lttng_kernel_static_type_integer(4, 4, 0, __BIG_ENDIAN, 10),
- false, false, false),
+ false, false),
[5] = lttng_kernel_static_event_field("reserved",
lttng_kernel_static_type_integer(3, 1, 0, __BIG_ENDIAN, 10),
- false, false, false),
+ false, false),
[6] = lttng_kernel_static_event_field("flags",
lttng_kernel_static_type_integer(9, 1, 0, __BIG_ENDIAN, 16),
- false, false, false),
+ false, false),
[7] = lttng_kernel_static_event_field("window_size",
lttng_kernel_static_type_integer_from_type(uint16_t, __BIG_ENDIAN, 10),
- false, false, false),
+ false, false),
[8] = lttng_kernel_static_event_field("checksum",
lttng_kernel_static_type_integer_from_type(uint16_t, __BIG_ENDIAN, 16),
- false, false, false),
+ false, false),
[9] = lttng_kernel_static_event_field("urg_ptr",
lttng_kernel_static_type_integer_from_type(uint16_t, __BIG_ENDIAN, 10),
- false, false, false),
+ false, false),
};
static const struct lttng_kernel_event_field *udpfields[] = {
[0] = lttng_kernel_static_event_field("source_port",
lttng_kernel_static_type_integer_from_type(uint16_t, __BIG_ENDIAN, 10),
- false, false, false),
+ false, false),
[1] = lttng_kernel_static_event_field("dest_port",
lttng_kernel_static_type_integer_from_type(uint16_t, __BIG_ENDIAN, 10),
- false, false, false),
+ false, false),
[2] = lttng_kernel_static_event_field("len",
lttng_kernel_static_type_integer_from_type(uint16_t, __BIG_ENDIAN, 10),
- false, false, false),
+ false, false),
[3] = lttng_kernel_static_event_field("check",
lttng_kernel_static_type_integer_from_type(uint16_t, __BIG_ENDIAN, 10),
- false, false, false),
+ false, false),
};
static const struct lttng_kernel_event_field *icmpfields[] = {
[0] = lttng_kernel_static_event_field("type",
lttng_kernel_static_type_integer_from_type(uint8_t, __BIG_ENDIAN, 10),
- false, false, false),
+ false, false),
[1] = lttng_kernel_static_event_field("code",
lttng_kernel_static_type_integer_from_type(uint8_t, __BIG_ENDIAN, 10),
- false, false, false),
+ false, false),
[2] = lttng_kernel_static_event_field("checksum",
lttng_kernel_static_type_integer_from_type(uint16_t, __BIG_ENDIAN, 10),
- false, false, false),
+ false, false),
[3] = lttng_kernel_static_event_field("gateway",
lttng_kernel_static_type_integer_from_type(uint32_t, __BIG_ENDIAN, 10),
- false, false, false),
+ false, false),
};
static const struct lttng_kernel_event_field *transport_fields[] = {
[0] = lttng_kernel_static_event_field("unknown",
lttng_kernel_static_type_struct(ARRAY_SIZE(emptyfields), emptyfields, 0),
- false, false, true),
+ false, true),
[1] = lttng_kernel_static_event_field("tcp",
lttng_kernel_static_type_struct(ARRAY_SIZE(tcpfields), tcpfields, 0),
- false, false, true),
+ false, true),
[2] = lttng_kernel_static_event_field("udp",
lttng_kernel_static_type_struct(ARRAY_SIZE(udpfields), udpfields, 0),
- false, false, true),
+ false, true),
[3] = lttng_kernel_static_event_field("icmp",
lttng_kernel_static_type_struct(ARRAY_SIZE(icmpfields), icmpfields, 0),
- false, false, true),
+ false, true),
};
#endif /* LTTNG_CREATE_FIELD_METADATA */
static const struct lttng_kernel_event_field *ipv4fields[] = {
[0] = lttng_kernel_static_event_field("version",
lttng_kernel_static_type_integer(4, 4, 0, __BIG_ENDIAN, 10),
- false, false, false),
+ false, false),
[1] = lttng_kernel_static_event_field("ihl",
lttng_kernel_static_type_integer(4, 4, 0, __BIG_ENDIAN, 10),
- false, false, false),
+ false, false),
[2] = lttng_kernel_static_event_field("tos",
lttng_kernel_static_type_integer_from_type(uint8_t, __BIG_ENDIAN, 10),
- false, false, false),
+ false, false),
[3] = lttng_kernel_static_event_field("tot_len",
lttng_kernel_static_type_integer_from_type(uint16_t, __BIG_ENDIAN, 10),
- false, false, false),
+ false, false),
[4] = lttng_kernel_static_event_field("id",
lttng_kernel_static_type_integer_from_type(uint16_t, __BIG_ENDIAN, 16),
- false, false, false),
+ false, false),
[5] = lttng_kernel_static_event_field("frag_off",
lttng_kernel_static_type_integer_from_type(uint16_t, __BIG_ENDIAN, 10),
- false, false, false),
+ false, false),
[6] = lttng_kernel_static_event_field("ttl",
lttng_kernel_static_type_integer_from_type(uint8_t, __BIG_ENDIAN, 10),
- false, false, false),
+ false, false),
[7] = lttng_kernel_static_event_field("protocol",
lttng_kernel_static_type_enum(&__enum_proto_transport_header_type,
lttng_kernel_static_type_integer_from_type(uint8_t, __BIG_ENDIAN, 10)),
- false, false, false),
+ false, false),
[8] = lttng_kernel_static_event_field("checksum",
lttng_kernel_static_type_integer_from_type(uint16_t, __BIG_ENDIAN, 16),
- false, false, false),
+ false, false),
[9] = lttng_kernel_static_event_field("saddr",
lttng_kernel_static_type_array(4,
lttng_kernel_static_type_integer_from_type(uint8_t, __BIG_ENDIAN, 10),
lttng_alignof(uint8_t), none),
- false, false, false),
+ false, false),
[10] = lttng_kernel_static_event_field("daddr",
lttng_kernel_static_type_array(4,
lttng_kernel_static_type_integer_from_type(uint8_t, __BIG_ENDIAN, 10),
lttng_alignof(uint8_t), none),
- false, false, false),
+ false, false),
[11] = lttng_kernel_static_event_field("transport_header_type",
lttng_kernel_static_type_enum(&__enum_transport_header_type,
lttng_kernel_static_type_integer_from_type(uint8_t, __BYTE_ORDER, 10)),
- false, false, false),
+ false, false),
[12] = lttng_kernel_static_event_field("transport_header",
lttng_kernel_static_type_variant(ARRAY_SIZE(transport_fields), transport_fields,
NULL, 0), /* Previous field as tag. */
- false, false, false),
+ false, false),
};
static const struct lttng_kernel_event_field *ipv6fields[] = {
[0] = lttng_kernel_static_event_field("version",
lttng_kernel_static_type_integer(4, 4, 0, __BIG_ENDIAN, 10),
- false, false, false),
+ false, false),
[1] = lttng_kernel_static_event_field("prio",
lttng_kernel_static_type_integer(4, 4, 0, __BIG_ENDIAN, 10),
- false, false, false),
+ false, false),
[2] = lttng_kernel_static_event_field("flow_lbl",
lttng_kernel_static_type_array(3, lttng_kernel_static_type_integer_from_type(uint8_t, __BIG_ENDIAN, 16), lttng_alignof(uint8_t), none),
- false, false, false),
+ false, false),
[3] = lttng_kernel_static_event_field("payload_len",
lttng_kernel_static_type_integer_from_type(uint16_t, __BIG_ENDIAN, 10),
- false, false, false),
+ false, false),
[4] = lttng_kernel_static_event_field("nexthdr",
lttng_kernel_static_type_enum(&__enum_proto_transport_header_type,
lttng_kernel_static_type_integer_from_type(uint8_t, __BIG_ENDIAN, 10)),
- false, false, false),
+ false, false),
[5] = lttng_kernel_static_event_field("hop_limit",
lttng_kernel_static_type_integer_from_type(uint8_t, __BIG_ENDIAN, 10),
- false, false, false),
+ false, false),
[6] = lttng_kernel_static_event_field("saddr",
lttng_kernel_static_type_array(8, lttng_kernel_static_type_integer_from_type(uint16_t, __BIG_ENDIAN, 16), lttng_alignof(uint16_t), none),
- false, false, false),
+ false, false),
[7] = lttng_kernel_static_event_field("daddr",
lttng_kernel_static_type_array(8, lttng_kernel_static_type_integer_from_type(uint16_t, __BIG_ENDIAN, 16), lttng_alignof(uint16_t), none),
- false, false, false),
+ false, false),
[8] = lttng_kernel_static_event_field("transport_header_type",
lttng_kernel_static_type_enum(&__enum_transport_header_type,
lttng_kernel_static_type_integer_from_type(uint8_t, __BYTE_ORDER, 10)),
- false, false, false),
+ false, false),
[9] = lttng_kernel_static_event_field("transport_header",
lttng_kernel_static_type_variant(ARRAY_SIZE(transport_fields),
transport_fields, NULL, 0), /* Previous field as tag. */
- false, false, false),
+ false, false),
};
static const struct lttng_kernel_event_field *network_fields[] = {
[0] = lttng_kernel_static_event_field("unknown",
lttng_kernel_static_type_struct(0, emptyfields, 0),
- false, false, false),
+ false, false),
[1] = lttng_kernel_static_event_field("ipv4",
lttng_kernel_static_type_struct(ARRAY_SIZE(ipv4fields), ipv4fields, 0),
- false, false, false),
+ false, false),
[2] = lttng_kernel_static_event_field("ipv6",
lttng_kernel_static_type_struct(ARRAY_SIZE(ipv6fields), ipv6fields, 0),
- false, false, false),
+ false, false),
};
#endif /* LTTNG_CREATE_FIELD_METADATA */
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, false)
+ false, false)
#define LTTNG_MMAP_FLAGS_OPTIONS \
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, false)
+ false, false)
#if (__BYTE_ORDER == __LITTLE_ENDIAN)
#define LTTNG_MMAP_FLAGS \
lttng_kernel_static_type_enum(&__enum_lttng_clone_exit_signal_flags, \
lttng_kernel_static_type_integer(CLONE_EXIT_SIGNAL_FLAG_RESERVED_BITS, \
1, 0, __BYTE_ORDER, 16)), \
- false, false, false)
+ false, false)
#define LTTNG_CLONE_FLAGS_OPTIONS \
lttng_kernel_static_event_field("options", \
lttng_kernel_static_type_integer( \
sizeof(unsigned long) * CHAR_BIT - CLONE_EXIT_SIGNAL_FLAG_RESERVED_BITS, \
1, 0, __BYTE_ORDER, 16)), \
- false, false, false)
+ false, false)
#if (__BYTE_ORDER == __LITTLE_ENDIAN)
#define LTTNG_CLONE_FLAGS \
static const struct lttng_kernel_event_field *lttng_pollfd_flag_fields[] = {
[ilog2(POLLIN)] = lttng_kernel_static_event_field("POLLIN",
lttng_kernel_static_type_integer(1, 1, 0, __LITTLE_ENDIAN, 10),
- false, false, false),
+ false, false),
[ilog2(POLLPRI)] = lttng_kernel_static_event_field("POLLPRI",
lttng_kernel_static_type_integer(1, 1, 0, __LITTLE_ENDIAN, 10),
- false, false, false),
+ false, false),
[ilog2(POLLOUT)] = lttng_kernel_static_event_field("POLLOUT",
lttng_kernel_static_type_integer(1, 1, 0, __LITTLE_ENDIAN, 10),
- false, false, false),
+ false, false),
[ilog2(POLLERR)] = lttng_kernel_static_event_field("POLLERR",
lttng_kernel_static_type_integer(1, 1, 0, __LITTLE_ENDIAN, 10),
- false, false, false),
+ false, false),
[ilog2(POLLHUP)] = lttng_kernel_static_event_field("POLLHUP",
lttng_kernel_static_type_integer(1, 1, 0, __LITTLE_ENDIAN, 10),
- false, false, false),
+ false, false),
[ilog2(POLLNVAL)] = lttng_kernel_static_event_field("POLLNVAL",
lttng_kernel_static_type_integer(1, 1, 0, __LITTLE_ENDIAN, 10),
- false, false, false),
+ false, false),
[ilog2(LTTNG_POLL_NRFLAGS)] = lttng_kernel_static_event_field("padding",
lttng_kernel_static_type_integer(POLL_FLAGS_PADDING_SIZE, 1, 0, __LITTLE_ENDIAN, 10),
- false, false, false),
+ false, false),
};
static_assert(((ARRAY_SIZE(lttng_pollfd_flag_fields) - 1) + POLL_FLAGS_PADDING_SIZE) == sizeof(uint8_t) * BITS_PER_BYTE);
#ifndef LTTNG_TRACEPOINT_TYPE_EXTERN
static const struct lttng_kernel_event_field *lttng_pollfd_fields[] = {
[0] = lttng_kernel_static_event_field("fd", lttng_kernel_static_type_integer_from_type(int, __BYTE_ORDER, 10),
- false, false, false),
+ false, false),
[1] = lttng_kernel_static_event_field("raw_events", lttng_kernel_static_type_integer_from_type(uint16_t, __BYTE_ORDER, 16),
- false, false, false),
+ false, false),
[2] = lttng_kernel_static_event_field("events",
(const struct lttng_kernel_type_common *) <tng_pollfd_flag_fields_struct,
- false, false, false),
+ false, false),
};
#endif /* LTTNG_TRACEPOINT_TYPE_EXTERN */
/* 0x0001 */
[ilog2(POLLIN)] = lttng_kernel_static_event_field("EPOLLIN",
lttng_kernel_static_type_integer(1, 1, 0, __LITTLE_ENDIAN, 10),
- false, false, false),
+ false, false),
/* 0x0002 */
[ilog2(POLLPRI)] = lttng_kernel_static_event_field("EPOLLPRI",
lttng_kernel_static_type_integer(1, 1, 0, __LITTLE_ENDIAN, 10),
- false, false, false),
+ false, false),
/* 0x0004 */
[ilog2(POLLOUT)] = lttng_kernel_static_event_field("EPOLLOUT",
lttng_kernel_static_type_integer(1, 1, 0, __LITTLE_ENDIAN, 10),
- false, false, false),
+ false, false),
/* 0x0008 */
[ilog2(POLLERR)] = lttng_kernel_static_event_field("EPOLLERR",
lttng_kernel_static_type_integer(1, 1, 0, __LITTLE_ENDIAN, 10),
- false, false, false),
+ false, false),
/* 0x0010 */
[ilog2(POLLHUP)] = lttng_kernel_static_event_field("EPOLLHUP",
lttng_kernel_static_type_integer(1, 1, 0, __LITTLE_ENDIAN, 10),
- false, false, false),
+ false, false),
[ilog2(LTTNG_EPOLL_NRFLAGS)] = lttng_kernel_static_event_field("padding",
lttng_kernel_static_type_integer(EPOLL_FLAGS_PADDING_SIZE, 1, 0, __LITTLE_ENDIAN, 10),
- false, false, false),
+ false, false),
};
#endif /* LTTNG_TRACEPOINT_TYPE_EXTERN */
static const struct lttng_kernel_event_field *lttng_epoll_data_fields[] = {
[0] = lttng_kernel_static_event_field("u64",
lttng_kernel_static_type_integer_from_type(uint64_t, __BYTE_ORDER, 16),
- false, false, false),
+ false, false),
[1] = lttng_kernel_static_event_field("fd",
lttng_kernel_static_type_integer_from_type(int, __BYTE_ORDER, 10),
- false, false, false),
+ false, false),
};
#endif /* LTTNG_TRACEPOINT_TYPE_EXTERN */
static const struct lttng_kernel_event_field *epoll_ctl_fields[] = {
[0] = lttng_kernel_static_event_field("data_union",
(const struct lttng_kernel_type_common *) <tng_epoll_data_fields_struct,
- false, false, false),
+ false, false),
[1] = lttng_kernel_static_event_field("raw_events",
lttng_kernel_static_type_integer_from_type(uint32_t, __BYTE_ORDER, 16),
- false, false, false),
+ false, false),
[2] = lttng_kernel_static_event_field("events",
(const struct lttng_kernel_type_common *) <tng_epoll_ctl_events_fields_struct,
- false, false, false),
+ false, false),
};
#endif /* LTTNG_TRACEPOINT_TYPE_EXTERN */
static const struct lttng_kernel_event_field *lttng_epoll_wait_fields[] = lttng_kernel_static_event_field_array(
[0] = lttng_kernel_static_event_field("data_union",
(const struct lttng_kernel_type_common *) <tng_epoll_data_fields_struct,
- false, false, false),
+ false, false),
[1] = lttng_kernel_static_event_field("raw_events", lttng_kernel_static_type_integer_from_type(uint32_t, __BYTE_ORDER, 16),
- false, false, false),
+ false, false),
[2] = lttng_kernel_static_event_field("events",
(const struct lttng_kernel_type_common *) <tng_epoll_ctl_events_fields_struct,
- false, false, false),
+ false, false),
);
static_assert(((ARRAY_SIZE(lttng_epoll_ctl_events_fields) - 1) + EPOLL_FLAGS_PADDING_SIZE) == sizeof(uint8_t) * BITS_PER_BYTE);
unsigned int size; /* in bits */
unsigned short alignment; /* in bits */
unsigned int signedness:1,
- reverse_byte_order:1;
+ reverse_byte_order:1,
+ user:1; /* fetch from user-space */
unsigned int base; /* 2, 8, 10, 16, for pretty print */
};
struct lttng_kernel_type_string {
struct lttng_kernel_type_common parent;
enum lttng_kernel_string_encoding encoding;
+ unsigned int user:1; /* fetch from user-space */
};
struct lttng_kernel_type_enum {
const char *name;
const struct lttng_kernel_type_common *type;
unsigned int nowrite:1, /* do not write into trace */
- user:1, /* fetch from user-space */
nofilter:1; /* do not consider for filter */
};
#define PARAMS(args...) args
#endif
-#define lttng_kernel_static_type_integer(_size, _alignment, _signedness, _byte_order, _base) \
+#define _lttng_kernel_static_type_integer(_size, _alignment, _signedness, _byte_order, _user, _base) \
((const struct lttng_kernel_type_common *) __LTTNG_COMPOUND_LITERAL(const struct lttng_kernel_type_integer, { \
.parent = { \
.type = lttng_kernel_type_integer, \
.alignment = (_alignment), \
.signedness = (_signedness), \
.reverse_byte_order = (_byte_order) != __BYTE_ORDER, \
+ .user = (_user), \
.base = (_base), \
}))
-#define lttng_kernel_static_type_integer_from_type(_type, _byte_order, _base) \
+#define lttng_kernel_static_type_integer(_size, _alignment, _signedness, _byte_order, _base) \
+ _lttng_kernel_static_type_integer(_size, _alignment, _signedness, _byte_order, 0, _base)
+
+#define lttng_kernel_static_type_user_integer(_size, _alignment, _signedness, _byte_order, _base) \
+ _lttng_kernel_static_type_integer(_size, _alignment, _signedness, _byte_order, 1, _base)
+
+#define _lttng_kernel_static_type_integer_from_type(_type, _byte_order, _user, _base) \
lttng_kernel_static_type_integer(sizeof(_type) * CHAR_BIT, \
lttng_alignof(_type) * CHAR_BIT, \
lttng_is_signed_type(_type), \
_byte_order, \
_base)
+#define lttng_kernel_static_type_integer_from_type(_type, _byte_order, _base) \
+ _lttng_kernel_static_type_integer_from_type(_type, _byte_order, 0, _base)
+
+#define lttng_kernel_static_type_user_integer_from_type(_type, _byte_order, _base) \
+ _lttng_kernel_static_type_integer_from_type(_type, _byte_order, 1, _base)
+
#define lttng_kernel_static_type_enum(_desc, _container_type) \
((const struct lttng_kernel_type_common *) __LTTNG_COMPOUND_LITERAL(const struct lttng_kernel_type_enum, { \
.parent = { \
.elem_type = (_elem_type), \
}))
-#define lttng_kernel_static_type_string(_encoding) \
+#define lttng_kernel_static_type_string(_encoding, _user) \
((const struct lttng_kernel_type_common *) __LTTNG_COMPOUND_LITERAL(const struct lttng_kernel_type_string, { \
.parent = { \
.type = lttng_kernel_type_string, \
}, \
.encoding = lttng_kernel_string_encoding_##_encoding, \
+ .user = (_user), \
}))
#define lttng_kernel_static_type_struct_init(_nr_fields, _fields, _alignment) \
.alignment = (_alignment), \
}))
-#define lttng_kernel_static_event_field(_name, _type, _nowrite, _user, _nofilter) \
+#define lttng_kernel_static_event_field(_name, _type, _nowrite, _nofilter) \
__LTTNG_COMPOUND_LITERAL(const struct lttng_kernel_event_field, { \
.name = (_name), \
.type = (_type), \
.nowrite = (_nowrite), \
- .user = (_user), \
.nofilter = (_nofilter), \
})
#undef _ctf_integer_ext
#define _ctf_integer_ext(_type, _item, _src, _byte_order, _base, _user, _nowrite) \
lttng_kernel_static_event_field(#_item, \
- lttng_kernel_static_type_integer_from_type(_type, _byte_order, _base), \
- _nowrite, _user, 0),
+ _lttng_kernel_static_type_integer_from_type(_type, _byte_order, _user, _base), \
+ _nowrite, 0),
#undef _ctf_array_encoded
#define _ctf_array_encoded(_type, _item, _src, _length, \
_encoding, _byte_order, _elem_type_base, _user, _nowrite) \
lttng_kernel_static_event_field(#_item, \
lttng_kernel_static_type_array(_length, \
- lttng_kernel_static_type_integer_from_type(_type, _byte_order, _elem_type_base), \
+ _lttng_kernel_static_type_integer_from_type(_type, _byte_order, _user, _elem_type_base), \
0, \
_encoding), \
- _nowrite, _user, 0),
+ _nowrite, 0),
#undef _ctf_array_bitfield
#define _ctf_array_bitfield(_type, _item, _src, _length, _user, _nowrite) \
lttng_kernel_static_event_field(#_item, \
lttng_kernel_static_type_array((_length) * sizeof(_type) * CHAR_BIT, \
- lttng_kernel_static_type_integer(1, 1, 0, __LITTLE_ENDIAN, 10), \
+ _lttng_kernel_static_type_integer(1, 1, 0, __LITTLE_ENDIAN, _user, 10), \
lttng_alignof(_type), \
none), \
- _nowrite, _user, 0),
+ _nowrite, 0),
#undef _ctf_sequence_encoded
#define _ctf_sequence_encoded(_type, _item, _src, \
_byte_order, _elem_type_base, _user, _nowrite) \
lttng_kernel_static_event_field("_" #_item "_length", \
lttng_kernel_static_type_integer_from_type(_length_type, __BYTE_ORDER, 10), \
- _nowrite, 0, 1), \
+ _nowrite, 1), \
lttng_kernel_static_event_field(#_item, \
lttng_kernel_static_type_sequence(NULL, /* Use previous field. */ \
- lttng_kernel_static_type_integer_from_type(_type, _byte_order, _elem_type_base), \
+ _lttng_kernel_static_type_integer_from_type(_type, _byte_order, _user, _elem_type_base), \
0, \
_encoding), \
- _nowrite, _user, 0),
+ _nowrite, 0),
#undef _ctf_sequence_bitfield
#define _ctf_sequence_bitfield(_type, _item, _src, \
_user, _nowrite) \
lttng_kernel_static_event_field("_" #_item "_length", \
lttng_kernel_static_type_integer_from_type(_length_type, __BYTE_ORDER, 10), \
- _nowrite, 0, 1), \
+ _nowrite, 1), \
lttng_kernel_static_event_field(#_item, \
lttng_kernel_static_type_sequence(NULL, /* Use previous field. */ \
- lttng_kernel_static_type_integer(1, 1, 0, __LITTLE_ENDIAN, 10), \
+ _lttng_kernel_static_type_integer(1, 1, 0, __LITTLE_ENDIAN, _user, 10), \
lttng_alignof(_type), \
none), \
- _nowrite, _user, 0),
+ _nowrite, 0),
#undef _ctf_string
#define _ctf_string(_item, _src, _user, _nowrite) \
lttng_kernel_static_event_field(#_item, \
- lttng_kernel_static_type_string(UTF8), \
- _nowrite, _user, 0),
+ lttng_kernel_static_type_string(UTF8, _user), \
+ _nowrite, 0),
#undef _ctf_unused
#define _ctf_unused(_src)
#define _ctf_enum(_name, _type, _item, _src, _user, _nowrite) \
lttng_kernel_static_event_field(#_item, \
lttng_kernel_static_type_enum(&__enum_##_name, \
- lttng_kernel_static_type_integer_from_type(_type, __BYTE_ORDER, 10)), \
- _nowrite, _user, 0),
+ _lttng_kernel_static_type_integer_from_type(_type, __BYTE_ORDER, _user, 10)), \
+ _nowrite, 0),
#undef ctf_custom_field
#define ctf_custom_field(_type, _item, _code) \
- lttng_kernel_static_event_field(#_item, PARAMS(_type), 0, 0, 1),
+ lttng_kernel_static_event_field(#_item, PARAMS(_type), 0, 1),
#undef ctf_custom_type
#define ctf_custom_type(...) __VA_ARGS__
{
const struct lttng_kernel_type_array *array_type = lttng_kernel_get_type_array(field->type);
const struct lttng_kernel_type_common *elem_type = array_type->elem_type;
+ const struct lttng_kernel_type_integer *elem_integer_type;
if (!lttng_kernel_type_is_bytewise_integer(elem_type) || array_type->encoding == lttng_kernel_string_encoding_none)
return -EINVAL;
- if (field->user)
+ elem_integer_type = container_of(elem_type, const struct lttng_kernel_type_integer, parent);
+ if (elem_integer_type->user)
op->op = BYTECODE_OP_LOAD_FIELD_REF_USER_SEQUENCE;
else
op->op = BYTECODE_OP_LOAD_FIELD_REF_SEQUENCE;
{
const struct lttng_kernel_type_sequence *sequence_type = lttng_kernel_get_type_sequence(field->type);
const struct lttng_kernel_type_common *elem_type = sequence_type->elem_type;
+ const struct lttng_kernel_type_integer *elem_integer_type;
if (!lttng_kernel_type_is_bytewise_integer(elem_type) || sequence_type->encoding == lttng_kernel_string_encoding_none)
return -EINVAL;
- if (field->user)
+ elem_integer_type = container_of(elem_type, const struct lttng_kernel_type_integer, parent);
+ if (elem_integer_type->user)
op->op = BYTECODE_OP_LOAD_FIELD_REF_USER_SEQUENCE;
else
op->op = BYTECODE_OP_LOAD_FIELD_REF_SEQUENCE;
break;
}
case lttng_kernel_type_string:
- if (field->user)
+ {
+ const struct lttng_kernel_type_string *string_type = lttng_kernel_get_type_string(field->type);
+
+ if (string_type->user)
op->op = BYTECODE_OP_LOAD_FIELD_REF_USER_STRING;
else
op->op = BYTECODE_OP_LOAD_FIELD_REF_STRING;
break;
+ }
case lttng_kernel_type_struct: /* Unsupported. */
case lttng_kernel_type_variant: /* Unsupported. */
default:
break;
/* Sequence and array supported as string */
case lttng_kernel_type_string:
- BUG_ON(ctx_field->event_field->user);
+ {
+ const struct lttng_kernel_type_string *string_type = lttng_kernel_get_type_string(ctx_field->event_field->type);
+
+ BUG_ON(string_type->user);
op->op = BYTECODE_OP_GET_CONTEXT_REF_STRING;
break;
+ }
case lttng_kernel_type_array:
{
const struct lttng_kernel_type_array *array_type = lttng_kernel_get_type_array(ctx_field->event_field->type);
const struct lttng_kernel_type_common *elem_type = array_type->elem_type;
+ const struct lttng_kernel_type_integer *elem_integer_type;
if (!lttng_kernel_type_is_bytewise_integer(elem_type) || array_type->encoding == lttng_kernel_string_encoding_none)
return -EINVAL;
- BUG_ON(ctx_field->event_field->user);
+ elem_integer_type = container_of(elem_type, const struct lttng_kernel_type_integer, parent);
+ BUG_ON(elem_integer_type->user);
op->op = BYTECODE_OP_GET_CONTEXT_REF_STRING;
break;
}
{
const struct lttng_kernel_type_sequence *sequence_type = lttng_kernel_get_type_sequence(ctx_field->event_field->type);
const struct lttng_kernel_type_common *elem_type = sequence_type->elem_type;
+ const struct lttng_kernel_type_integer *elem_integer_type;
if (!lttng_kernel_type_is_bytewise_integer(elem_type) || sequence_type->encoding == lttng_kernel_string_encoding_none)
return -EINVAL;
- BUG_ON(ctx_field->event_field->user);
+ elem_integer_type = container_of(elem_type, const struct lttng_kernel_type_integer, parent);
+ BUG_ON(elem_integer_type->user);
op->op = BYTECODE_OP_GET_CONTEXT_REF_STRING;
break;
}
static const struct lttng_kernel_event_field *event_fields_kernel[NR_FIELDS] = {
lttng_kernel_static_event_field("_callstack_kernel_length",
lttng_kernel_static_type_integer_from_type(unsigned int, __BYTE_ORDER, 10),
- false, false, false),
+ false, false),
lttng_kernel_static_event_field("callstack_kernel",
lttng_kernel_static_type_sequence(NULL,
lttng_kernel_static_type_integer_from_type(unsigned long, __BYTE_ORDER, 16),
0, none),
- false, false, false),
+ false, false),
};
static const struct lttng_kernel_event_field *event_fields_user[NR_FIELDS] = {
lttng_kernel_static_event_field("_callstack_user_length",
lttng_kernel_static_type_integer_from_type(unsigned int, __BYTE_ORDER, 10),
- false, false, false),
+ false, false),
lttng_kernel_static_event_field("callstack_user",
lttng_kernel_static_type_sequence(NULL,
lttng_kernel_static_type_integer_from_type(unsigned long, __BYTE_ORDER, 16),
0, none),
- false, false, false),
+ false, false),
};
const struct lttng_kernel_event_field **lttng_cs_event_fields(enum lttng_cs_ctx_modes mode)
static const struct lttng_kernel_ctx_field *ctx_field = lttng_kernel_static_ctx_field(
lttng_kernel_static_event_field("cgroup_ns",
lttng_kernel_static_type_integer_from_type(unsigned int, __BYTE_ORDER, 10),
- false, false, false),
+ false, false),
cgroup_ns_get_size,
cgroup_ns_record,
cgroup_ns_get_value,
static const struct lttng_kernel_ctx_field *ctx_field = lttng_kernel_static_ctx_field(
lttng_kernel_static_event_field("cpu_id",
lttng_kernel_static_type_integer_from_type(int, __BYTE_ORDER, 10),
- false, false, false),
+ false, false),
cpu_id_get_size,
cpu_id_record,
cpu_id_get_value,
static const struct lttng_kernel_ctx_field *ctx_field = lttng_kernel_static_ctx_field(
lttng_kernel_static_event_field("egid",
lttng_kernel_static_type_integer_from_type(gid_t, __BYTE_ORDER, 10),
- false, false, false),
+ false, false),
egid_get_size,
egid_record,
egid_get_value,
static const struct lttng_kernel_ctx_field *ctx_field = lttng_kernel_static_ctx_field(
lttng_kernel_static_event_field("euid",
lttng_kernel_static_type_integer_from_type(uid_t, __BYTE_ORDER, 10),
- false, false, false),
+ false, false),
euid_get_size,
euid_record,
euid_get_value,
static const struct lttng_kernel_ctx_field *ctx_field = lttng_kernel_static_ctx_field(
lttng_kernel_static_event_field("gid",
lttng_kernel_static_type_integer_from_type(gid_t, __BYTE_ORDER, 10),
- false, false, false),
+ false, false),
gid_get_size,
gid_record,
gid_get_value,
static const struct lttng_kernel_ctx_field *ctx_field = lttng_kernel_static_ctx_field(
lttng_kernel_static_event_field("hostname",
lttng_kernel_static_type_array_text(LTTNG_HOSTNAME_CTX_LEN),
- false, false, false),
+ false, false),
hostname_get_size,
hostname_record,
hostname_get_value,
static const struct lttng_kernel_ctx_field *ctx_field = lttng_kernel_static_ctx_field(
lttng_kernel_static_event_field("interruptible",
lttng_kernel_static_type_integer_from_type(int8_t, __BYTE_ORDER, 10),
- false, false, false),
+ false, false),
interruptible_get_size,
interruptible_record,
interruptible_get_value,
static const struct lttng_kernel_ctx_field *ctx_field = lttng_kernel_static_ctx_field(
lttng_kernel_static_event_field("ipc_ns",
lttng_kernel_static_type_integer_from_type(unsigned int, __BYTE_ORDER, 10),
- false, false, false),
+ false, false),
ipc_ns_get_size,
ipc_ns_record,
ipc_ns_get_value,
static const struct lttng_kernel_ctx_field *ctx_field = lttng_kernel_static_ctx_field(
lttng_kernel_static_event_field("migratable",
lttng_kernel_static_type_integer_from_type(uint8_t, __BYTE_ORDER, 10),
- false, false, false),
+ false, false),
migratable_get_size,
migratable_record,
migratable_get_value,
static const struct lttng_kernel_ctx_field *ctx_field = lttng_kernel_static_ctx_field(
lttng_kernel_static_event_field("mnt_ns",
lttng_kernel_static_type_integer_from_type(unsigned int, __BYTE_ORDER, 10),
- false, false, false),
+ false, false),
mnt_ns_get_size,
mnt_ns_record,
mnt_ns_get_value,
static const struct lttng_kernel_ctx_field *ctx_field = lttng_kernel_static_ctx_field(
lttng_kernel_static_event_field("need_reschedule",
lttng_kernel_static_type_integer_from_type(uint8_t, __BYTE_ORDER, 10),
- false, false, false),
+ false, false),
need_reschedule_get_size,
need_reschedule_record,
need_reschedule_get_value,
static const struct lttng_kernel_ctx_field *ctx_field = lttng_kernel_static_ctx_field(
lttng_kernel_static_event_field("net_ns",
lttng_kernel_static_type_integer_from_type(unsigned int, __BYTE_ORDER, 10),
- false, false, false),
+ false, false),
net_ns_get_size,
net_ns_record,
net_ns_get_value,
static const struct lttng_kernel_ctx_field *ctx_field = lttng_kernel_static_ctx_field(
lttng_kernel_static_event_field("nice",
lttng_kernel_static_type_integer_from_type(int, __BYTE_ORDER, 10),
- false, false, false),
+ false, false),
nice_get_size,
nice_record,
nice_get_value,
static const struct lttng_kernel_ctx_field *ctx_field = lttng_kernel_static_ctx_field(
lttng_kernel_static_event_field("pid_ns",
lttng_kernel_static_type_integer_from_type(unsigned int, __BYTE_ORDER, 10),
- false, false, false),
+ false, false),
pid_ns_get_size,
pid_ns_record,
pid_ns_get_value,
static const struct lttng_kernel_ctx_field *ctx_field = lttng_kernel_static_ctx_field(
lttng_kernel_static_event_field("pid",
lttng_kernel_static_type_integer_from_type(pid_t, __BYTE_ORDER, 10),
- false, false, false),
+ false, false),
pid_get_size,
pid_record,
pid_get_value,
static const struct lttng_kernel_ctx_field *ctx_field = lttng_kernel_static_ctx_field(
lttng_kernel_static_event_field("ppid",
lttng_kernel_static_type_integer_from_type(pid_t, __BYTE_ORDER, 10),
- false, false, false),
+ false, false),
ppid_get_size,
ppid_record,
ppid_get_value,
static const struct lttng_kernel_ctx_field *ctx_field = lttng_kernel_static_ctx_field(
lttng_kernel_static_event_field("preemptible",
lttng_kernel_static_type_integer_from_type(uint8_t, __BYTE_ORDER, 10),
- false, false, false),
+ false, false),
preemptible_get_size,
preemptible_record,
preemptible_get_value,
static const struct lttng_kernel_ctx_field *ctx_field = lttng_kernel_static_ctx_field(
lttng_kernel_static_event_field("prio",
lttng_kernel_static_type_integer_from_type(int, __BYTE_ORDER, 10),
- false, false, false),
+ false, false),
prio_get_size,
prio_record,
prio_get_value,
static const struct lttng_kernel_ctx_field *ctx_field = lttng_kernel_static_ctx_field(
lttng_kernel_static_event_field("procname",
lttng_kernel_static_type_array_text(sizeof(current->comm)),
- false, false, false),
+ false, false),
procname_get_size,
procname_record,
procname_get_value,
static const struct lttng_kernel_ctx_field *ctx_field = lttng_kernel_static_ctx_field(
lttng_kernel_static_event_field("sgid",
lttng_kernel_static_type_integer_from_type(gid_t, __BYTE_ORDER, 10),
- false, false, false),
+ false, false),
sgid_get_size,
sgid_record,
sgid_get_value,
static const struct lttng_kernel_ctx_field *ctx_field = lttng_kernel_static_ctx_field(
lttng_kernel_static_event_field("suid",
lttng_kernel_static_type_integer_from_type(uid_t, __BYTE_ORDER, 10),
- false, false, false),
+ false, false),
suid_get_size,
suid_record,
suid_get_value,
static const struct lttng_kernel_ctx_field *ctx_field = lttng_kernel_static_ctx_field(
lttng_kernel_static_event_field("tid",
lttng_kernel_static_type_integer_from_type(pid_t, __BYTE_ORDER, 10),
- false, false, false),
+ false, false),
tid_get_size,
tid_record,
tid_get_value,
static const struct lttng_kernel_ctx_field *ctx_field = lttng_kernel_static_ctx_field(
lttng_kernel_static_event_field("time_ns",
lttng_kernel_static_type_integer_from_type(unsigned int, __BYTE_ORDER, 10),
- false, false, false),
+ false, false),
time_ns_get_size,
time_ns_record,
time_ns_get_value,
static const struct lttng_kernel_ctx_field *ctx_field = lttng_kernel_static_ctx_field(
lttng_kernel_static_event_field("uid",
lttng_kernel_static_type_integer_from_type(uid_t, __BYTE_ORDER, 10),
- false, false, false),
+ false, false),
uid_get_size,
uid_record,
uid_get_value,
static const struct lttng_kernel_ctx_field *ctx_field = lttng_kernel_static_ctx_field(
lttng_kernel_static_event_field("user_ns",
lttng_kernel_static_type_integer_from_type(unsigned int, __BYTE_ORDER, 10),
- false, false, false),
+ false, false),
user_ns_get_size,
user_ns_record,
user_ns_get_value,
static const struct lttng_kernel_ctx_field *ctx_field = lttng_kernel_static_ctx_field(
lttng_kernel_static_event_field("uts_ns",
lttng_kernel_static_type_integer_from_type(unsigned int, __BYTE_ORDER, 10),
- false, false, false),
+ false, false),
uts_ns_get_size,
uts_ns_record,
uts_ns_get_value,
static const struct lttng_kernel_ctx_field *ctx_field = lttng_kernel_static_ctx_field(
lttng_kernel_static_event_field("vegid",
lttng_kernel_static_type_integer_from_type(gid_t, __BYTE_ORDER, 10),
- false, false, false),
+ false, false),
vegid_get_size,
vegid_record,
vegid_get_value,
static const struct lttng_kernel_ctx_field *ctx_field = lttng_kernel_static_ctx_field(
lttng_kernel_static_event_field("veuid",
lttng_kernel_static_type_integer_from_type(uid_t, __BYTE_ORDER, 10),
- false, false, false),
+ false, false),
veuid_get_size,
veuid_record,
veuid_get_value,
static const struct lttng_kernel_ctx_field *ctx_field = lttng_kernel_static_ctx_field(
lttng_kernel_static_event_field("vgid",
lttng_kernel_static_type_integer_from_type(gid_t, __BYTE_ORDER, 10),
- false, false, false),
+ false, false),
vgid_get_size,
vgid_record,
vgid_get_value,
static const struct lttng_kernel_ctx_field *ctx_field = lttng_kernel_static_ctx_field(
lttng_kernel_static_event_field("vpid",
lttng_kernel_static_type_integer_from_type(pid_t, __BYTE_ORDER, 10),
- false, false, false),
+ false, false),
vpid_get_size,
vpid_record,
vpid_get_value,
static const struct lttng_kernel_ctx_field *ctx_field = lttng_kernel_static_ctx_field(
lttng_kernel_static_event_field("vppid",
lttng_kernel_static_type_integer_from_type(pid_t, __BYTE_ORDER, 10),
- false, false, false),
+ false, false),
vppid_get_size,
vppid_record,
vppid_get_value,
static const struct lttng_kernel_ctx_field *ctx_field = lttng_kernel_static_ctx_field(
lttng_kernel_static_event_field("vsgid",
lttng_kernel_static_type_integer_from_type(gid_t, __BYTE_ORDER, 10),
- false, false, false),
+ false, false),
vsgid_get_size,
vsgid_record,
vsgid_get_value,
static const struct lttng_kernel_ctx_field *ctx_field = lttng_kernel_static_ctx_field(
lttng_kernel_static_event_field("vsuid",
lttng_kernel_static_type_integer_from_type(uid_t, __BYTE_ORDER, 10),
- false, false, false),
+ false, false),
vsuid_get_size,
vsuid_record,
vsuid_get_value,
static const struct lttng_kernel_ctx_field *ctx_field = lttng_kernel_static_ctx_field(
lttng_kernel_static_event_field("vtid",
lttng_kernel_static_type_integer_from_type(pid_t, __BYTE_ORDER, 10),
- false, false, false),
+ false, false),
vtid_get_size,
vtid_record,
vtid_get_value,
static const struct lttng_kernel_ctx_field *ctx_field = lttng_kernel_static_ctx_field(
lttng_kernel_static_event_field("vuid",
lttng_kernel_static_type_integer_from_type(uid_t, __BYTE_ORDER, 10),
- false, false, false),
+ false, false),
vuid_get_size,
vuid_record,
vuid_get_value,
static const struct lttng_kernel_event_field *event_fields[] = {
lttng_kernel_static_event_field("ip",
lttng_kernel_static_type_integer_from_type(unsigned long, __BYTE_ORDER, 16),
- false, false, false),
+ false, false),
};
static const struct lttng_kernel_tracepoint_class tp_class = {
static const struct lttng_kernel_event_field *event_fields[] = {
lttng_kernel_static_event_field("ip",
lttng_kernel_static_type_integer_from_type(unsigned long, __BYTE_ORDER, 16),
- false, false, false),
+ false, false),
lttng_kernel_static_event_field("parent_ip",
lttng_kernel_static_type_integer_from_type(unsigned long, __BYTE_ORDER, 16),
- false, false, false),
+ false, false),
};
static const struct lttng_kernel_tracepoint_class tp_class = {
static const struct lttng_kernel_event_field *event_fields[] = {
lttng_kernel_static_event_field("ip",
lttng_kernel_static_type_integer_from_type(unsigned long, __BYTE_ORDER, 16),
- false, false, false),
+ false, false),
};
static const struct lttng_kernel_tracepoint_class tp_class = {