#ifndef LTTNG_TRACEPOINT_TYPE_EXTERN
# undef LTTNG_TRACEPOINT_ENUM
# define LTTNG_TRACEPOINT_ENUM(_name, _values) \
- static const struct lttng_kernel_enum_entry *__enum_values__##_name[] = { \
+ static const struct lttng_kernel_enum_entry * const __enum_values__##_name[] = { \
_values \
};
#endif
#undef LTTNG_TRACEPOINT_EVENT_CLASS_CODE_NOARGS
#define LTTNG_TRACEPOINT_EVENT_CLASS_CODE_NOARGS(_name, _locvar, _code_pre, _fields, _code_post) \
- static const struct lttng_kernel_event_field *__event_fields___##_name[] = { \
+ static const struct lttng_kernel_event_field * const __event_fields___##_name[] = { \
_fields \
}; \
static const struct lttng_kernel_tracepoint_class lttng_kernel__event_class___##_name = { \
#define _ctf_integer_ext_fetched(_type, _item, _src, _byte_order, _base, _nowrite) \
{ \
_type __tmp = _src; \
- lib_ring_buffer_align_ctx(&__ctx, lttng_alignof(__tmp));\
- __chan->ops->event_write(&__ctx, &__tmp, sizeof(__tmp));\
+ __chan->ops->event_write(&__ctx, &__tmp, sizeof(__tmp), lttng_alignof(__tmp)); \
}
#undef _ctf_integer_ext_isuser0
#undef _ctf_array_encoded
#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)); \
- } else { \
- __chan->ops->event_write(&__ctx, _src, sizeof(_type) * (_length)); \
+ if (lttng_kernel_string_encoding_##_encoding == lttng_kernel_string_encoding_none) { \
+ if (_user) { \
+ __chan->ops->event_write_from_user(&__ctx, _src, sizeof(_type) * (_length), lttng_alignof(_type)); \
+ } else { \
+ __chan->ops->event_write(&__ctx, _src, sizeof(_type) * (_length), lttng_alignof(_type)); \
+ } \
+ } else { \
+ if (_user) { \
+ __chan->ops->event_pstrcpy_pad_from_user(&__ctx, (const char __user *) (_src), _length); \
+ } else { \
+ __chan->ops->event_pstrcpy_pad(&__ctx, (const char *) (_src), _length); \
+ } \
}
#if (__BYTE_ORDER == __LITTLE_ENDIAN)
#undef _ctf_array_bitfield
#define _ctf_array_bitfield(_type, _item, _src, _length, _user, _nowrite) \
- lib_ring_buffer_align_ctx(&__ctx, lttng_alignof(_type)); \
if (_user) { \
- __chan->ops->event_write_from_user(&__ctx, _src, sizeof(_type) * (_length)); \
+ __chan->ops->event_write_from_user(&__ctx, _src, sizeof(_type) * (_length), lttng_alignof(_type)); \
} else { \
- __chan->ops->event_write(&__ctx, _src, sizeof(_type) * (_length)); \
+ __chan->ops->event_write(&__ctx, _src, sizeof(_type) * (_length), lttng_alignof(_type)); \
}
#else /* #if (__BYTE_ORDER == __LITTLE_ENDIAN) */
/*
default: \
BUG_ON(1); \
} \
- __chan->ops->event_write(&__ctx, &_tmp, sizeof(_type)); \
+ __chan->ops->event_write(&__ctx, &_tmp, sizeof(_type), 1); \
} \
}
#endif /* #else #if (__BYTE_ORDER == __LITTLE_ENDIAN) */
#undef _ctf_sequence_encoded
-#define _ctf_sequence_encoded(_type, _item, _src, _length_type, \
+#define _ctf_sequence_encoded(_type, _item, _src, _length_type, \
_src_length, _encoding, _byte_order, _base, _user, _nowrite) \
- { \
+ { \
_length_type __tmpl = this_cpu_ptr(<tng_dynamic_len_stack)->stack[__dynamic_len_idx]; \
- lib_ring_buffer_align_ctx(&__ctx, lttng_alignof(_length_type));\
- __chan->ops->event_write(&__ctx, &__tmpl, sizeof(_length_type));\
- } \
- lib_ring_buffer_align_ctx(&__ctx, lttng_alignof(_type)); \
- if (_user) { \
- __chan->ops->event_write_from_user(&__ctx, _src, \
- sizeof(_type) * __get_dynamic_len(dest)); \
- } else { \
- __chan->ops->event_write(&__ctx, _src, \
- sizeof(_type) * __get_dynamic_len(dest)); \
+ __chan->ops->event_write(&__ctx, &__tmpl, sizeof(_length_type), lttng_alignof(_length_type));\
+ } \
+ if (lttng_kernel_string_encoding_##_encoding == lttng_kernel_string_encoding_none) { \
+ if (_user) { \
+ __chan->ops->event_write_from_user(&__ctx, _src, \
+ sizeof(_type) * __get_dynamic_len(dest), lttng_alignof(_type)); \
+ } else { \
+ __chan->ops->event_write(&__ctx, _src, \
+ sizeof(_type) * __get_dynamic_len(dest), lttng_alignof(_type)); \
+ } \
+ } else { \
+ if (_user) { \
+ __chan->ops->event_pstrcpy_pad_from_user(&__ctx, (const char __user *) (_src), \
+ __get_dynamic_len(dest)); \
+ } else { \
+ __chan->ops->event_pstrcpy_pad(&__ctx, (const char *) (_src), \
+ __get_dynamic_len(dest)); \
+ } \
}
#if (__BYTE_ORDER == __LITTLE_ENDIAN)
_user, _nowrite) \
{ \
_length_type __tmpl = this_cpu_ptr(<tng_dynamic_len_stack)->stack[__dynamic_len_idx] * sizeof(_type) * CHAR_BIT; \
- lib_ring_buffer_align_ctx(&__ctx, lttng_alignof(_length_type));\
- __chan->ops->event_write(&__ctx, &__tmpl, sizeof(_length_type));\
+ __chan->ops->event_write(&__ctx, &__tmpl, sizeof(_length_type), lttng_alignof(_length_type)); \
} \
- lib_ring_buffer_align_ctx(&__ctx, lttng_alignof(_type)); \
if (_user) { \
__chan->ops->event_write_from_user(&__ctx, _src, \
- sizeof(_type) * __get_dynamic_len(dest)); \
+ sizeof(_type) * __get_dynamic_len(dest), lttng_alignof(_type)); \
} else { \
__chan->ops->event_write(&__ctx, _src, \
- sizeof(_type) * __get_dynamic_len(dest)); \
+ sizeof(_type) * __get_dynamic_len(dest), lttng_alignof(_type)); \
}
#else /* #if (__BYTE_ORDER == __LITTLE_ENDIAN) */
/*
_user, _nowrite) \
{ \
_length_type __tmpl = this_cpu_ptr(<tng_dynamic_len_stack)->stack[__dynamic_len_idx] * sizeof(_type) * CHAR_BIT; \
- lib_ring_buffer_align_ctx(&__ctx, lttng_alignof(_length_type));\
- __chan->ops->event_write(&__ctx, &__tmpl, sizeof(_length_type));\
+ __chan->ops->event_write(&__ctx, &__tmpl, sizeof(_length_type), lttng_alignof(_length_type)); \
} \
lib_ring_buffer_align_ctx(&__ctx, lttng_alignof(_type)); \
{ \
default: \
BUG_ON(1); \
} \
- __chan->ops->event_write(&__ctx, &_tmp, sizeof(_type)); \
+ __chan->ops->event_write(&__ctx, &_tmp, sizeof(_type), 1); \
} \
}
#endif /* #else #if (__BYTE_ORDER == __LITTLE_ENDIAN) */
#define TP_ID1(_token, _system) _token##_system
#define TP_ID(_token, _system) TP_ID1(_token, _system)
-static const struct lttng_kernel_event_desc *TP_ID(__event_desc___, TRACE_SYSTEM)[] = {
+static const struct lttng_kernel_event_desc * const TP_ID(__event_desc___, TRACE_SYSTEM)[] = {
#include TRACE_INCLUDE(TRACE_INCLUDE_FILE)
};