From 35ebe09bb46607a9286094e2d95fe67f9a6ab8bf Mon Sep 17 00:00:00 2001 From: Mathieu Desnoyers Date: Fri, 6 May 2016 16:30:21 -0400 Subject: [PATCH] Tracepoint array/sequence: add nowrite hex macros Signed-off-by: Mathieu Desnoyers --- include/lttng/ust-tracepoint-event-nowrite.h | 24 +++++++++++++ include/lttng/ust-tracepoint-event-reset.h | 36 ++++++++++++++++++++ tests/hello/ust_tests_hello.h | 4 +++ 3 files changed, 64 insertions(+) diff --git a/include/lttng/ust-tracepoint-event-nowrite.h b/include/lttng/ust-tracepoint-event-nowrite.h index c0b42665..c1d9c03a 100644 --- a/include/lttng/ust-tracepoint-event-nowrite.h +++ b/include/lttng/ust-tracepoint-event-nowrite.h @@ -32,6 +32,20 @@ #define ctf_array_nowrite(_type, _item, _src, _length) \ _ctf_array_encoded(_type, _item, _src, BYTE_ORDER, _length, none, 1, 10) +#undef ctf_array_nowrite_hex +#define ctf_array_nowrite_hex(_type, _item, _src, _length) \ + _ctf_array_encoded(_type, _item, _src, BYTE_ORDER, _length, none, 1, 16) + +#undef ctf_array_network_nowrite +#define ctf_array_network_nowrite(_type, _item, _src, _length) \ + _ctf_array_encoded(_type, _item, _src, BIG_ENDIAN, \ + _length, none, 1, 10) + +#undef ctf_array_network_nowrite_hex +#define ctf_array_network_nowrite_hex(_type, _item, _src, _length) \ + _ctf_array_encoded(_type, _item, _src, BIG_ENDIAN, \ + _length, none, 1, 16) + #undef ctf_array_text_nowrite #define ctf_array_text_nowrite(_type, _item, _src, _length) \ _ctf_array_encoded(_type, _item, _src, BYTE_ORDER, _length, UTF8, 1, 10) @@ -46,6 +60,16 @@ _ctf_sequence_encoded(_type, _item, _src, BYTE_ORDER, \ _length_type, _src_length, none, 1, 16) +#undef ctf_sequence_network_nowrite +#define ctf_sequence_network_nowrite(_type, _item, _src, _length_type, _src_length) \ + _ctf_sequence_encoded(_type, _item, _src, BIG_ENDIAN, \ + _length_type, _src_length, none, 1, 10) + +#undef ctf_sequence_network_nowrite_hex +#define ctf_sequence_network_nowrite_hex(_type, _item, _src, _length_type, _src_length) \ + _ctf_sequence_encoded(_type, _item, _src, BIG_ENDIAN, \ + _length_type, _src_length, none, 1, 16) + #undef ctf_sequence_text_nowrite #define ctf_sequence_text_nowrite(_type, _item, _src, _length_type, _src_length) \ _ctf_sequence_encoded(_type, _item, _src, BYTE_ORDER, \ diff --git a/include/lttng/ust-tracepoint-event-reset.h b/include/lttng/ust-tracepoint-event-reset.h index a89e6efa..47bb5a8d 100644 --- a/include/lttng/ust-tracepoint-event-reset.h +++ b/include/lttng/ust-tracepoint-event-reset.h @@ -86,12 +86,30 @@ #undef ctf_array #define ctf_array(_type, _item, _src, _length) +#undef ctf_array_hex +#define ctf_array_hex(_type, _item, _src, _length) + +#undef ctf_array_network +#define ctf_array_network(_type, _item, _src, _length) + +#undef ctf_array_network_hex +#define ctf_array_network_hex(_type, _item, _src, _length) + #undef ctf_array_text #define ctf_array_text(_type, _item, _src, _length) #undef ctf_sequence #define ctf_sequence(_type, _item, _src, _length_type, _src_length) +#undef ctf_sequence_hex +#define ctf_sequence_hex(_type, _item, _src, _length_type, _src_length) + +#undef ctf_sequence_network +#define ctf_sequence_network(_type, _item, _src, _length_type, _src_length) + +#undef ctf_sequence_network_hex +#define ctf_sequence_network_hex(_type, _item, _src, _length_type, _src_length) + #undef ctf_sequence_text #define ctf_sequence_text(_type, _item, _src, _length_type, _src_length) @@ -111,12 +129,30 @@ #undef ctf_array_nowrite #define ctf_array_nowrite(_type, _item, _src, _length) +#undef ctf_array_nowrite_hex +#define ctf_array_nowrite_hex(_type, _item, _src, _length) + +#undef ctf_array_network_nowrite +#define ctf_array_network_nowrite(_type, _item, _src, _length) + +#undef ctf_array_network_nowrite_hex +#define ctf_array_network_nowrite_hex(_type, _item, _src, _length) + #undef ctf_array_text_nowrite #define ctf_array_text_nowrite(_type, _item, _src, _length) #undef ctf_sequence_nowrite #define ctf_sequence_nowrite(_type, _item, _src, _length_type, _src_length) +#undef ctf_sequence_nowrite_hex +#define ctf_sequence_nowrite_hex(_type, _item, _src, _length_type, _src_length) + +#undef ctf_sequence_network_nowrite +#define ctf_sequence_network_nowrite(_type, _item, _src, _length_type, _src_length) + +#undef ctf_sequence_network_nowrite_hex +#define ctf_sequence_network_nowrite_hex(_type, _item, _src, _length_type, _src_length) + #undef ctf_sequence_text_nowrite #define ctf_sequence_text_nowrite(_type, _item, _src, _length_type, _src_length) diff --git a/tests/hello/ust_tests_hello.h b/tests/hello/ust_tests_hello.h index ec5c00cd..372828f8 100644 --- a/tests/hello/ust_tests_hello.h +++ b/tests/hello/ust_tests_hello.h @@ -40,6 +40,8 @@ TRACEPOINT_EVENT(ust_tests_hello, tptest, ctf_integer(long, longfield, anint) ctf_integer_network(int, netintfield, netint) ctf_integer_network_hex(int, netintfieldhex, netint) + ctf_array_nowrite(long, arrfield1z, values, 3) + ctf_array(long, blah, values, 3) ctf_array(long, arrfield1, values, 3) ctf_array_hex(long, arrfield1_hex, values, 3) ctf_array_network(long, arrfield1_network, values, 3) @@ -47,6 +49,8 @@ TRACEPOINT_EVENT(ust_tests_hello, tptest, ctf_array_text(char, arrfield2, text, 10) ctf_sequence(char, seqfield1, text, size_t, textlen) + ctf_sequence_nowrite(char, seqfield1z, text, + size_t, textlen) ctf_sequence_hex(char, seqfield1_hex, text, size_t, textlen) ctf_sequence_text(char, seqfield2, text, -- 2.34.1