Tracepoint API namespacing ctf_array
authorMichael Jeanson <mjeanson@efficios.com>
Wed, 21 Apr 2021 20:03:42 +0000 (16:03 -0400)
committerMathieu Desnoyers <mathieu.desnoyers@efficios.com>
Thu, 22 Apr 2021 15:01:18 +0000 (11:01 -0400)
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: Ib1c3694d054cba2b6d27bd62a3db2b64eca27c3f
Signed-off-by: Michael Jeanson <mjeanson@efficios.com>
Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
12 files changed:
doc/examples/demo/ust_tests_demo2.h
doc/examples/hello-static-lib/ust_tests_hello.h
include/lttng/tracepoint.h
include/lttng/ust-tracepoint-event-nowrite.h
include/lttng/ust-tracepoint-event-reset.h
include/lttng/ust-tracepoint-event-write.h
include/lttng/ust-tracepoint-event.h
include/lttng/ust-utils.h
src/lib/lttng-ust/lttng-ust-statedump-provider.h
tests/compile/hello.cxx/ust_tests_hello.h
tests/compile/hello/ust_tests_hello.h
tests/compile/test-app-ctx/ust_tests_hello.h

index b3ab8febaf5ae34c2913e6d2e95b9dc15655308b..95c83446c0fd3b0c1292a140532036a9e00240ed 100644 (file)
@@ -23,8 +23,8 @@ LTTNG_UST_TRACEPOINT_EVENT(ust_tests_demo2, loop,
                lttng_ust_field_integer(long, longfield, anint)
                lttng_ust_field_integer_network(int, netintfield, netint)
                lttng_ust_field_integer_network_hex(int, netintfieldhex, netint)
-               ctf_array(long, arrfield1, values, 3)
-               ctf_array_text(char, arrfield2, text, 10)
+               lttng_ust_field_array(long, arrfield1, values, 3)
+               lttng_ust_field_array_text(char, arrfield2, text, 10)
                ctf_sequence(char, seqfield1, text,
                             size_t, textlen)
                ctf_sequence_text(char, seqfield2, text,
index a2d4eab49d08a4fa73eb5fdcd85cc4e20160de3c..80b9d3b873450511879cfcfb7ee6d893348caad8 100644 (file)
@@ -23,8 +23,8 @@ LTTNG_UST_TRACEPOINT_EVENT(ust_tests_hello, tptest,
                lttng_ust_field_integer(long, longfield, anint)
                lttng_ust_field_integer_network(int, netintfield, netint)
                lttng_ust_field_integer_network_hex(int, netintfieldhex, netint)
-               ctf_array(long, arrfield1, values, 3)
-               ctf_array_text(char, arrfield2, text, 10)
+               lttng_ust_field_array(long, arrfield1, values, 3)
+               lttng_ust_field_array_text(char, arrfield2, text, 10)
                ctf_sequence(char, seqfield1, text,
                             size_t, textlen)
                ctf_sequence_text(char, seqfield2, text,
index 3524c9d11c77ee7b1f6ea25275139c0b2a6ddb03..01aeb3b7ff5ca189fcd4b0bacaa81c065b79bf44 100644 (file)
@@ -596,6 +596,17 @@ lttng_ust__tracepoints__ptrs_destroy(void)
 
 #define ctf_float                      lttng_ust_field_float
 #define ctf_float_nowrite              lttng_ust_field_float_nowrite
+
+#define ctf_array                      lttng_ust_field_array
+#define ctf_array_hex                  lttng_ust_field_array_hex
+#define ctf_array_network              lttng_ust_field_array_network
+#define ctf_array_network_hex          lttng_ust_field_array_network_hex
+#define ctf_array_text                 lttng_ust_field_array_text
+#define ctf_array_nowrite              lttng_ust_field_array_nowrite
+#define ctf_array_nowrite_hex          lttng_ust_field_array_nowrite_hex
+#define ctf_array_network_nowrite      lttng_ust_field_array_network_nowrite
+#define ctf_array_network_nowrite_hex  lttng_ust_field_array_network_nowrite_hex
+#define ctf_array_text_nowrite         lttng_ust_field_array_text_nowrite
 #endif /* #if LTTNG_UST_COMPAT_API(0) */
 
 #ifdef __cplusplus
@@ -681,14 +692,14 @@ lttng_ust__tracepoints__ptrs_destroy(void)
  *         ctf_enum(someproject_component, enum_name, int, field_e, arg0)
  *
  *         * Array Sequence, printed as UTF8-encoded array of bytes *
- *         ctf_array_text(char, field_b, string, FIXED_LEN)
+ *         lttng_ust_field_array_text(char, field_b, string, FIXED_LEN)
  *         ctf_sequence_text(char, field_c, string, size_t, strlen)
  *
  *         * String, printed as UTF8-encoded string *
  *         ctf_string(field_e, string)
  *
  *         * Array sequence of signed integer values *
- *         ctf_array(long, field_f, arg4, FIXED_LEN4)
+ *         lttng_ust_field_array(long, field_f, arg4, FIXED_LEN4)
  *         ctf_sequence(long, field_g, arg4, size_t, arg4_len)
  *     )
  * )
index 9358d8f115a3d838746e60f7fa146cb6d554ac52..282462c359ff9b0386bcbb283f9c3f762db6d67f 100644 (file)
 #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)         \
-       _ctf_array_encoded(_type, _item, _src, LTTNG_UST_BYTE_ORDER, _length, none, 1, 10)
+#undef lttng_ust_field_array_nowrite
+#define lttng_ust_field_array_nowrite(_type, _item, _src, _length)             \
+       lttng_ust__field_array_encoded(_type, _item, _src, LTTNG_UST_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, LTTNG_UST_BYTE_ORDER, _length, none, 1, 16)
+#undef lttng_ust_field_array_nowrite_hex
+#define lttng_ust_field_array_nowrite_hex(_type, _item, _src, _length) \
+       lttng_ust__field_array_encoded(_type, _item, _src, LTTNG_UST_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, LTTNG_UST_BIG_ENDIAN,    \
+#undef lttng_ust_field_array_network_nowrite
+#define lttng_ust_field_array_network_nowrite(_type, _item, _src, _length)     \
+       lttng_ust__field_array_encoded(_type, _item, _src, LTTNG_UST_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, LTTNG_UST_BIG_ENDIAN,    \
+#undef lttng_ust_field_array_network_nowrite_hex
+#define lttng_ust_field_array_network_nowrite_hex(_type, _item, _src, _length) \
+       lttng_ust__field_array_encoded(_type, _item, _src, LTTNG_UST_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, LTTNG_UST_BYTE_ORDER, _length, UTF8, 1, 10)
+#undef lttng_ust_field_array_text_nowrite
+#define lttng_ust_field_array_text_nowrite(_type, _item, _src, _length)        \
+       lttng_ust__field_array_encoded(_type, _item, _src, LTTNG_UST_BYTE_ORDER, _length, UTF8, 1, 10)
 
 #undef ctf_sequence_nowrite
 #define ctf_sequence_nowrite(_type, _item, _src, _length_type, _src_length) \
index 969459265f0b4a880293aaca3ac31e307d3d82d1..bfce5796cbac9ffc9ebecc37499ccb4bb60a6795 100644 (file)
@@ -34,8 +34,8 @@
 #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, \
+#undef lttng_ust__field_array_encoded
+#define lttng_ust__field_array_encoded(_type, _item, _src, _byte_order, _length, _encoding, \
                        _nowrite, _elem_type_base)
 
 #undef _ctf_sequence_encoded
 #undef lttng_ust_field_float
 #define lttng_ust_field_float(_type, _item, _src)
 
-#undef ctf_array
-#define ctf_array(_type, _item, _src, _length)
+#undef lttng_ust_field_array
+#define lttng_ust_field_array(_type, _item, _src, _length)
 
-#undef ctf_array_hex
-#define ctf_array_hex(_type, _item, _src, _length)
+#undef lttng_ust_field_array_hex
+#define lttng_ust_field_array_hex(_type, _item, _src, _length)
 
-#undef ctf_array_network
-#define ctf_array_network(_type, _item, _src, _length)
+#undef lttng_ust_field_array_network
+#define lttng_ust_field_array_network(_type, _item, _src, _length)
 
-#undef ctf_array_network_hex
-#define ctf_array_network_hex(_type, _item, _src, _length)
+#undef lttng_ust_field_array_network_hex
+#define lttng_ust_field_array_network_hex(_type, _item, _src, _length)
 
-#undef ctf_array_text
-#define ctf_array_text(_type, _item, _src, _length)
+#undef lttng_ust_field_array_text
+#define lttng_ust_field_array_text(_type, _item, _src, _length)
 
 #undef ctf_sequence
 #define ctf_sequence(_type, _item, _src, _length_type, _src_length)
 #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)
+#undef lttng_ust_field_array_nowrite
+#define lttng_ust_field_array_nowrite(_type, _item, _src, _length)
 
-#undef ctf_array_nowrite_hex
-#define ctf_array_nowrite_hex(_type, _item, _src, _length)
+#undef lttng_ust_field_array_nowrite_hex
+#define lttng_ust_field_array_nowrite_hex(_type, _item, _src, _length)
 
-#undef ctf_array_network_nowrite
-#define ctf_array_network_nowrite(_type, _item, _src, _length)
+#undef lttng_ust_field_array_network_nowrite
+#define lttng_ust_field_array_network_nowrite(_type, _item, _src, _length)
 
-#undef ctf_array_network_nowrite_hex
-#define ctf_array_network_nowrite_hex(_type, _item, _src, _length)
+#undef lttng_ust_field_array_network_nowrite_hex
+#define lttng_ust_field_array_network_nowrite_hex(_type, _item, _src, _length)
 
-#undef ctf_array_text_nowrite
-#define ctf_array_text_nowrite(_type, _item, _src, _length)
+#undef lttng_ust_field_array_text_nowrite
+#define lttng_ust_field_array_text_nowrite(_type, _item, _src, _length)
 
 #undef ctf_sequence_nowrite
 #define ctf_sequence_nowrite(_type, _item, _src, _length_type, _src_length)
index 66a7dede999dec0374f04d87bc7448c6e81d70ce..a9292dfc2a9521d09ece1d2d6dfc57940dd3bc85 100644 (file)
 #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)                 \
-       _ctf_array_encoded(_type, _item, _src, LTTNG_UST_BYTE_ORDER,    \
+#undef lttng_ust_field_array
+#define lttng_ust_field_array(_type, _item, _src, _length)                     \
+       lttng_ust__field_array_encoded(_type, _item, _src, LTTNG_UST_BYTE_ORDER,        \
                        _length, none, 0, 10)
 
-#undef ctf_array_hex
-#define ctf_array_hex(_type, _item, _src, _length)             \
-       _ctf_array_encoded(_type, _item, _src, LTTNG_UST_BYTE_ORDER,    \
+#undef lttng_ust_field_array_hex
+#define lttng_ust_field_array_hex(_type, _item, _src, _length)         \
+       lttng_ust__field_array_encoded(_type, _item, _src, LTTNG_UST_BYTE_ORDER,        \
                        _length, none, 0, 16)
 
-#undef ctf_array_network
-#define ctf_array_network(_type, _item, _src, _length) \
-       _ctf_array_encoded(_type, _item, _src, LTTNG_UST_BIG_ENDIAN,    \
+#undef lttng_ust_field_array_network
+#define lttng_ust_field_array_network(_type, _item, _src, _length)     \
+       lttng_ust__field_array_encoded(_type, _item, _src, LTTNG_UST_BIG_ENDIAN,        \
                        _length, none, 0, 10)
 
-#undef ctf_array_network_hex
-#define ctf_array_network_hex(_type, _item, _src, _length)     \
-       _ctf_array_encoded(_type, _item, _src, LTTNG_UST_BIG_ENDIAN,    \
+#undef lttng_ust_field_array_network_hex
+#define lttng_ust_field_array_network_hex(_type, _item, _src, _length) \
+       lttng_ust__field_array_encoded(_type, _item, _src, LTTNG_UST_BIG_ENDIAN,        \
                        _length, none, 0, 16)
 
-#undef ctf_array_text
-#define ctf_array_text(_type, _item, _src, _length)            \
-       _ctf_array_encoded(_type, _item, _src, LTTNG_UST_BYTE_ORDER,    \
+#undef lttng_ust_field_array_text
+#define lttng_ust_field_array_text(_type, _item, _src, _length)                \
+       lttng_ust__field_array_encoded(_type, _item, _src, LTTNG_UST_BYTE_ORDER,        \
                        _length, UTF8, 0, 10)
 
 #undef ctf_sequence
index 66c27e05393d2d4cf5fe3bc51a4546a22888212f..f9c0c88ca0128397237d92700f67c7ae8b804d1e 100644 (file)
@@ -225,17 +225,17 @@ void lttng_ust__event_template_proto___##_provider##___##_name(LTTNG_UST__TP_ARG
 #include <lttng/ust-tracepoint-event-write.h>
 #include <lttng/ust-tracepoint-event-nowrite.h>
 
-#undef _ctf_array_encoded
-#define _ctf_array_encoded(_type, _item, _src, _byte_order,    \
+#undef lttng_ust__field_array_encoded
+#define lttng_ust__field_array_encoded(_type, _item, _src, _byte_order,        \
                        _length, _encoding, _nowrite,           \
                        _elem_type_base)                        \
-       lttng_ust_ctf_array_element_type_is_supported(_type, _item);
+       lttng_ust_field_array_element_type_is_supported(_type, _item);
 
 #undef _ctf_sequence_encoded
 #define _ctf_sequence_encoded(_type, _item, _src, _byte_order, \
                        _length_type, _src_length, _encoding, _nowrite, \
                        _elem_type_base)                        \
-       lttng_ust_ctf_array_element_type_is_supported(_type, _item);
+       lttng_ust_field_array_element_type_is_supported(_type, _item);
 
 #undef LTTNG_UST_TP_FIELDS
 #define LTTNG_UST_TP_FIELDS(...) __VA_ARGS__   /* Only one used in this phase */
@@ -278,8 +278,8 @@ void lttng_ust__event_template_proto___##_provider##___##_name(LTTNG_UST__TP_ARG
                .nofilter = 0,                                  \
        }),
 
-#undef _ctf_array_encoded
-#define _ctf_array_encoded(_type, _item, _src, _byte_order,    \
+#undef lttng_ust__field_array_encoded
+#define lttng_ust__field_array_encoded(_type, _item, _src, _byte_order,        \
                        _length, _encoding, _nowrite,           \
                        _elem_type_base)                        \
        LTTNG_UST_COMPOUND_LITERAL(const struct lttng_ust_event_field, { \
@@ -426,8 +426,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_array_encoded
-#define _ctf_array_encoded(_type, _item, _src, _byte_order, _length, _encoding,         \
+#undef lttng_ust__field_array_encoded
+#define lttng_ust__field_array_encoded(_type, _item, _src, _byte_order, _length, _encoding,     \
                        _nowrite, _elem_type_base)                               \
        if (0)                                                                   \
                (void) (_src);  /* Unused */                                     \
@@ -587,8 +587,8 @@ size_t lttng_ust__event_get_size__##_provider##___##_name(                        \
                __stack_data += sizeof(double);                                \
        }
 
-#undef _ctf_array_encoded
-#define _ctf_array_encoded(_type, _item, _src, _byte_order, _length,          \
+#undef lttng_ust__field_array_encoded
+#define lttng_ust__field_array_encoded(_type, _item, _src, _byte_order, _length,              \
                        _encoding, _nowrite, _elem_type_base)                  \
        {                                                                      \
                unsigned long __ctf_tmp_ulong = (unsigned long) (_length);     \
@@ -673,8 +673,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_array_encoded
-#define _ctf_array_encoded(_type, _item, _src, _byte_order, _length,          \
+#undef lttng_ust__field_array_encoded
+#define lttng_ust__field_array_encoded(_type, _item, _src, _byte_order, _length,              \
                        _encoding, _nowrite, _elem_type_base)                  \
        if (0)                                                                 \
                (void) (_src);  /* Unused */                                   \
@@ -751,8 +751,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_array_encoded
-#define _ctf_array_encoded(_type, _item, _src, _byte_order, _length,   \
+#undef lttng_ust__field_array_encoded
+#define lttng_ust__field_array_encoded(_type, _item, _src, _byte_order, _length,       \
                        _encoding, _nowrite, _elem_type_base)           \
        if (lttng_ust_string_encoding_##_encoding == lttng_ust_string_encoding_none) \
                __chan->ops->event_write(&__ctx, _src, sizeof(_type) * (_length), lttng_ust_rb_alignof(_type)); \
index 13d2a7ae1a3049d6815b707320977604678ea2be..d2747d4a6a388b6ac312f4e7b2528048e4de9209 100644 (file)
 #endif
 
 /**
- * lttng_ust_ctf_array_element_type_is_supported -
+ * lttng_ust_field_array_element_type_is_supported -
  *
- * Adds a compilation assertion that CTF arrays and sequences declared by the
+ * Adds a compilation assertion that array and sequence fields declared by the
  * user are of an integral type.
  */
-#define lttng_ust_ctf_array_element_type_is_supported(type, item) \
+#define lttng_ust_field_array_element_type_is_supported(type, item) \
                lttng_ust_static_assert(lttng_ust_is_integer_type(type), \
-                       "Non-integer type `" #item "` not supported as element of CTF_ARRAY or CTF_SEQUENCE", \
-                       Non_integer_type__##item##__not_supported_as_element_of_CTF_ARRAY_or_CTF_SEQUENCE)
+                       "Non-integer type `" #item "` not supported as element of LTTNG_UST_FIELD_ARRAY or LTTNG_UST_FIELD_SEQUENCE", \
+                       Non_integer_type__##item##__not_supported_as_element_of_LTTNG_UST_FIELD_ARRAY_or_LTTNG_UST_FIELD_SEQUENCE)
 
 
 /**
index 0805d5464836c8c3b82185df9e22c4122b6a8b45..d3b18a667bc68c3afac4e78b67fe2203c6e6dd42 100644 (file)
@@ -88,7 +88,7 @@ LTTNG_UST_TRACEPOINT_EVENT(lttng_ust_statedump, procname,
        ),
        LTTNG_UST_TP_FIELDS(
                ctf_unused(session)
-               ctf_array_text(char, procname, name, LTTNG_UST_ABI_PROCNAME_LEN)
+               lttng_ust_field_array_text(char, procname, name, LTTNG_UST_ABI_PROCNAME_LEN)
        )
 )
 
index 9fba556e23fa9d8e64b02c85d89b91c16589977e..4bcbce9a70bde6cb081f5ef86e26d0a93a5896f8 100644 (file)
@@ -35,8 +35,8 @@ LTTNG_UST_TRACEPOINT_EVENT(ust_tests_hello, tptest,
                lttng_ust_field_integer(long, longfield, anint)
                lttng_ust_field_integer_network(int, netintfield, netint)
                lttng_ust_field_integer_network_hex(int, netintfieldhex, netint)
-               ctf_array(long, arrfield1, values, 3)
-               ctf_array_text(char, arrfield2, text, 10)
+               lttng_ust_field_array(long, arrfield1, values, 3)
+               lttng_ust_field_array_text(char, arrfield2, text, 10)
                ctf_sequence(char, seqfield1, text,
                             size_t, textlen)
                ctf_sequence_text(char, seqfield2, text,
index 7cc92a27d14571f528777220c7cc6160ecaf3aba..450096d2e2652032b658c0b0c6a95f3eef5d0a65 100644 (file)
@@ -25,13 +25,13 @@ LTTNG_UST_TRACEPOINT_EVENT(ust_tests_hello, tptest,
                lttng_ust_field_integer(long, longfield, anint)
                lttng_ust_field_integer_network(int, netintfield, netint)
                lttng_ust_field_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)
-               ctf_array_network_hex(long, arrfield1_network_hex, values, 3)
-               ctf_array_text(char, arrfield2, text, 10)
+               lttng_ust_field_array_nowrite(long, arrfield1z, values, 3)
+               lttng_ust_field_array(long, blah, values, 3)
+               lttng_ust_field_array(long, arrfield1, values, 3)
+               lttng_ust_field_array_hex(long, arrfield1_hex, values, 3)
+               lttng_ust_field_array_network(long, arrfield1_network, values, 3)
+               lttng_ust_field_array_network_hex(long, arrfield1_network_hex, values, 3)
+               lttng_ust_field_array_text(char, arrfield2, text, 10)
                ctf_sequence(char, seqfield1, text,
                             size_t, textlen)
                ctf_sequence_nowrite(char, seqfield1z, text,
index 8d2ac30840713989515544fd5044f7bdbfb08982..86ee816c232c1112b4746d8cf2d748afe2a8587a 100644 (file)
@@ -25,8 +25,8 @@ LTTNG_UST_TRACEPOINT_EVENT(ust_tests_hello, tptest,
                lttng_ust_field_integer(long, longfield, anint)
                lttng_ust_field_integer_network(int, netintfield, netint)
                lttng_ust_field_integer_network_hex(int, netintfieldhex, netint)
-               ctf_array(long, arrfield1, values, 3)
-               ctf_array_text(char, arrfield2, text, 10)
+               lttng_ust_field_array(long, arrfield1, values, 3)
+               lttng_ust_field_array_text(char, arrfield2, text, 10)
                ctf_sequence(char, seqfield1, text,
                             size_t, textlen)
                ctf_sequence_text(char, seqfield2, text,
This page took 0.036223 seconds and 4 git commands to generate.