From: Michael Jeanson Date: Wed, 24 Mar 2021 16:04:21 +0000 (-0400) Subject: Namespace remaining symbols in lttng/ringbuffer-context.h X-Git-Tag: v2.13.0-rc1~191 X-Git-Url: https://git.lttng.org./?a=commitdiff_plain;h=3b8bedd809f1a5b56da5fc101a90b44263b0f473;p=lttng-ust.git Namespace remaining symbols in lttng/ringbuffer-context.h The major SONAME bump to '1' gives us the opportunity to properly namespace some older parts of the API. Change-Id: I0393d22738f8b98ac5ed73455aaaa0b84db0297d Signed-off-by: Michael Jeanson Signed-off-by: Mathieu Desnoyers --- diff --git a/include/lttng/ringbuffer-context.h b/include/lttng/ringbuffer-context.h index 0092a0f1..e22fee19 100644 --- a/include/lttng/ringbuffer-context.h +++ b/include/lttng/ringbuffer-context.h @@ -27,7 +27,7 @@ struct lttng_ust_lib_ring_buffer_ctx; * ring buffer context * * Context passed to lib_ring_buffer_reserve(), lib_ring_buffer_commit(), - * lib_ring_buffer_try_discard_reserve(), lib_ring_buffer_align_ctx() and + * lib_ring_buffer_try_discard_reserve(), lttng_ust_lib_ring_buffer_align_ctx() and * lib_ring_buffer_write(). * * IMPORTANT: this structure is part of the ABI between the probe and @@ -74,7 +74,7 @@ struct lttng_ust_lib_ring_buffer_ctx { }; /** - * lib_ring_buffer_ctx_init - initialize ring buffer context + * lttng_ust_lib_ring_buffer_ctx_init - initialize ring buffer context * @ctx: ring buffer context to initialize * @chan: channel * @priv: client private data @@ -82,11 +82,11 @@ struct lttng_ust_lib_ring_buffer_ctx { * @largest_align: largest alignment within data payload types */ static inline lttng_ust_notrace -void lib_ring_buffer_ctx_init(struct lttng_ust_lib_ring_buffer_ctx *ctx, +void lttng_ust_lib_ring_buffer_ctx_init(struct lttng_ust_lib_ring_buffer_ctx *ctx, struct lttng_ust_lib_ring_buffer_channel *chan, void *priv, size_t data_size, int largest_align); static inline -void lib_ring_buffer_ctx_init(struct lttng_ust_lib_ring_buffer_ctx *ctx, +void lttng_ust_lib_ring_buffer_ctx_init(struct lttng_ust_lib_ring_buffer_ctx *ctx, struct lttng_ust_lib_ring_buffer_channel *chan, void *priv, size_t data_size, int largest_align) { @@ -112,14 +112,14 @@ void lib_ring_buffer_ctx_init(struct lttng_ust_lib_ring_buffer_ctx *ctx, # define LTTNG_UST_RING_BUFFER_ALIGN_ATTR /* Default arch alignment */ /* - * lib_ring_buffer_align - Calculate the offset needed to align the type. + * lttng_ust_lib_ring_buffer_align - Calculate the offset needed to align the type. * @align_drift: object offset from an "alignment"-aligned address. * @size_of_type: Must be non-zero, power of 2. */ static inline lttng_ust_notrace -unsigned int lib_ring_buffer_align(size_t align_drift, size_t size_of_type); +unsigned int lttng_ust_lib_ring_buffer_align(size_t align_drift, size_t size_of_type); static inline -unsigned int lib_ring_buffer_align(size_t align_drift, size_t size_of_type) +unsigned int lttng_ust_lib_ring_buffer_align(size_t align_drift, size_t size_of_type) { return lttng_ust_offset_align(align_drift, size_of_type); } @@ -129,14 +129,14 @@ unsigned int lib_ring_buffer_align(size_t align_drift, size_t size_of_type) # define LTTNG_UST_RING_BUFFER_ALIGN_ATTR __attribute__((packed)) /* - * lib_ring_buffer_align - Calculate the offset needed to align the type. + * lttng_ust_lib_ring_buffer_align - Calculate the offset needed to align the type. * @align_drift: object offset from an "alignment"-aligned address. * @size_of_type: Must be non-zero, power of 2. */ static inline lttng_ust_notrace -unsigned int lib_ring_buffer_align(size_t align_drift, size_t size_of_type); +unsigned int lttng_ust_lib_ring_buffer_align(size_t align_drift, size_t size_of_type); static inline -unsigned int lib_ring_buffer_align(size_t align_drift, size_t size_of_type) +unsigned int lttng_ust_lib_ring_buffer_align(size_t align_drift, size_t size_of_type) { /* * On architectures with efficient unaligned memory access, the content @@ -148,17 +148,17 @@ unsigned int lib_ring_buffer_align(size_t align_drift, size_t size_of_type) #endif /** - * lib_ring_buffer_align_ctx - Align context offset on "alignment" + * lttng_ust_lib_ring_buffer_align_ctx - Align context offset on "alignment" * @ctx: ring buffer context. */ static inline lttng_ust_notrace -void lib_ring_buffer_align_ctx(struct lttng_ust_lib_ring_buffer_ctx *ctx, +void lttng_ust_lib_ring_buffer_align_ctx(struct lttng_ust_lib_ring_buffer_ctx *ctx, size_t alignment); static inline -void lib_ring_buffer_align_ctx(struct lttng_ust_lib_ring_buffer_ctx *ctx, +void lttng_ust_lib_ring_buffer_align_ctx(struct lttng_ust_lib_ring_buffer_ctx *ctx, size_t alignment) { - ctx->buf_offset += lib_ring_buffer_align(ctx->buf_offset, + ctx->buf_offset += lttng_ust_lib_ring_buffer_align(ctx->buf_offset, alignment); } diff --git a/include/lttng/ust-tracepoint-event.h b/include/lttng/ust-tracepoint-event.h index 7cde38cf..48a24488 100644 --- a/include/lttng/ust-tracepoint-event.h +++ b/include/lttng/ust-tracepoint-event.h @@ -406,26 +406,26 @@ static void __event_probe__##_provider##___##_name(_TP_ARGS_DATA_PROTO(_args)); #undef _ctf_integer_ext #define _ctf_integer_ext(_type, _item, _src, _byte_order, _base, _nowrite) \ - __event_len += lib_ring_buffer_align(__event_len, lttng_alignof(_type)); \ + __event_len += lttng_ust_lib_ring_buffer_align(__event_len, lttng_alignof(_type)); \ __event_len += sizeof(_type); #undef _ctf_float #define _ctf_float(_type, _item, _src, _nowrite) \ - __event_len += lib_ring_buffer_align(__event_len, lttng_alignof(_type)); \ + __event_len += lttng_ust_lib_ring_buffer_align(__event_len, lttng_alignof(_type)); \ __event_len += sizeof(_type); #undef _ctf_array_encoded #define _ctf_array_encoded(_type, _item, _src, _byte_order, _length, _encoding, \ _nowrite, _elem_type_base) \ - __event_len += lib_ring_buffer_align(__event_len, lttng_alignof(_type)); \ + __event_len += lttng_ust_lib_ring_buffer_align(__event_len, lttng_alignof(_type)); \ __event_len += sizeof(_type) * (_length); #undef _ctf_sequence_encoded #define _ctf_sequence_encoded(_type, _item, _src, _byte_order, _length_type, \ _src_length, _encoding, _nowrite, _elem_type_base) \ - __event_len += lib_ring_buffer_align(__event_len, lttng_alignof(_length_type)); \ + __event_len += lttng_ust_lib_ring_buffer_align(__event_len, lttng_alignof(_length_type)); \ __event_len += sizeof(_length_type); \ - __event_len += lib_ring_buffer_align(__event_len, lttng_alignof(_type)); \ + __event_len += lttng_ust_lib_ring_buffer_align(__event_len, lttng_alignof(_type)); \ __dynamic_len[__dynamic_len_idx] = (_src_length); \ __event_len += sizeof(_type) * __dynamic_len[__dynamic_len_idx]; \ __dynamic_len_idx++; @@ -688,7 +688,7 @@ size_t __event_get_align__##_provider##___##_name(_TP_ARGS_PROTO(_args)) \ #define _ctf_integer_ext(_type, _item, _src, _byte_order, _base, _nowrite) \ { \ _type __tmp = (_src); \ - lib_ring_buffer_align_ctx(&__ctx, lttng_alignof(__tmp));\ + lttng_ust_lib_ring_buffer_align_ctx(&__ctx, lttng_alignof(__tmp));\ __chan->ops->event_write(&__ctx, &__tmp, sizeof(__tmp));\ } @@ -696,14 +696,14 @@ size_t __event_get_align__##_provider##___##_name(_TP_ARGS_PROTO(_args)) \ #define _ctf_float(_type, _item, _src, _nowrite) \ { \ _type __tmp = (_src); \ - lib_ring_buffer_align_ctx(&__ctx, lttng_alignof(__tmp));\ + lttng_ust_lib_ring_buffer_align_ctx(&__ctx, lttng_alignof(__tmp));\ __chan->ops->event_write(&__ctx, &__tmp, sizeof(__tmp));\ } #undef _ctf_array_encoded #define _ctf_array_encoded(_type, _item, _src, _byte_order, _length, \ _encoding, _nowrite, _elem_type_base) \ - lib_ring_buffer_align_ctx(&__ctx, lttng_alignof(_type)); \ + lttng_ust_lib_ring_buffer_align_ctx(&__ctx, lttng_alignof(_type)); \ if (lttng_ust_string_encoding_##_encoding == lttng_ust_string_encoding_none) \ __chan->ops->event_write(&__ctx, _src, sizeof(_type) * (_length)); \ else \ @@ -714,10 +714,10 @@ size_t __event_get_align__##_provider##___##_name(_TP_ARGS_PROTO(_args)) \ _src_length, _encoding, _nowrite, _elem_type_base) \ { \ _length_type __tmpl = __stackvar.__dynamic_len[__dynamic_len_idx]; \ - lib_ring_buffer_align_ctx(&__ctx, lttng_alignof(_length_type));\ + lttng_ust_lib_ring_buffer_align_ctx(&__ctx, lttng_alignof(_length_type));\ __chan->ops->event_write(&__ctx, &__tmpl, sizeof(_length_type));\ } \ - lib_ring_buffer_align_ctx(&__ctx, lttng_alignof(_type)); \ + lttng_ust_lib_ring_buffer_align_ctx(&__ctx, lttng_alignof(_type)); \ if (lttng_ust_string_encoding_##_encoding == lttng_ust_string_encoding_none) \ __chan->ops->event_write(&__ctx, _src, \ sizeof(_type) * __get_dynamic_len(dest)); \ @@ -729,7 +729,7 @@ size_t __event_get_align__##_provider##___##_name(_TP_ARGS_PROTO(_args)) \ { \ const char *__ctf_tmp_string = \ ((_src) ? (_src) : __LTTNG_UST_NULL_STRING); \ - lib_ring_buffer_align_ctx(&__ctx, \ + lttng_ust_lib_ring_buffer_align_ctx(&__ctx, \ lttng_alignof(*__ctf_tmp_string)); \ __chan->ops->event_strcpy(&__ctx, __ctf_tmp_string, \ __get_dynamic_len(dest)); \ @@ -852,7 +852,7 @@ void __event_probe__##_provider##___##_name(_TP_ARGS_DATA_PROTO(_args)) \ memset(&__lttng_ctx, 0, sizeof(__lttng_ctx)); \ __lttng_ctx.struct_size = sizeof(struct lttng_ust_stack_ctx); \ __lttng_ctx.event_recorder = __event_recorder; \ - lib_ring_buffer_ctx_init(&__ctx, NULL, &__lttng_ctx, __event_len, __event_align); \ + lttng_ust_lib_ring_buffer_ctx_init(&__ctx, NULL, &__lttng_ctx, __event_len, __event_align); \ __ctx.ip = _TP_IP_PARAM(TP_IP_PARAM); \ __ret = __chan->ops->event_reserve(&__ctx, __event_recorder->id); \ if (__ret < 0) \ diff --git a/liblttng-ust-ctl/ustctl.c b/liblttng-ust-ctl/ustctl.c index eec3aeca..28385990 100644 --- a/liblttng-ust-ctl/ustctl.c +++ b/liblttng-ust-ctl/ustctl.c @@ -1353,7 +1353,7 @@ int ustctl_write_metadata_to_channel( reserve_len = min_t(size_t, lttng_chan_buf->ops->priv->packet_avail_size(lttng_chan_buf), len - pos); - lib_ring_buffer_ctx_init(&ctx, rb_chan, NULL, reserve_len, sizeof(char)); + lttng_ust_lib_ring_buffer_ctx_init(&ctx, rb_chan, NULL, reserve_len, sizeof(char)); /* * We don't care about metadata buffer's records lost * count, because we always retry here. Report error if @@ -1400,7 +1400,7 @@ ssize_t ustctl_write_one_packet_to_channel( reserve_len = min_t(ssize_t, lttng_chan_buf->ops->priv->packet_avail_size(lttng_chan_buf), len); - lib_ring_buffer_ctx_init(&ctx, rb_chan, NULL, reserve_len, sizeof(char)); + lttng_ust_lib_ring_buffer_ctx_init(&ctx, rb_chan, NULL, reserve_len, sizeof(char)); ret = lttng_chan_buf->ops->event_reserve(&ctx, 0); if (ret != 0) { DBG("LTTng: event reservation failed"); diff --git a/liblttng-ust-java-agent/jni/common/lttng_ust_context.c b/liblttng-ust-java-agent/jni/common/lttng_ust_context.c index ae478ba3..43d396d7 100644 --- a/liblttng-ust-java-agent/jni/common/lttng_ust_context.c +++ b/liblttng-ust-java-agent/jni/common/lttng_ust_context.c @@ -81,7 +81,7 @@ static size_t get_size_cb(struct lttng_ust_ctx_field *field, size_t offset) enum lttng_ust_jni_type jni_type; - size += lib_ring_buffer_align(offset, lttng_alignof(char)); + size += lttng_ust_lib_ring_buffer_align(offset, lttng_alignof(char)); size += sizeof(char); /* tag */ jctx = lookup_ctx_by_name(ctx_name); if (!jctx) { @@ -93,28 +93,28 @@ static size_t get_size_cb(struct lttng_ust_ctx_field *field, size_t offset) case JNI_TYPE_NULL: break; case JNI_TYPE_INTEGER: - size += lib_ring_buffer_align(offset, lttng_alignof(int32_t)); + size += lttng_ust_lib_ring_buffer_align(offset, lttng_alignof(int32_t)); size += sizeof(int32_t); /* variant */ break; case JNI_TYPE_LONG: - size += lib_ring_buffer_align(offset, lttng_alignof(int64_t)); + size += lttng_ust_lib_ring_buffer_align(offset, lttng_alignof(int64_t)); size += sizeof(int64_t); /* variant */ break; case JNI_TYPE_DOUBLE: - size += lib_ring_buffer_align(offset, lttng_alignof(double)); + size += lttng_ust_lib_ring_buffer_align(offset, lttng_alignof(double)); size += sizeof(double); /* variant */ break; case JNI_TYPE_FLOAT: - size += lib_ring_buffer_align(offset, lttng_alignof(float)); + size += lttng_ust_lib_ring_buffer_align(offset, lttng_alignof(float)); size += sizeof(float); /* variant */ break; case JNI_TYPE_SHORT: - size += lib_ring_buffer_align(offset, lttng_alignof(int16_t)); + size += lttng_ust_lib_ring_buffer_align(offset, lttng_alignof(int16_t)); size += sizeof(int16_t); /* variant */ break; case JNI_TYPE_BYTE: /* Fall-through. */ case JNI_TYPE_BOOLEAN: - size += lib_ring_buffer_align(offset, lttng_alignof(char)); + size += lttng_ust_lib_ring_buffer_align(offset, lttng_alignof(char)); size += sizeof(char); /* variant */ break; case JNI_TYPE_STRING: @@ -154,7 +154,7 @@ static void record_cb(struct lttng_ust_ctx_field *field, switch (jni_type) { case JNI_TYPE_NULL: sel_char = LTTNG_UST_DYNAMIC_TYPE_NONE; - lib_ring_buffer_align_ctx(ctx, lttng_alignof(char)); + lttng_ust_lib_ring_buffer_align_ctx(ctx, lttng_alignof(char)); lttng_chan_buf->ops->event_write(ctx, &sel_char, sizeof(sel_char)); break; case JNI_TYPE_INTEGER: @@ -162,9 +162,9 @@ static void record_cb(struct lttng_ust_ctx_field *field, int32_t v = jctx->value._integer; sel_char = LTTNG_UST_DYNAMIC_TYPE_S32; - lib_ring_buffer_align_ctx(ctx, lttng_alignof(char)); + lttng_ust_lib_ring_buffer_align_ctx(ctx, lttng_alignof(char)); lttng_chan_buf->ops->event_write(ctx, &sel_char, sizeof(sel_char)); - lib_ring_buffer_align_ctx(ctx, lttng_alignof(v)); + lttng_ust_lib_ring_buffer_align_ctx(ctx, lttng_alignof(v)); lttng_chan_buf->ops->event_write(ctx, &v, sizeof(v)); break; } @@ -173,9 +173,9 @@ static void record_cb(struct lttng_ust_ctx_field *field, int64_t v = jctx->value._long; sel_char = LTTNG_UST_DYNAMIC_TYPE_S64; - lib_ring_buffer_align_ctx(ctx, lttng_alignof(char)); + lttng_ust_lib_ring_buffer_align_ctx(ctx, lttng_alignof(char)); lttng_chan_buf->ops->event_write(ctx, &sel_char, sizeof(sel_char)); - lib_ring_buffer_align_ctx(ctx, lttng_alignof(v)); + lttng_ust_lib_ring_buffer_align_ctx(ctx, lttng_alignof(v)); lttng_chan_buf->ops->event_write(ctx, &v, sizeof(v)); break; } @@ -184,9 +184,9 @@ static void record_cb(struct lttng_ust_ctx_field *field, double v = jctx->value._double; sel_char = LTTNG_UST_DYNAMIC_TYPE_DOUBLE; - lib_ring_buffer_align_ctx(ctx, lttng_alignof(char)); + lttng_ust_lib_ring_buffer_align_ctx(ctx, lttng_alignof(char)); lttng_chan_buf->ops->event_write(ctx, &sel_char, sizeof(sel_char)); - lib_ring_buffer_align_ctx(ctx, lttng_alignof(v)); + lttng_ust_lib_ring_buffer_align_ctx(ctx, lttng_alignof(v)); lttng_chan_buf->ops->event_write(ctx, &v, sizeof(v)); break; } @@ -195,9 +195,9 @@ static void record_cb(struct lttng_ust_ctx_field *field, float v = jctx->value._float; sel_char = LTTNG_UST_DYNAMIC_TYPE_FLOAT; - lib_ring_buffer_align_ctx(ctx, lttng_alignof(char)); + lttng_ust_lib_ring_buffer_align_ctx(ctx, lttng_alignof(char)); lttng_chan_buf->ops->event_write(ctx, &sel_char, sizeof(sel_char)); - lib_ring_buffer_align_ctx(ctx, lttng_alignof(v)); + lttng_ust_lib_ring_buffer_align_ctx(ctx, lttng_alignof(v)); lttng_chan_buf->ops->event_write(ctx, &v, sizeof(v)); break; } @@ -206,9 +206,9 @@ static void record_cb(struct lttng_ust_ctx_field *field, int16_t v = jctx->value._short; sel_char = LTTNG_UST_DYNAMIC_TYPE_S16; - lib_ring_buffer_align_ctx(ctx, lttng_alignof(char)); + lttng_ust_lib_ring_buffer_align_ctx(ctx, lttng_alignof(char)); lttng_chan_buf->ops->event_write(ctx, &sel_char, sizeof(sel_char)); - lib_ring_buffer_align_ctx(ctx, lttng_alignof(v)); + lttng_ust_lib_ring_buffer_align_ctx(ctx, lttng_alignof(v)); lttng_chan_buf->ops->event_write(ctx, &v, sizeof(v)); break; } @@ -217,9 +217,9 @@ static void record_cb(struct lttng_ust_ctx_field *field, char v = jctx->value._byte; sel_char = LTTNG_UST_DYNAMIC_TYPE_S8; - lib_ring_buffer_align_ctx(ctx, lttng_alignof(char)); + lttng_ust_lib_ring_buffer_align_ctx(ctx, lttng_alignof(char)); lttng_chan_buf->ops->event_write(ctx, &sel_char, sizeof(sel_char)); - lib_ring_buffer_align_ctx(ctx, lttng_alignof(v)); + lttng_ust_lib_ring_buffer_align_ctx(ctx, lttng_alignof(v)); lttng_chan_buf->ops->event_write(ctx, &v, sizeof(v)); break; } @@ -228,9 +228,9 @@ static void record_cb(struct lttng_ust_ctx_field *field, char v = jctx->value._boolean; sel_char = LTTNG_UST_DYNAMIC_TYPE_S8; - lib_ring_buffer_align_ctx(ctx, lttng_alignof(char)); + lttng_ust_lib_ring_buffer_align_ctx(ctx, lttng_alignof(char)); lttng_chan_buf->ops->event_write(ctx, &sel_char, sizeof(sel_char)); - lib_ring_buffer_align_ctx(ctx, lttng_alignof(v)); + lttng_ust_lib_ring_buffer_align_ctx(ctx, lttng_alignof(v)); lttng_chan_buf->ops->event_write(ctx, &v, sizeof(v)); break; } @@ -244,7 +244,7 @@ static void record_cb(struct lttng_ust_ctx_field *field, } else { sel_char = LTTNG_UST_DYNAMIC_TYPE_NONE; } - lib_ring_buffer_align_ctx(ctx, lttng_alignof(char)); + lttng_ust_lib_ring_buffer_align_ctx(ctx, lttng_alignof(char)); lttng_chan_buf->ops->event_write(ctx, &sel_char, sizeof(sel_char)); if (str) { lttng_chan_buf->ops->event_write(ctx, str, strlen(str) + 1); diff --git a/liblttng-ust/lttng-context-cgroup-ns.c b/liblttng-ust/lttng-context-cgroup-ns.c index 5c0394d3..31de1cd2 100644 --- a/liblttng-ust/lttng-context-cgroup-ns.c +++ b/liblttng-ust/lttng-context-cgroup-ns.c @@ -95,7 +95,7 @@ size_t cgroup_ns_get_size(struct lttng_ust_ctx_field *field, size_t offset) { size_t size = 0; - size += lib_ring_buffer_align(offset, lttng_alignof(ino_t)); + size += lttng_ust_lib_ring_buffer_align(offset, lttng_alignof(ino_t)); size += sizeof(ino_t); return size; } @@ -108,7 +108,7 @@ void cgroup_ns_record(struct lttng_ust_ctx_field *field, ino_t cgroup_ns; cgroup_ns = get_cgroup_ns(); - lib_ring_buffer_align_ctx(ctx, lttng_alignof(cgroup_ns)); + lttng_ust_lib_ring_buffer_align_ctx(ctx, lttng_alignof(cgroup_ns)); chan->ops->event_write(ctx, &cgroup_ns, sizeof(cgroup_ns)); } diff --git a/liblttng-ust/lttng-context-cpu-id.c b/liblttng-ust/lttng-context-cpu-id.c index 8636b1ba..40d0cf9f 100644 --- a/liblttng-ust/lttng-context-cpu-id.c +++ b/liblttng-ust/lttng-context-cpu-id.c @@ -29,7 +29,7 @@ size_t cpu_id_get_size(struct lttng_ust_ctx_field *field, size_t offset) { size_t size = 0; - size += lib_ring_buffer_align(offset, lttng_alignof(int)); + size += lttng_ust_lib_ring_buffer_align(offset, lttng_alignof(int)); size += sizeof(int); return size; } @@ -42,7 +42,7 @@ void cpu_id_record(struct lttng_ust_ctx_field *field, int cpu; cpu = lttng_ust_get_cpu(); - lib_ring_buffer_align_ctx(ctx, lttng_alignof(cpu)); + lttng_ust_lib_ring_buffer_align_ctx(ctx, lttng_alignof(cpu)); chan->ops->event_write(ctx, &cpu, sizeof(cpu)); } diff --git a/liblttng-ust/lttng-context-ip.c b/liblttng-ust/lttng-context-ip.c index 903123a7..b75c8a01 100644 --- a/liblttng-ust/lttng-context-ip.c +++ b/liblttng-ust/lttng-context-ip.c @@ -22,7 +22,7 @@ size_t ip_get_size(struct lttng_ust_ctx_field *field, size_t offset) { size_t size = 0; - size += lib_ring_buffer_align(offset, lttng_alignof(void *)); + size += lttng_ust_lib_ring_buffer_align(offset, lttng_alignof(void *)); size += sizeof(void *); return size; } @@ -35,7 +35,7 @@ void ip_record(struct lttng_ust_ctx_field *field, void *ip; ip = ctx->ip; - lib_ring_buffer_align_ctx(ctx, lttng_alignof(ip)); + lttng_ust_lib_ring_buffer_align_ctx(ctx, lttng_alignof(ip)); chan->ops->event_write(ctx, &ip, sizeof(ip)); } diff --git a/liblttng-ust/lttng-context-ipc-ns.c b/liblttng-ust/lttng-context-ipc-ns.c index 4186d4e7..4bebb8d8 100644 --- a/liblttng-ust/lttng-context-ipc-ns.c +++ b/liblttng-ust/lttng-context-ipc-ns.c @@ -94,7 +94,7 @@ size_t ipc_ns_get_size(struct lttng_ust_ctx_field *field, size_t offset) { size_t size = 0; - size += lib_ring_buffer_align(offset, lttng_alignof(ino_t)); + size += lttng_ust_lib_ring_buffer_align(offset, lttng_alignof(ino_t)); size += sizeof(ino_t); return size; } @@ -107,7 +107,7 @@ void ipc_ns_record(struct lttng_ust_ctx_field *field, ino_t ipc_ns; ipc_ns = get_ipc_ns(); - lib_ring_buffer_align_ctx(ctx, lttng_alignof(ipc_ns)); + lttng_ust_lib_ring_buffer_align_ctx(ctx, lttng_alignof(ipc_ns)); chan->ops->event_write(ctx, &ipc_ns, sizeof(ipc_ns)); } diff --git a/liblttng-ust/lttng-context-mnt-ns.c b/liblttng-ust/lttng-context-mnt-ns.c index 6f9fe80a..01b3087f 100644 --- a/liblttng-ust/lttng-context-mnt-ns.c +++ b/liblttng-ust/lttng-context-mnt-ns.c @@ -77,7 +77,7 @@ size_t mnt_ns_get_size(struct lttng_ust_ctx_field *field, size_t offset) { size_t size = 0; - size += lib_ring_buffer_align(offset, lttng_alignof(ino_t)); + size += lttng_ust_lib_ring_buffer_align(offset, lttng_alignof(ino_t)); size += sizeof(ino_t); return size; } @@ -90,7 +90,7 @@ void mnt_ns_record(struct lttng_ust_ctx_field *field, ino_t mnt_ns; mnt_ns = get_mnt_ns(); - lib_ring_buffer_align_ctx(ctx, lttng_alignof(mnt_ns)); + lttng_ust_lib_ring_buffer_align_ctx(ctx, lttng_alignof(mnt_ns)); chan->ops->event_write(ctx, &mnt_ns, sizeof(mnt_ns)); } diff --git a/liblttng-ust/lttng-context-net-ns.c b/liblttng-ust/lttng-context-net-ns.c index 3cbfd391..5b5dbac4 100644 --- a/liblttng-ust/lttng-context-net-ns.c +++ b/liblttng-ust/lttng-context-net-ns.c @@ -94,7 +94,7 @@ size_t net_ns_get_size(struct lttng_ust_ctx_field *field, size_t offset) { size_t size = 0; - size += lib_ring_buffer_align(offset, lttng_alignof(ino_t)); + size += lttng_ust_lib_ring_buffer_align(offset, lttng_alignof(ino_t)); size += sizeof(ino_t); return size; } @@ -107,7 +107,7 @@ void net_ns_record(struct lttng_ust_ctx_field *field, ino_t net_ns; net_ns = get_net_ns(); - lib_ring_buffer_align_ctx(ctx, lttng_alignof(net_ns)); + lttng_ust_lib_ring_buffer_align_ctx(ctx, lttng_alignof(net_ns)); chan->ops->event_write(ctx, &net_ns, sizeof(net_ns)); } diff --git a/liblttng-ust/lttng-context-perf-counters.c b/liblttng-ust/lttng-context-perf-counters.c index df10e4f1..75f6e66f 100644 --- a/liblttng-ust/lttng-context-perf-counters.c +++ b/liblttng-ust/lttng-context-perf-counters.c @@ -162,7 +162,7 @@ size_t perf_counter_get_size(struct lttng_ust_ctx_field *field, size_t offset) { size_t size = 0; - size += lib_ring_buffer_align(offset, lttng_alignof(uint64_t)); + size += lttng_ust_lib_ring_buffer_align(offset, lttng_alignof(uint64_t)); size += sizeof(uint64_t); return size; } @@ -445,7 +445,7 @@ void perf_counter_record(struct lttng_ust_ctx_field *field, uint64_t value; value = wrapper_perf_counter_read(field); - lib_ring_buffer_align_ctx(ctx, lttng_alignof(value)); + lttng_ust_lib_ring_buffer_align_ctx(ctx, lttng_alignof(value)); chan->ops->event_write(ctx, &value, sizeof(value)); } diff --git a/liblttng-ust/lttng-context-pid-ns.c b/liblttng-ust/lttng-context-pid-ns.c index 9a06a15d..a24bfb50 100644 --- a/liblttng-ust/lttng-context-pid-ns.c +++ b/liblttng-ust/lttng-context-pid-ns.c @@ -80,7 +80,7 @@ size_t pid_ns_get_size(struct lttng_ust_ctx_field *field, size_t offset) { size_t size = 0; - size += lib_ring_buffer_align(offset, lttng_alignof(ino_t)); + size += lttng_ust_lib_ring_buffer_align(offset, lttng_alignof(ino_t)); size += sizeof(ino_t); return size; } @@ -93,7 +93,7 @@ void pid_ns_record(struct lttng_ust_ctx_field *field, ino_t pid_ns; pid_ns = get_pid_ns(); - lib_ring_buffer_align_ctx(ctx, lttng_alignof(pid_ns)); + lttng_ust_lib_ring_buffer_align_ctx(ctx, lttng_alignof(pid_ns)); chan->ops->event_write(ctx, &pid_ns, sizeof(pid_ns)); } diff --git a/liblttng-ust/lttng-context-pthread-id.c b/liblttng-ust/lttng-context-pthread-id.c index bc235826..ba371d7c 100644 --- a/liblttng-ust/lttng-context-pthread-id.c +++ b/liblttng-ust/lttng-context-pthread-id.c @@ -21,7 +21,7 @@ size_t pthread_id_get_size(struct lttng_ust_ctx_field *field, size_t offset) { size_t size = 0; - size += lib_ring_buffer_align(offset, lttng_alignof(unsigned long)); + size += lttng_ust_lib_ring_buffer_align(offset, lttng_alignof(unsigned long)); size += sizeof(unsigned long); return size; } @@ -34,7 +34,7 @@ void pthread_id_record(struct lttng_ust_ctx_field *field, unsigned long pthread_id; pthread_id = (unsigned long) pthread_self(); - lib_ring_buffer_align_ctx(ctx, lttng_alignof(pthread_id)); + lttng_ust_lib_ring_buffer_align_ctx(ctx, lttng_alignof(pthread_id)); chan->ops->event_write(ctx, &pthread_id, sizeof(pthread_id)); } diff --git a/liblttng-ust/lttng-context-time-ns.c b/liblttng-ust/lttng-context-time-ns.c index d487189e..83210e3e 100644 --- a/liblttng-ust/lttng-context-time-ns.c +++ b/liblttng-ust/lttng-context-time-ns.c @@ -93,7 +93,7 @@ size_t time_ns_get_size(struct lttng_ust_ctx_field *field, size_t offset) { size_t size = 0; - size += lib_ring_buffer_align(offset, lttng_alignof(ino_t)); + size += lttng_ust_lib_ring_buffer_align(offset, lttng_alignof(ino_t)); size += sizeof(ino_t); return size; } @@ -106,7 +106,7 @@ void time_ns_record(struct lttng_ust_ctx_field *field, ino_t time_ns; time_ns = get_time_ns(); - lib_ring_buffer_align_ctx(ctx, lttng_alignof(time_ns)); + lttng_ust_lib_ring_buffer_align_ctx(ctx, lttng_alignof(time_ns)); chan->ops->event_write(ctx, &time_ns, sizeof(time_ns)); } diff --git a/liblttng-ust/lttng-context-user-ns.c b/liblttng-ust/lttng-context-user-ns.c index a2916f94..f23ffe47 100644 --- a/liblttng-ust/lttng-context-user-ns.c +++ b/liblttng-ust/lttng-context-user-ns.c @@ -77,7 +77,7 @@ size_t user_ns_get_size(struct lttng_ust_ctx_field *field, size_t offset) { size_t size = 0; - size += lib_ring_buffer_align(offset, lttng_alignof(ino_t)); + size += lttng_ust_lib_ring_buffer_align(offset, lttng_alignof(ino_t)); size += sizeof(ino_t); return size; } @@ -90,7 +90,7 @@ void user_ns_record(struct lttng_ust_ctx_field *field, ino_t user_ns; user_ns = get_user_ns(); - lib_ring_buffer_align_ctx(ctx, lttng_alignof(user_ns)); + lttng_ust_lib_ring_buffer_align_ctx(ctx, lttng_alignof(user_ns)); chan->ops->event_write(ctx, &user_ns, sizeof(user_ns)); } diff --git a/liblttng-ust/lttng-context-uts-ns.c b/liblttng-ust/lttng-context-uts-ns.c index a8d03d98..2ce62aaf 100644 --- a/liblttng-ust/lttng-context-uts-ns.c +++ b/liblttng-ust/lttng-context-uts-ns.c @@ -95,7 +95,7 @@ size_t uts_ns_get_size(struct lttng_ust_ctx_field *field, size_t offset) { size_t size = 0; - size += lib_ring_buffer_align(offset, lttng_alignof(ino_t)); + size += lttng_ust_lib_ring_buffer_align(offset, lttng_alignof(ino_t)); size += sizeof(ino_t); return size; } @@ -108,7 +108,7 @@ void uts_ns_record(struct lttng_ust_ctx_field *field, ino_t uts_ns; uts_ns = get_uts_ns(); - lib_ring_buffer_align_ctx(ctx, lttng_alignof(uts_ns)); + lttng_ust_lib_ring_buffer_align_ctx(ctx, lttng_alignof(uts_ns)); chan->ops->event_write(ctx, &uts_ns, sizeof(uts_ns)); } diff --git a/liblttng-ust/lttng-context-vegid.c b/liblttng-ust/lttng-context-vegid.c index 065e9e15..eaa9ab66 100644 --- a/liblttng-ust/lttng-context-vegid.c +++ b/liblttng-ust/lttng-context-vegid.c @@ -66,7 +66,7 @@ size_t vegid_get_size(struct lttng_ust_ctx_field *field, size_t offset) { size_t size = 0; - size += lib_ring_buffer_align(offset, lttng_alignof(gid_t)); + size += lttng_ust_lib_ring_buffer_align(offset, lttng_alignof(gid_t)); size += sizeof(gid_t); return size; } @@ -79,7 +79,7 @@ void vegid_record(struct lttng_ust_ctx_field *field, gid_t vegid; vegid = get_vegid(); - lib_ring_buffer_align_ctx(ctx, lttng_alignof(vegid)); + lttng_ust_lib_ring_buffer_align_ctx(ctx, lttng_alignof(vegid)); chan->ops->event_write(ctx, &vegid, sizeof(vegid)); } diff --git a/liblttng-ust/lttng-context-veuid.c b/liblttng-ust/lttng-context-veuid.c index 7de2136b..7e877f23 100644 --- a/liblttng-ust/lttng-context-veuid.c +++ b/liblttng-ust/lttng-context-veuid.c @@ -66,7 +66,7 @@ size_t veuid_get_size(struct lttng_ust_ctx_field *field, size_t offset) { size_t size = 0; - size += lib_ring_buffer_align(offset, lttng_alignof(uid_t)); + size += lttng_ust_lib_ring_buffer_align(offset, lttng_alignof(uid_t)); size += sizeof(uid_t); return size; } @@ -79,7 +79,7 @@ void veuid_record(struct lttng_ust_ctx_field *field, uid_t veuid; veuid = get_veuid(); - lib_ring_buffer_align_ctx(ctx, lttng_alignof(veuid)); + lttng_ust_lib_ring_buffer_align_ctx(ctx, lttng_alignof(veuid)); chan->ops->event_write(ctx, &veuid, sizeof(veuid)); } diff --git a/liblttng-ust/lttng-context-vgid.c b/liblttng-ust/lttng-context-vgid.c index c1a630ac..cd04e951 100644 --- a/liblttng-ust/lttng-context-vgid.c +++ b/liblttng-ust/lttng-context-vgid.c @@ -66,7 +66,7 @@ size_t vgid_get_size(struct lttng_ust_ctx_field *field, size_t offset) { size_t size = 0; - size += lib_ring_buffer_align(offset, lttng_alignof(gid_t)); + size += lttng_ust_lib_ring_buffer_align(offset, lttng_alignof(gid_t)); size += sizeof(gid_t); return size; } @@ -79,7 +79,7 @@ void vgid_record(struct lttng_ust_ctx_field *field, gid_t vgid; vgid = get_vgid(); - lib_ring_buffer_align_ctx(ctx, lttng_alignof(vgid)); + lttng_ust_lib_ring_buffer_align_ctx(ctx, lttng_alignof(vgid)); chan->ops->event_write(ctx, &vgid, sizeof(vgid)); } diff --git a/liblttng-ust/lttng-context-vpid.c b/liblttng-ust/lttng-context-vpid.c index 3a8a6ea4..23f39624 100644 --- a/liblttng-ust/lttng-context-vpid.c +++ b/liblttng-ust/lttng-context-vpid.c @@ -50,7 +50,7 @@ size_t vpid_get_size(struct lttng_ust_ctx_field *field, size_t offset) { size_t size = 0; - size += lib_ring_buffer_align(offset, lttng_alignof(pid_t)); + size += lttng_ust_lib_ring_buffer_align(offset, lttng_alignof(pid_t)); size += sizeof(pid_t); return size; } @@ -62,7 +62,7 @@ void vpid_record(struct lttng_ust_ctx_field *field, { pid_t vpid = wrapper_getvpid(); - lib_ring_buffer_align_ctx(ctx, lttng_alignof(vpid)); + lttng_ust_lib_ring_buffer_align_ctx(ctx, lttng_alignof(vpid)); chan->ops->event_write(ctx, &vpid, sizeof(vpid)); } diff --git a/liblttng-ust/lttng-context-vsgid.c b/liblttng-ust/lttng-context-vsgid.c index e24f4689..2557e9ab 100644 --- a/liblttng-ust/lttng-context-vsgid.c +++ b/liblttng-ust/lttng-context-vsgid.c @@ -70,7 +70,7 @@ size_t vsgid_get_size(struct lttng_ust_ctx_field *field, size_t offset) { size_t size = 0; - size += lib_ring_buffer_align(offset, lttng_alignof(gid_t)); + size += lttng_ust_lib_ring_buffer_align(offset, lttng_alignof(gid_t)); size += sizeof(gid_t); return size; } @@ -83,7 +83,7 @@ void vsgid_record(struct lttng_ust_ctx_field *field, gid_t vsgid; vsgid = get_vsgid(); - lib_ring_buffer_align_ctx(ctx, lttng_alignof(vsgid)); + lttng_ust_lib_ring_buffer_align_ctx(ctx, lttng_alignof(vsgid)); chan->ops->event_write(ctx, &vsgid, sizeof(vsgid)); } diff --git a/liblttng-ust/lttng-context-vsuid.c b/liblttng-ust/lttng-context-vsuid.c index bb5e415f..8e081008 100644 --- a/liblttng-ust/lttng-context-vsuid.c +++ b/liblttng-ust/lttng-context-vsuid.c @@ -70,7 +70,7 @@ size_t vsuid_get_size(struct lttng_ust_ctx_field *field, size_t offset) { size_t size = 0; - size += lib_ring_buffer_align(offset, lttng_alignof(uid_t)); + size += lttng_ust_lib_ring_buffer_align(offset, lttng_alignof(uid_t)); size += sizeof(uid_t); return size; } @@ -83,7 +83,7 @@ void vsuid_record(struct lttng_ust_ctx_field *field, uid_t vsuid; vsuid = get_vsuid(); - lib_ring_buffer_align_ctx(ctx, lttng_alignof(vsuid)); + lttng_ust_lib_ring_buffer_align_ctx(ctx, lttng_alignof(vsuid)); chan->ops->event_write(ctx, &vsuid, sizeof(vsuid)); } diff --git a/liblttng-ust/lttng-context-vtid.c b/liblttng-ust/lttng-context-vtid.c index 2344825b..b70824fd 100644 --- a/liblttng-ust/lttng-context-vtid.c +++ b/liblttng-ust/lttng-context-vtid.c @@ -41,7 +41,7 @@ size_t vtid_get_size(struct lttng_ust_ctx_field *field, size_t offset) { size_t size = 0; - size += lib_ring_buffer_align(offset, lttng_alignof(pid_t)); + size += lttng_ust_lib_ring_buffer_align(offset, lttng_alignof(pid_t)); size += sizeof(pid_t); return size; } @@ -66,7 +66,7 @@ void vtid_record(struct lttng_ust_ctx_field *field, { pid_t vtid = wrapper_getvtid(); - lib_ring_buffer_align_ctx(ctx, lttng_alignof(vtid)); + lttng_ust_lib_ring_buffer_align_ctx(ctx, lttng_alignof(vtid)); chan->ops->event_write(ctx, &vtid, sizeof(vtid)); } diff --git a/liblttng-ust/lttng-context-vuid.c b/liblttng-ust/lttng-context-vuid.c index df880de3..85f14c5d 100644 --- a/liblttng-ust/lttng-context-vuid.c +++ b/liblttng-ust/lttng-context-vuid.c @@ -66,7 +66,7 @@ size_t vuid_get_size(struct lttng_ust_ctx_field *field, size_t offset) { size_t size = 0; - size += lib_ring_buffer_align(offset, lttng_alignof(uid_t)); + size += lttng_ust_lib_ring_buffer_align(offset, lttng_alignof(uid_t)); size += sizeof(uid_t); return size; } @@ -79,7 +79,7 @@ void vuid_record(struct lttng_ust_ctx_field *field, uid_t vuid; vuid = get_vuid(); - lib_ring_buffer_align_ctx(ctx, lttng_alignof(vuid)); + lttng_ust_lib_ring_buffer_align_ctx(ctx, lttng_alignof(vuid)); chan->ops->event_write(ctx, &vuid, sizeof(vuid)); } diff --git a/liblttng-ust/lttng-ring-buffer-client.h b/liblttng-ust/lttng-ring-buffer-client.h index 506429a8..96302ee7 100644 --- a/liblttng-ust/lttng-ring-buffer-client.h +++ b/liblttng-ust/lttng-ring-buffer-client.h @@ -81,7 +81,7 @@ size_t ctx_get_aligned_size(size_t offset, struct lttng_ust_ctx *ctx, if (caa_likely(!ctx)) return 0; - offset += lib_ring_buffer_align(offset, ctx->largest_align); + offset += lttng_ust_lib_ring_buffer_align(offset, ctx->largest_align); offset += ctx_len; return offset - orig_offset; } @@ -131,7 +131,7 @@ void ctx_record(struct lttng_ust_lib_ring_buffer_ctx *bufctx, if (caa_likely(!ctx)) return; - lib_ring_buffer_align_ctx(bufctx, ctx->largest_align); + lttng_ust_lib_ring_buffer_align_ctx(bufctx, ctx->largest_align); for (i = 0; i < ctx->nr_fields; i++) { if (mode == APP_CTX_ENABLED) { ctx->fields[i]->record(ctx->fields[i], bufctx, chan); @@ -182,7 +182,7 @@ size_t record_header_size(const struct lttng_ust_lib_ring_buffer_config *config, switch (lttng_chan->priv->header_type) { case 1: /* compact */ - padding = lib_ring_buffer_align(offset, lttng_alignof(uint32_t)); + padding = lttng_ust_lib_ring_buffer_align(offset, lttng_alignof(uint32_t)); offset += padding; if (!(ctx->rflags & (RING_BUFFER_RFLAG_FULL_TSC | LTTNG_RFLAG_EXTENDED))) { offset += sizeof(uint32_t); /* id and timestamp */ @@ -190,24 +190,24 @@ size_t record_header_size(const struct lttng_ust_lib_ring_buffer_config *config, /* Minimum space taken by LTTNG_COMPACT_EVENT_BITS id */ offset += (LTTNG_COMPACT_EVENT_BITS + CHAR_BIT - 1) / CHAR_BIT; /* Align extended struct on largest member */ - offset += lib_ring_buffer_align(offset, lttng_alignof(uint64_t)); + offset += lttng_ust_lib_ring_buffer_align(offset, lttng_alignof(uint64_t)); offset += sizeof(uint32_t); /* id */ - offset += lib_ring_buffer_align(offset, lttng_alignof(uint64_t)); + offset += lttng_ust_lib_ring_buffer_align(offset, lttng_alignof(uint64_t)); offset += sizeof(uint64_t); /* timestamp */ } break; case 2: /* large */ - padding = lib_ring_buffer_align(offset, lttng_alignof(uint16_t)); + padding = lttng_ust_lib_ring_buffer_align(offset, lttng_alignof(uint16_t)); offset += padding; offset += sizeof(uint16_t); if (!(ctx->rflags & (RING_BUFFER_RFLAG_FULL_TSC | LTTNG_RFLAG_EXTENDED))) { - offset += lib_ring_buffer_align(offset, lttng_alignof(uint32_t)); + offset += lttng_ust_lib_ring_buffer_align(offset, lttng_alignof(uint32_t)); offset += sizeof(uint32_t); /* timestamp */ } else { /* Align extended struct on largest member */ - offset += lib_ring_buffer_align(offset, lttng_alignof(uint64_t)); + offset += lttng_ust_lib_ring_buffer_align(offset, lttng_alignof(uint64_t)); offset += sizeof(uint32_t); /* id */ - offset += lib_ring_buffer_align(offset, lttng_alignof(uint64_t)); + offset += lttng_ust_lib_ring_buffer_align(offset, lttng_alignof(uint64_t)); offset += sizeof(uint64_t); /* timestamp */ } break; @@ -274,7 +274,7 @@ void lttng_write_event_header(const struct lttng_ust_lib_ring_buffer_config *con uint16_t id = event_id; lib_ring_buffer_write(config, ctx, &id, sizeof(id)); - lib_ring_buffer_align_ctx(ctx, lttng_alignof(uint32_t)); + lttng_ust_lib_ring_buffer_align_ctx(ctx, lttng_alignof(uint32_t)); lib_ring_buffer_write(config, ctx, ×tamp, sizeof(timestamp)); break; } @@ -284,7 +284,7 @@ void lttng_write_event_header(const struct lttng_ust_lib_ring_buffer_config *con ctx_record(ctx, lttng_chan, client_ctx->chan_ctx, APP_CTX_ENABLED); ctx_record(ctx, lttng_chan, client_ctx->event_ctx, APP_CTX_ENABLED); - lib_ring_buffer_align_ctx(ctx, ctx->largest_align); + lttng_ust_lib_ring_buffer_align_ctx(ctx, ctx->largest_align); return; @@ -324,9 +324,9 @@ void lttng_write_event_header_slow(const struct lttng_ust_lib_ring_buffer_config 31); lib_ring_buffer_write(config, ctx, &id, sizeof(id)); /* Align extended struct on largest member */ - lib_ring_buffer_align_ctx(ctx, lttng_alignof(uint64_t)); + lttng_ust_lib_ring_buffer_align_ctx(ctx, lttng_alignof(uint64_t)); lib_ring_buffer_write(config, ctx, &event_id, sizeof(event_id)); - lib_ring_buffer_align_ctx(ctx, lttng_alignof(uint64_t)); + lttng_ust_lib_ring_buffer_align_ctx(ctx, lttng_alignof(uint64_t)); lib_ring_buffer_write(config, ctx, ×tamp, sizeof(timestamp)); } break; @@ -337,7 +337,7 @@ void lttng_write_event_header_slow(const struct lttng_ust_lib_ring_buffer_config uint16_t id = event_id; lib_ring_buffer_write(config, ctx, &id, sizeof(id)); - lib_ring_buffer_align_ctx(ctx, lttng_alignof(uint32_t)); + lttng_ust_lib_ring_buffer_align_ctx(ctx, lttng_alignof(uint32_t)); lib_ring_buffer_write(config, ctx, ×tamp, sizeof(timestamp)); } else { uint16_t id = 65535; @@ -345,9 +345,9 @@ void lttng_write_event_header_slow(const struct lttng_ust_lib_ring_buffer_config lib_ring_buffer_write(config, ctx, &id, sizeof(id)); /* Align extended struct on largest member */ - lib_ring_buffer_align_ctx(ctx, lttng_alignof(uint64_t)); + lttng_ust_lib_ring_buffer_align_ctx(ctx, lttng_alignof(uint64_t)); lib_ring_buffer_write(config, ctx, &event_id, sizeof(event_id)); - lib_ring_buffer_align_ctx(ctx, lttng_alignof(uint64_t)); + lttng_ust_lib_ring_buffer_align_ctx(ctx, lttng_alignof(uint64_t)); lib_ring_buffer_write(config, ctx, ×tamp, sizeof(timestamp)); } break; @@ -357,7 +357,7 @@ void lttng_write_event_header_slow(const struct lttng_ust_lib_ring_buffer_config } ctx_record(ctx, lttng_chan, client_ctx->chan_ctx, APP_CTX_ENABLED); ctx_record(ctx, lttng_chan, client_ctx->event_ctx, APP_CTX_ENABLED); - lib_ring_buffer_align_ctx(ctx, ctx->largest_align); + lttng_ust_lib_ring_buffer_align_ctx(ctx, ctx->largest_align); } static const struct lttng_ust_lib_ring_buffer_config client_config; diff --git a/liblttng-ust/ust-core.c b/liblttng-ust/ust-core.c index 9f21b977..2e19d664 100644 --- a/liblttng-ust/ust-core.c +++ b/liblttng-ust/ust-core.c @@ -109,7 +109,7 @@ size_t lttng_ust_dummy_get_size(struct lttng_ust_ctx_field *field, size_t offset { size_t size = 0; - size += lib_ring_buffer_align(offset, lttng_alignof(char)); + size += lttng_ust_lib_ring_buffer_align(offset, lttng_alignof(char)); size += sizeof(char); /* tag */ return size; } @@ -120,7 +120,7 @@ void lttng_ust_dummy_record(struct lttng_ust_ctx_field *field, { char sel_char = (char) LTTNG_UST_DYNAMIC_TYPE_NONE; - lib_ring_buffer_align_ctx(ctx, lttng_alignof(sel_char)); + lttng_ust_lib_ring_buffer_align_ctx(ctx, lttng_alignof(sel_char)); chan->ops->event_write(ctx, &sel_char, sizeof(sel_char)); } diff --git a/libringbuffer/frontend_api.h b/libringbuffer/frontend_api.h index 7cbad40f..4207574f 100644 --- a/libringbuffer/frontend_api.h +++ b/libringbuffer/frontend_api.h @@ -90,7 +90,7 @@ int lib_ring_buffer_try_reserve(const struct lttng_ust_lib_ring_buffer_config *c ctx->slot_size = record_header_size(config, chan, *o_begin, before_hdr_pad, ctx, client_ctx); ctx->slot_size += - lib_ring_buffer_align(*o_begin + ctx->slot_size, + lttng_ust_lib_ring_buffer_align(*o_begin + ctx->slot_size, ctx->largest_align) + ctx->data_size; if (caa_unlikely((subbuf_offset(*o_begin, chan) + ctx->slot_size) > chan->backend.subbuf_size)) diff --git a/libringbuffer/ring_buffer_frontend.c b/libringbuffer/ring_buffer_frontend.c index e09294bf..8dfecf1d 100644 --- a/libringbuffer/ring_buffer_frontend.c +++ b/libringbuffer/ring_buffer_frontend.c @@ -2152,7 +2152,7 @@ retry: &offsets->pre_header_padding, ctx, client_ctx); offsets->size += - lib_ring_buffer_align(offsets->begin + offsets->size, + lttng_ust_lib_ring_buffer_align(offsets->begin + offsets->size, ctx->largest_align) + ctx->data_size; if (caa_unlikely(subbuf_offset(offsets->begin, chan) + @@ -2258,7 +2258,7 @@ retry: &offsets->pre_header_padding, ctx, client_ctx); offsets->size += - lib_ring_buffer_align(offsets->begin + offsets->size, + lttng_ust_lib_ring_buffer_align(offsets->begin + offsets->size, ctx->largest_align) + ctx->data_size; if (caa_unlikely(subbuf_offset(offsets->begin, chan) diff --git a/tests/compile/test-app-ctx/hello.c b/tests/compile/test-app-ctx/hello.c index 6b1a6bd3..457dc2e1 100644 --- a/tests/compile/test-app-ctx/hello.c +++ b/tests/compile/test-app-ctx/hello.c @@ -46,49 +46,49 @@ size_t test_get_size(struct lttng_ust_ctx_field *field, size_t offset) int sel = test_count % _NR_LTTNG_UST_DYNAMIC_TYPES; size_t size = 0; - size += lib_ring_buffer_align(offset, lttng_alignof(char)); + size += lttng_ust_lib_ring_buffer_align(offset, lttng_alignof(char)); size += sizeof(char); /* tag */ switch (sel) { case LTTNG_UST_DYNAMIC_TYPE_NONE: break; case LTTNG_UST_DYNAMIC_TYPE_S8: - size += lib_ring_buffer_align(offset, lttng_alignof(int8_t)); + size += lttng_ust_lib_ring_buffer_align(offset, lttng_alignof(int8_t)); size += sizeof(int8_t); /* variant */ break; case LTTNG_UST_DYNAMIC_TYPE_S16: - size += lib_ring_buffer_align(offset, lttng_alignof(int16_t)); + size += lttng_ust_lib_ring_buffer_align(offset, lttng_alignof(int16_t)); size += sizeof(int16_t); /* variant */ break; case LTTNG_UST_DYNAMIC_TYPE_S32: - size += lib_ring_buffer_align(offset, lttng_alignof(int32_t)); + size += lttng_ust_lib_ring_buffer_align(offset, lttng_alignof(int32_t)); size += sizeof(int32_t); /* variant */ break; case LTTNG_UST_DYNAMIC_TYPE_S64: - size += lib_ring_buffer_align(offset, lttng_alignof(int64_t)); + size += lttng_ust_lib_ring_buffer_align(offset, lttng_alignof(int64_t)); size += sizeof(int64_t); /* variant */ break; case LTTNG_UST_DYNAMIC_TYPE_U8: - size += lib_ring_buffer_align(offset, lttng_alignof(uint8_t)); + size += lttng_ust_lib_ring_buffer_align(offset, lttng_alignof(uint8_t)); size += sizeof(uint8_t); /* variant */ break; case LTTNG_UST_DYNAMIC_TYPE_U16: - size += lib_ring_buffer_align(offset, lttng_alignof(uint16_t)); + size += lttng_ust_lib_ring_buffer_align(offset, lttng_alignof(uint16_t)); size += sizeof(uint16_t); /* variant */ break; case LTTNG_UST_DYNAMIC_TYPE_U32: - size += lib_ring_buffer_align(offset, lttng_alignof(uint32_t)); + size += lttng_ust_lib_ring_buffer_align(offset, lttng_alignof(uint32_t)); size += sizeof(uint32_t); /* variant */ break; case LTTNG_UST_DYNAMIC_TYPE_U64: - size += lib_ring_buffer_align(offset, lttng_alignof(uint64_t)); + size += lttng_ust_lib_ring_buffer_align(offset, lttng_alignof(uint64_t)); size += sizeof(uint64_t); /* variant */ break; case LTTNG_UST_DYNAMIC_TYPE_FLOAT: - size += lib_ring_buffer_align(offset, lttng_alignof(float)); + size += lttng_ust_lib_ring_buffer_align(offset, lttng_alignof(float)); size += sizeof(float); /* variant */ break; case LTTNG_UST_DYNAMIC_TYPE_DOUBLE: - size += lib_ring_buffer_align(offset, lttng_alignof(double)); + size += lttng_ust_lib_ring_buffer_align(offset, lttng_alignof(double)); size += sizeof(double); /* variant */ break; case LTTNG_UST_DYNAMIC_TYPE_STRING: @@ -109,7 +109,7 @@ void test_record(struct lttng_ust_ctx_field *field, int sel = test_count % _NR_LTTNG_UST_DYNAMIC_TYPES; char sel_char = (char) sel; - lib_ring_buffer_align_ctx(ctx, lttng_alignof(char)); + lttng_ust_lib_ring_buffer_align_ctx(ctx, lttng_alignof(char)); lttng_chan_buf->ops->event_write(ctx, &sel_char, sizeof(sel_char)); switch (sel) { case LTTNG_UST_DYNAMIC_TYPE_NONE: @@ -118,7 +118,7 @@ void test_record(struct lttng_ust_ctx_field *field, { int8_t v = -8; - lib_ring_buffer_align_ctx(ctx, lttng_alignof(v)); + lttng_ust_lib_ring_buffer_align_ctx(ctx, lttng_alignof(v)); lttng_chan_buf->ops->event_write(ctx, &v, sizeof(v)); break; } @@ -126,7 +126,7 @@ void test_record(struct lttng_ust_ctx_field *field, { int16_t v = -16; - lib_ring_buffer_align_ctx(ctx, lttng_alignof(v)); + lttng_ust_lib_ring_buffer_align_ctx(ctx, lttng_alignof(v)); lttng_chan_buf->ops->event_write(ctx, &v, sizeof(v)); break; } @@ -134,7 +134,7 @@ void test_record(struct lttng_ust_ctx_field *field, { int32_t v = -32; - lib_ring_buffer_align_ctx(ctx, lttng_alignof(v)); + lttng_ust_lib_ring_buffer_align_ctx(ctx, lttng_alignof(v)); lttng_chan_buf->ops->event_write(ctx, &v, sizeof(v)); break; } @@ -142,7 +142,7 @@ void test_record(struct lttng_ust_ctx_field *field, { int64_t v = -64; - lib_ring_buffer_align_ctx(ctx, lttng_alignof(v)); + lttng_ust_lib_ring_buffer_align_ctx(ctx, lttng_alignof(v)); lttng_chan_buf->ops->event_write(ctx, &v, sizeof(v)); break; } @@ -150,7 +150,7 @@ void test_record(struct lttng_ust_ctx_field *field, { uint8_t v = 8; - lib_ring_buffer_align_ctx(ctx, lttng_alignof(v)); + lttng_ust_lib_ring_buffer_align_ctx(ctx, lttng_alignof(v)); lttng_chan_buf->ops->event_write(ctx, &v, sizeof(v)); break; } @@ -158,7 +158,7 @@ void test_record(struct lttng_ust_ctx_field *field, { uint16_t v = 16; - lib_ring_buffer_align_ctx(ctx, lttng_alignof(v)); + lttng_ust_lib_ring_buffer_align_ctx(ctx, lttng_alignof(v)); lttng_chan_buf->ops->event_write(ctx, &v, sizeof(v)); break; } @@ -166,7 +166,7 @@ void test_record(struct lttng_ust_ctx_field *field, { uint32_t v = 32; - lib_ring_buffer_align_ctx(ctx, lttng_alignof(v)); + lttng_ust_lib_ring_buffer_align_ctx(ctx, lttng_alignof(v)); lttng_chan_buf->ops->event_write(ctx, &v, sizeof(v)); break; } @@ -174,7 +174,7 @@ void test_record(struct lttng_ust_ctx_field *field, { uint64_t v = 64; - lib_ring_buffer_align_ctx(ctx, lttng_alignof(v)); + lttng_ust_lib_ring_buffer_align_ctx(ctx, lttng_alignof(v)); lttng_chan_buf->ops->event_write(ctx, &v, sizeof(v)); break; } @@ -182,7 +182,7 @@ void test_record(struct lttng_ust_ctx_field *field, { float f = 22322.0; - lib_ring_buffer_align_ctx(ctx, lttng_alignof(f)); + lttng_ust_lib_ring_buffer_align_ctx(ctx, lttng_alignof(f)); lttng_chan_buf->ops->event_write(ctx, &f, sizeof(f)); break; } @@ -190,7 +190,7 @@ void test_record(struct lttng_ust_ctx_field *field, { double d = 2.0; - lib_ring_buffer_align_ctx(ctx, lttng_alignof(d)); + lttng_ust_lib_ring_buffer_align_ctx(ctx, lttng_alignof(d)); lttng_chan_buf->ops->event_write(ctx, &d, sizeof(d)); break; }