#include <wrapper/rcu.h>
#include <lttng-events.h>
#include <lttng-tracer-core.h>
+#include <lttng-tp-mempool.h>
#define __LTTNG_NULL_STRING "(null)"
.string = (_string), \
},
+/* Enumeration entry (automatic value; follows the rules of CTF) */
+#undef ctf_enum_auto
+#define ctf_enum_auto(_string) \
+ { \
+ .start = { \
+ .signedness = -1, \
+ .value = -1, \
+ }, \
+ .end = { \
+ .signedness = -1, \
+ .value = -1, \
+ }, \
+ .string = (_string), \
+ .options = { \
+ .is_auto = 1, \
+ } \
+ },
+
#undef TP_ENUM_VALUES
#define TP_ENUM_VALUES(...) \
__VA_ARGS__
},
#undef _ctf_array_encoded
-#define _ctf_array_encoded(_type, _item, _src, _length, _encoding, _user, _nowrite) \
+#define _ctf_array_encoded(_type, _item, _src, _length, _encoding, _byte_order, _base, _user, _nowrite) \
{ \
.name = #_item, \
.type = \
{ \
.array = \
{ \
- .elem_type = __type_integer(_type, 0, 0, 0, __BYTE_ORDER, 10, _encoding), \
+ .elem_type = __type_integer(_type, 0, 0, 0, _byte_order, _base, _encoding), \
.length = _length, \
} \
} \
.name = #_item, \
.type = \
{ \
- .atype = atype_array, \
+ .atype = atype_array_bitfield, \
.u = \
{ \
.array = \
.name = #_item, \
.type = \
{ \
- .atype = atype_sequence, \
+ .atype = atype_sequence_bitfield, \
.u = \
{ \
.sequence = \
__event_len += sizeof(_type);
#undef _ctf_array_encoded
-#define _ctf_array_encoded(_type, _item, _src, _length, _encoding, _user, _nowrite) \
+#define _ctf_array_encoded(_type, _item, _src, _length, _encoding, _byte_order, _base, _user, _nowrite) \
__event_len += lib_ring_buffer_align(__event_len, lttng_alignof(_type)); \
__event_len += sizeof(_type) * (_length);
#undef _ctf_array_bitfield
#define _ctf_array_bitfield(_type, _item, _src, _length, _user, _nowrite) \
- _ctf_array_encoded(_type, _item, _src, _length, none, _user, _nowrite)
+ _ctf_array_encoded(_type, _item, _src, _length, none, __LITTLE_ENDIAN, 0, _user, _nowrite)
#undef _ctf_sequence_encoded
#define _ctf_sequence_encoded(_type, _item, _src, _length_type, \
_ctf_integer_ext_isuser##_user(_type, _item, _user_src, _byte_order, _base, _nowrite)
#undef _ctf_array_encoded
-#define _ctf_array_encoded(_type, _item, _src, _length, _encoding, _user, _nowrite) \
+#define _ctf_array_encoded(_type, _item, _src, _length, _encoding, _byte_order, _base, _user, _nowrite) \
{ \
unsigned long __ctf_tmp_ulong = (unsigned long) (_length); \
const void *__ctf_tmp_ptr = (_src); \
#undef _ctf_array_bitfield
#define _ctf_array_bitfield(_type, _item, _src, _length, _user, _nowrite) \
- _ctf_array_encoded(_type, _item, _src, _length, none, _user, _nowrite)
+ _ctf_array_encoded(_type, _item, _src, _length, none, __LITTLE_ENDIAN, 0, _user, _nowrite)
#undef _ctf_sequence_encoded
#define _ctf_sequence_encoded(_type, _item, _src, _length_type, \
__event_align = max_t(size_t, __event_align, lttng_alignof(_type));
#undef _ctf_array_encoded
-#define _ctf_array_encoded(_type, _item, _src, _length, _encoding, _user, _nowrite) \
+#define _ctf_array_encoded(_type, _item, _src, _length, _encoding, _byte_order, _base, _user, _nowrite) \
__event_align = max_t(size_t, __event_align, lttng_alignof(_type));
#undef _ctf_array_bitfield
#define _ctf_array_bitfield(_type, _item, _src, _length, _user, _nowrite) \
- _ctf_array_encoded(_type, _item, _src, _length, none, _user, _nowrite)
+ _ctf_array_encoded(_type, _item, _src, _length, none, __LITTLE_ENDIAN, 0, _user, _nowrite)
#undef _ctf_sequence_encoded
#define _ctf_sequence_encoded(_type, _item, _src, _length_type, \
_ctf_integer_ext_isuser##_user(_type, _item, _user_src, _byte_order, _base, _nowrite)
#undef _ctf_array_encoded
-#define _ctf_array_encoded(_type, _item, _src, _length, _encoding, _user, _nowrite) \
+#define _ctf_array_encoded(_type, _item, _src, _length, _encoding, _byte_order, _base, _user, _nowrite) \
lib_ring_buffer_align_ctx(&__ctx, lttng_alignof(_type)); \
if (_user) { \
__chan->ops->event_write_from_user(&__ctx, _src, sizeof(_type) * (_length)); \
struct lib_ring_buffer_ctx __ctx; \
ssize_t __event_len; \
size_t __event_align; \
- size_t __orig_dynamic_len_offset, __dynamic_len_idx; \
+ size_t __orig_dynamic_len_offset, __dynamic_len_idx __attribute__((unused)); \
union { \
size_t __dynamic_len_removed[ARRAY_SIZE(__event_fields___##_name)]; \
char __filter_stack_data[2 * sizeof(unsigned long) * ARRAY_SIZE(__event_fields___##_name)]; \
\
if (!_TP_SESSION_CHECK(session, __session)) \
return; \
- if (unlikely(!ACCESS_ONCE(__session->active))) \
+ if (unlikely(!READ_ONCE(__session->active))) \
return; \
- if (unlikely(!ACCESS_ONCE(__chan->enabled))) \
+ if (unlikely(!READ_ONCE(__chan->enabled))) \
return; \
- if (unlikely(!ACCESS_ONCE(__event->enabled))) \
+ if (unlikely(!READ_ONCE(__event->enabled))) \
return; \
__lpf = lttng_rcu_dereference(__session->pid_tracker); \
- if (__lpf && likely(!lttng_pid_tracker_lookup(__lpf, current->pid))) \
+ if (__lpf && likely(!lttng_pid_tracker_lookup(__lpf, current->tgid))) \
return; \
__orig_dynamic_len_offset = this_cpu_ptr(<tng_dynamic_len_stack)->offset; \
__dynamic_len_idx = __orig_dynamic_len_offset; \
struct lib_ring_buffer_ctx __ctx; \
ssize_t __event_len; \
size_t __event_align; \
- size_t __orig_dynamic_len_offset, __dynamic_len_idx; \
+ size_t __orig_dynamic_len_offset, __dynamic_len_idx __attribute__((unused)); \
union { \
size_t __dynamic_len_removed[ARRAY_SIZE(__event_fields___##_name)]; \
char __filter_stack_data[2 * sizeof(unsigned long) * ARRAY_SIZE(__event_fields___##_name)]; \
\
if (!_TP_SESSION_CHECK(session, __session)) \
return; \
- if (unlikely(!ACCESS_ONCE(__session->active))) \
+ if (unlikely(!READ_ONCE(__session->active))) \
return; \
- if (unlikely(!ACCESS_ONCE(__chan->enabled))) \
+ if (unlikely(!READ_ONCE(__chan->enabled))) \
return; \
- if (unlikely(!ACCESS_ONCE(__event->enabled))) \
+ if (unlikely(!READ_ONCE(__event->enabled))) \
return; \
__lpf = lttng_rcu_dereference(__session->pid_tracker); \
- if (__lpf && likely(!lttng_pid_tracker_lookup(__lpf, current->pid))) \
+ if (__lpf && likely(!lttng_pid_tracker_lookup(__lpf, current->tgid))) \
return; \
__orig_dynamic_len_offset = this_cpu_ptr(<tng_dynamic_len_stack)->offset; \
__dynamic_len_idx = __orig_dynamic_len_offset; \