From: Mathieu Desnoyers Date: Thu, 2 Apr 2020 20:38:58 +0000 (-0400) Subject: Remove has_strcpy check following probe provider version bump X-Git-Tag: v2.13.0-rc1~516 X-Git-Url: https://git.lttng.org./?a=commitdiff_plain;h=f9ec4a97118c6ba6001af5a85d63512e0fc441a1;p=lttng-ust.git Remove has_strcpy check following probe provider version bump 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 --- diff --git a/include/lttng/ust-events.h b/include/lttng/ust-events.h index 4b31c0e1..938e12bc 100644 --- a/include/lttng/ust-events.h +++ b/include/lttng/ust-events.h @@ -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; diff --git a/include/lttng/ust-tracepoint-event.h b/include/lttng/ust-tracepoint-event.h index 380593b0..ff266e8f 100644 --- a/include/lttng/ust-tracepoint-event.h +++ b/include/lttng/ust-tracepoint-event.h @@ -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)); \ }