X-Git-Url: http://git.liburcu.org/?a=blobdiff_plain;f=liblttng-ust%2Flttng-context-provider.c;h=6c067e2fecae06548a3d4495ef9477b2495a6a5b;hb=0363661e12053e578f5cae7e29108c7029ed74ae;hp=e7462cdabec945522c697576c632511f97043567;hpb=53569322d40ed45abe0368ddb08eb4a2738afc37;p=lttng-ust.git diff --git a/liblttng-ust/lttng-context-provider.c b/liblttng-ust/lttng-context-provider.c index e7462cda..6c067e2f 100644 --- a/liblttng-ust/lttng-context-provider.c +++ b/liblttng-ust/lttng-context-provider.c @@ -92,40 +92,13 @@ end: return ret; } -static -size_t 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; -} - -static -void 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)); -} - -static -void 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()) goto end; lttng_ust_context_set_session_provider(provider->name, - dummy_get_size, dummy_record, dummy_get_value); + lttng_ust_dummy_get_size, lttng_ust_dummy_record, + lttng_ust_dummy_get_value); cds_hlist_del(&provider->node); end: ust_unlock(); @@ -168,9 +141,9 @@ int lttng_ust_add_app_context_to_ctx_rcu(const char *name, new_field.record = provider->record; new_field.get_value = provider->get_value; } else { - new_field.get_size = dummy_get_size; - new_field.record = dummy_record; - new_field.get_value = dummy_get_value; + new_field.get_size = lttng_ust_dummy_get_size; + new_field.record = lttng_ust_dummy_record; + new_field.get_value = lttng_ust_dummy_get_value; } ret = lttng_context_add_rcu(ctx, &new_field); if (ret) {