__event_len += lib_ring_buffer_align(__event_len, lttng_alignof(_length_type)); \
__event_len += sizeof(_length_type); \
__event_len += lib_ring_buffer_align(__event_len, lttng_alignof(_type)); \
- __dynamic_len[__dynamic_len_idx] = (_length); \
+ __dynamic_len[__dynamic_len_idx] = (_src_length); \
__event_len += sizeof(_type) * __dynamic_len[__dynamic_len_idx]; \
__dynamic_len_idx++;
_src_length, _encoding) \
{ \
_length_type __tmpl = __dynamic_len[__dynamic_len_idx]; \
- lib_ring_buffer_align_ctx(&ctx, lttng_alignof(_length_type)); \
+ 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)); \
__chan->ops->event_write(&ctx, _src, \
- sizeof(_type) * __get_sequence_len(dest));
+ sizeof(_type) * __get_dynamic_len(dest));
#undef ctf_string
#define ctf_string(_item, _src) \
- tp_memcpy(dest, _src, __get_sequence_len(dest))
+ lib_ring_buffer_align_ctx(&ctx, lttng_alignof(*(_src))); \
+ __chan->ops->event_write(&ctx, _src, __get_dynamic_len(dest));
/* Beware: this get len actually consumes the len value */
-#undef __get_sequence_len
-#define __get_sequence_len(field) __dynamic_len[__dynamic_len_idx++]
+#undef __get_dynamic_len
+#define __get_dynamic_len(field) __dynamic_len[__dynamic_len_idx++]
#undef TP_PROTO
#define TP_PROTO(args...) args
#include TRACEPOINT_INCLUDE(TRACEPOINT_INCLUDE_FILE)
+#undef __get_dynamic_len
+
/*
* Stage 8 of the trace events.
*
#include <sys/stat.h>
#include <fcntl.h>
#include <signal.h>
+#include <string.h>
#include "ust_tests_hello.h"
{
int i;
long values[] = { 1, 2, 3 };
+ char text[10] = "test";
init_int_handler();
sleep(1);
for (i = 0; i < 50; i++) {
- tracepoint(ust_tests_hello_tptest, i, values);
+ tracepoint(ust_tests_hello_tptest, i, values,
+ text, strlen(text));
usleep(100000);
}
return 0;
#include <ust/tracepoint.h>
TRACEPOINT_EVENT(ust_tests_hello_tptest,
- TP_PROTO(int anint, long *values),
- TP_ARGS(anint, values),
+ TP_PROTO(int anint, long *values,
+ char *text, size_t textlen),
+ TP_ARGS(anint, values, text, textlen),
TP_FIELDS(
ctf_integer(int, intfield, anint)
ctf_integer_hex(int, intfield2, anint)
ctf_integer_network(int, intfield3, anint)
ctf_integer_network_hex(int, intfield4, anint)
ctf_array(long, arrfield1, values, 3)
+ ctf_array_text(char, arrfield2, text, 10)
+ ctf_sequence(char, seqfield1, text,
+ size_t, textlen)
+ ctf_sequence_text(char, seqfield2, text,
+ size_t, textlen)
+ ctf_string(stringfield, text)
))
TRACEPOINT_EVENT_NOARGS(ust_tests_hello_tptest_sighandler,