From: Michael Jeanson Date: Wed, 21 Apr 2021 19:50:19 +0000 (-0400) Subject: Tracepoint API namespacing ctf_float X-Git-Tag: v2.13.0-rc1~32 X-Git-Url: https://git.lttng.org./?a=commitdiff_plain;h=891226fc4bda9655e54bbafabe7a2ae8923ba4e1;p=lttng-ust.git Tracepoint API namespacing ctf_float The ABI bump gives us the opportunity to namespace all public symbols under the 'lttng_ust_' prefix. Namespace all API symbols and macros under 'lttng_ust_' / 'LTTNG_UST_' and add compat macros to keep compatibility with the previous API. Change-Id: Ia34bb89dff2542b8d67f2221353ea2e01ed0e0e8 Signed-off-by: Michael Jeanson Signed-off-by: Mathieu Desnoyers --- diff --git a/doc/examples/demo/ust_tests_demo2.h b/doc/examples/demo/ust_tests_demo2.h index 7bd3c9b6..b3ab8feb 100644 --- a/doc/examples/demo/ust_tests_demo2.h +++ b/doc/examples/demo/ust_tests_demo2.h @@ -30,8 +30,8 @@ LTTNG_UST_TRACEPOINT_EVENT(ust_tests_demo2, loop, ctf_sequence_text(char, seqfield2, text, size_t, textlen) ctf_string(stringfield, text) - ctf_float(float, floatfield, floatarg) - ctf_float(double, doublefield, doublearg) + lttng_ust_field_float(float, floatfield, floatarg) + lttng_ust_field_float(double, doublefield, doublearg) ) ) LTTNG_UST_TRACEPOINT_LOGLEVEL(ust_tests_demo2, loop, LTTNG_UST_TRACEPOINT_LOGLEVEL_WARNING) diff --git a/doc/examples/hello-static-lib/ust_tests_hello.h b/doc/examples/hello-static-lib/ust_tests_hello.h index 552e8d21..a2d4eab4 100644 --- a/doc/examples/hello-static-lib/ust_tests_hello.h +++ b/doc/examples/hello-static-lib/ust_tests_hello.h @@ -30,8 +30,8 @@ LTTNG_UST_TRACEPOINT_EVENT(ust_tests_hello, tptest, ctf_sequence_text(char, seqfield2, text, size_t, textlen) ctf_string(stringfield, text) - ctf_float(float, floatfield, floatarg) - ctf_float(double, doublefield, doublearg) + lttng_ust_field_float(float, floatfield, floatarg) + lttng_ust_field_float(double, doublefield, doublearg) ) ) diff --git a/include/lttng/tracepoint.h b/include/lttng/tracepoint.h index b10c4252..3524c9d1 100644 --- a/include/lttng/tracepoint.h +++ b/include/lttng/tracepoint.h @@ -593,6 +593,9 @@ lttng_ust__tracepoints__ptrs_destroy(void) #define ctf_integer_network lttng_ust_field_integer_network #define ctf_integer_network_hex lttng_ust_field_integer_network_hex #define ctf_integer_nowrite lttng_ust_field_integer_nowrite + +#define ctf_float lttng_ust_field_float +#define ctf_float_nowrite lttng_ust_field_float_nowrite #endif /* #if LTTNG_UST_COMPAT_API(0) */ #ifdef __cplusplus diff --git a/include/lttng/ust-tracepoint-event-nowrite.h b/include/lttng/ust-tracepoint-event-nowrite.h index 098f792a..9358d8f1 100644 --- a/include/lttng/ust-tracepoint-event-nowrite.h +++ b/include/lttng/ust-tracepoint-event-nowrite.h @@ -8,9 +8,9 @@ #define lttng_ust_field_integer_nowrite(_type, _item, _src) \ lttng_ust__field_integer_ext(_type, _item, _src, LTTNG_UST_BYTE_ORDER, 10, 1) -#undef ctf_float_nowrite -#define ctf_float_nowrite(_type, _item, _src) \ - _ctf_float(_type, _item, _src, 1) +#undef lttng_ust_field_float_nowrite +#define lttng_ust_field_float_nowrite(_type, _item, _src) \ + lttng_ust__field_float(_type, _item, _src, 1) #undef ctf_array_nowrite #define ctf_array_nowrite(_type, _item, _src, _length) \ diff --git a/include/lttng/ust-tracepoint-event-reset.h b/include/lttng/ust-tracepoint-event-reset.h index fbac2944..96945926 100644 --- a/include/lttng/ust-tracepoint-event-reset.h +++ b/include/lttng/ust-tracepoint-event-reset.h @@ -31,8 +31,8 @@ #define lttng_ust__field_integer_ext(_type, _item, _src, _byte_order, _base, \ _nowrite) -#undef _ctf_float -#define _ctf_float(_type, _item, _src, _nowrite) +#undef lttng_ust__field_float +#define lttng_ust__field_float(_type, _item, _src, _nowrite) #undef _ctf_array_encoded #define _ctf_array_encoded(_type, _item, _src, _byte_order, _length, _encoding, \ @@ -64,8 +64,8 @@ #undef lttng_ust_field_integer_network_hex #define lttng_ust_field_integer_network_hex(_type, _item, _src) -#undef ctf_float -#define ctf_float(_type, _item, _src) +#undef lttng_ust_field_float +#define lttng_ust_field_float(_type, _item, _src) #undef ctf_array #define ctf_array(_type, _item, _src, _length) @@ -110,8 +110,8 @@ #undef lttng_ust_field_integer_nowrite #define lttng_ust_field_integer_nowrite(_type, _item, _src) -#undef ctf_float_nowrite -#define ctf_float_nowrite(_type, _item, _src) +#undef lttng_ust_field_float_nowrite +#define lttng_ust_field_float_nowrite(_type, _item, _src) #undef ctf_array_nowrite #define ctf_array_nowrite(_type, _item, _src, _length) diff --git a/include/lttng/ust-tracepoint-event-write.h b/include/lttng/ust-tracepoint-event-write.h index f45cd776..66a7dede 100644 --- a/include/lttng/ust-tracepoint-event-write.h +++ b/include/lttng/ust-tracepoint-event-write.h @@ -20,9 +20,9 @@ #define lttng_ust_field_integer_network_hex(_type, _item, _src) \ lttng_ust__field_integer_ext(_type, _item, _src, LTTNG_UST_BIG_ENDIAN, 16, 0) -#undef ctf_float -#define ctf_float(_type, _item, _src) \ - _ctf_float(_type, _item, _src, 0) +#undef lttng_ust_field_float +#define lttng_ust_field_float(_type, _item, _src) \ + lttng_ust__field_float(_type, _item, _src, 0) #undef ctf_array #define ctf_array(_type, _item, _src, _length) \ diff --git a/include/lttng/ust-tracepoint-event.h b/include/lttng/ust-tracepoint-event.h index df3aebf6..66c27e05 100644 --- a/include/lttng/ust-tracepoint-event.h +++ b/include/lttng/ust-tracepoint-event.h @@ -268,8 +268,8 @@ void lttng_ust__event_template_proto___##_provider##___##_name(LTTNG_UST__TP_ARG .nofilter = 0, \ }), -#undef _ctf_float -#define _ctf_float(_type, _item, _src, _nowrite) \ +#undef lttng_ust__field_float +#define lttng_ust__field_float(_type, _item, _src, _nowrite) \ LTTNG_UST_COMPOUND_LITERAL(const struct lttng_ust_event_field, { \ .struct_size = sizeof(struct lttng_ust_event_field), \ .name = #_item, \ @@ -419,8 +419,8 @@ static void lttng_ust__event_probe__##_provider##___##_name(LTTNG_UST__TP_ARGS_D __event_len += lttng_ust_ring_buffer_align(__event_len, lttng_ust_rb_alignof(_type)); \ __event_len += sizeof(_type); -#undef _ctf_float -#define _ctf_float(_type, _item, _src, _nowrite) \ +#undef lttng_ust__field_float +#define lttng_ust__field_float(_type, _item, _src, _nowrite) \ if (0) \ (void) (_src); /* Unused */ \ __event_len += lttng_ust_ring_buffer_align(__event_len, lttng_ust_rb_alignof(_type)); \ @@ -579,8 +579,8 @@ size_t lttng_ust__event_get_size__##_provider##___##_name( \ } \ __stack_data += sizeof(int64_t); -#undef _ctf_float -#define _ctf_float(_type, _item, _src, _nowrite) \ +#undef lttng_ust__field_float +#define lttng_ust__field_float(_type, _item, _src, _nowrite) \ { \ double __ctf_tmp_double = (double) (_type) (_src); \ memcpy(__stack_data, &__ctf_tmp_double, sizeof(double)); \ @@ -667,8 +667,8 @@ void lttng_ust__event_prepare_interpreter_stack__##_provider##___##_name(char *_ (void) (_src); /* Unused */ \ lttng_ust__event_align = lttng_ust__tp_max_t(size_t, lttng_ust__event_align, lttng_ust_rb_alignof(_type)); -#undef _ctf_float -#define _ctf_float(_type, _item, _src, _nowrite) \ +#undef lttng_ust__field_float +#define lttng_ust__field_float(_type, _item, _src, _nowrite) \ if (0) \ (void) (_src); /* Unused */ \ lttng_ust__event_align = lttng_ust__tp_max_t(size_t, lttng_ust__event_align, lttng_ust_rb_alignof(_type)); @@ -744,8 +744,8 @@ size_t lttng_ust__event_get_align__##_provider##___##_name(LTTNG_UST__TP_ARGS_PR __chan->ops->event_write(&__ctx, &__tmp, sizeof(__tmp), lttng_ust_rb_alignof(__tmp));\ } -#undef _ctf_float -#define _ctf_float(_type, _item, _src, _nowrite) \ +#undef lttng_ust__field_float +#define lttng_ust__field_float(_type, _item, _src, _nowrite) \ { \ _type __tmp = (_src); \ __chan->ops->event_write(&__ctx, &__tmp, sizeof(__tmp), lttng_ust_rb_alignof(__tmp));\ diff --git a/tests/compile/hello.cxx/ust_tests_hello.h b/tests/compile/hello.cxx/ust_tests_hello.h index 699a6590..9fba556e 100644 --- a/tests/compile/hello.cxx/ust_tests_hello.h +++ b/tests/compile/hello.cxx/ust_tests_hello.h @@ -42,8 +42,8 @@ LTTNG_UST_TRACEPOINT_EVENT(ust_tests_hello, tptest, ctf_sequence_text(char, seqfield2, text, size_t, textlen) ctf_string(stringfield, text) - ctf_float(float, floatfield, floatarg) - ctf_float(double, doublefield, doublearg) + lttng_ust_field_float(float, floatfield, floatarg) + lttng_ust_field_float(double, doublefield, doublearg) ctf_enum(ust_tests_hello, my_enum, int, enumfield, enumarg) ) ) diff --git a/tests/compile/hello/ust_tests_hello.h b/tests/compile/hello/ust_tests_hello.h index 2ef4ca4f..7cc92a27 100644 --- a/tests/compile/hello/ust_tests_hello.h +++ b/tests/compile/hello/ust_tests_hello.h @@ -43,8 +43,8 @@ LTTNG_UST_TRACEPOINT_EVENT(ust_tests_hello, tptest, ctf_sequence_network(long, seqfield_network_3, values, size_t, 3) ctf_string(stringfield, text) - ctf_float(float, floatfield, floatarg) - ctf_float(double, doublefield, doublearg) + lttng_ust_field_float(float, floatfield, floatarg) + lttng_ust_field_float(double, doublefield, doublearg) lttng_ust_field_integer(bool, boolfield, boolarg) lttng_ust_field_integer_nowrite(int, filterfield, anint) ) diff --git a/tests/compile/test-app-ctx/ust_tests_hello.h b/tests/compile/test-app-ctx/ust_tests_hello.h index 8305bce4..8d2ac308 100644 --- a/tests/compile/test-app-ctx/ust_tests_hello.h +++ b/tests/compile/test-app-ctx/ust_tests_hello.h @@ -32,8 +32,8 @@ LTTNG_UST_TRACEPOINT_EVENT(ust_tests_hello, tptest, ctf_sequence_text(char, seqfield2, text, size_t, textlen) ctf_string(stringfield, text) - ctf_float(float, floatfield, floatarg) - ctf_float(double, doublefield, doublearg) + lttng_ust_field_float(float, floatfield, floatarg) + lttng_ust_field_float(double, doublefield, doublearg) lttng_ust_field_integer(bool, boolfield, boolarg) lttng_ust_field_integer_nowrite(int, filterfield, anint) )