From 797b05f6cf195a6699b6aff0a76b8e1274d5b51f Mon Sep 17 00:00:00 2001 From: Mathieu Desnoyers Date: Thu, 10 Mar 2016 10:13:17 -0500 Subject: [PATCH] Fix: move dummy functions to common file Those dummy functions are needed by both lttng-ust and lttng-ust-ctl libraries. Signed-off-by: Mathieu Desnoyers --- liblttng-ust/lttng-context-provider.c | 25 ------------------------- liblttng-ust/ust-core.c | 26 ++++++++++++++++++++++++++ 2 files changed, 26 insertions(+), 25 deletions(-) diff --git a/liblttng-ust/lttng-context-provider.c b/liblttng-ust/lttng-context-provider.c index b5ae3075..6c067e2f 100644 --- a/liblttng-ust/lttng-context-provider.c +++ b/liblttng-ust/lttng-context-provider.c @@ -92,31 +92,6 @@ end: return ret; } -size_t lttng_ust_dummy_get_size(struct lttng_ctx_field *field, size_t offset) -{ - size_t size = 0; - - size += lib_ring_buffer_align(offset, lttng_alignof(char)); - size += sizeof(char); /* tag */ - return size; -} - -void lttng_ust_dummy_record(struct lttng_ctx_field *field, - struct lttng_ust_lib_ring_buffer_ctx *ctx, - struct lttng_channel *chan) -{ - char sel_char = (char) LTTNG_UST_DYNAMIC_TYPE_NONE; - - lib_ring_buffer_align_ctx(ctx, lttng_alignof(sel_char)); - chan->ops->event_write(ctx, &sel_char, sizeof(sel_char)); -} - -void lttng_ust_dummy_get_value(struct lttng_ctx_field *field, - struct lttng_ctx_value *value) -{ - value->sel = LTTNG_UST_DYNAMIC_TYPE_NONE; -} - void lttng_ust_context_provider_unregister(struct lttng_ust_context_provider *provider) { if (ust_lock()) diff --git a/liblttng-ust/ust-core.c b/liblttng-ust/ust-core.c index 60751dc3..0182d957 100644 --- a/liblttng-ust/ust-core.c +++ b/liblttng-ust/ust-core.c @@ -21,6 +21,7 @@ #include #include #include +#include "lttng-tracer-core.h" #include "jhash.h" static CDS_LIST_HEAD(lttng_transport_list); @@ -80,3 +81,28 @@ struct lttng_enum *lttng_ust_enum_get(struct lttng_session *session, } return NULL; } + +size_t lttng_ust_dummy_get_size(struct lttng_ctx_field *field, size_t offset) +{ + size_t size = 0; + + size += lib_ring_buffer_align(offset, lttng_alignof(char)); + size += sizeof(char); /* tag */ + return size; +} + +void lttng_ust_dummy_record(struct lttng_ctx_field *field, + struct lttng_ust_lib_ring_buffer_ctx *ctx, + struct lttng_channel *chan) +{ + char sel_char = (char) LTTNG_UST_DYNAMIC_TYPE_NONE; + + lib_ring_buffer_align_ctx(ctx, lttng_alignof(sel_char)); + chan->ops->event_write(ctx, &sel_char, sizeof(sel_char)); +} + +void lttng_ust_dummy_get_value(struct lttng_ctx_field *field, + struct lttng_ctx_value *value) +{ + value->sel = LTTNG_UST_DYNAMIC_TYPE_NONE; +} -- 2.34.1