Remove has_strcpy check following probe provider version bump
authorMathieu Desnoyers <mathieu.desnoyers@efficios.com>
Thu, 2 Apr 2020 20:38:58 +0000 (16:38 -0400)
committerMathieu Desnoyers <mathieu.desnoyers@efficios.com>
Wed, 15 Apr 2020 16:57:28 +0000 (12:57 -0400)
Bumping the probe provider major version from 1 to 2 allows us to
remove a dynamic check within ctf_string() in the probe providers.

Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
include/lttng/ust-events.h
include/lttng/ust-tracepoint-event.h

index 4b31c0e1a9d7ee9bff03208ebdc121f79d3a89e0..938e12bcd248cdd31f9352d42c88de30fed34b46 100644 (file)
@@ -503,6 +503,13 @@ struct lttng_channel_ops {
        void (*channel_destroy)(struct lttng_channel *chan);
        union {
                void *_deprecated1;
+               /*
+                * has_strcpy is needed by probe providers version 1.0 to
+                * dynamically detect whether the LTTng-UST tracepoint
+                * provider ABI implements event_strcpy. Starting from
+                * probe providers version 2.0, the check is not needed,
+                * but backward compatibility is provided for older versions.
+                */
                unsigned long has_strcpy:1;             /* ABI has strcpy */
        } u;
        void *_deprecated2;
index 380593b04d3fa8c1f6ade28056bbdb17fb8fedd6..ff266e8f5f704aaaa3fed43ef8239a96daa8351c 100644 (file)
@@ -691,15 +691,6 @@ size_t __event_get_align__##_provider##___##_name(_TP_ARGS_PROTO(_args))      \
        __chan->ops->event_write(&__ctx, _src,                          \
                sizeof(_type) * __get_dynamic_len(dest));
 
-/*
- * __chan->ops->u.has_strcpy is a flag letting us know if the LTTng-UST
- * tracepoint provider ABI implements event_strcpy. This dynamic check
- * can be removed when the tracepoint provider ABI moves to 2.
- */
-#if (LTTNG_UST_PROVIDER_MAJOR > 1)
-#error "Tracepoint probe provider major version has changed. Please remove dynamic check for has_strcpy."
-#endif
-
 #undef _ctf_string
 #define _ctf_string(_item, _src, _nowrite)                             \
        {                                                                       \
@@ -707,12 +698,8 @@ size_t __event_get_align__##_provider##___##_name(_TP_ARGS_PROTO(_args))      \
                        ((_src) ? (_src) : __LTTNG_UST_NULL_STRING);            \
                lib_ring_buffer_align_ctx(&__ctx,                               \
                        lttng_alignof(*__ctf_tmp_string));                      \
-               if (__chan->ops->u.has_strcpy)                                  \
-                       __chan->ops->event_strcpy(&__ctx, __ctf_tmp_string,     \
-                               __get_dynamic_len(dest));                       \
-               else                                                            \
-                       __chan->ops->event_write(&__ctx, __ctf_tmp_string,      \
-                               __get_dynamic_len(dest));                       \
+               __chan->ops->event_strcpy(&__ctx, __ctf_tmp_string,             \
+                       __get_dynamic_len(dest));                               \
        }
 
 
This page took 0.026557 seconds and 4 git commands to generate.