X-Git-Url: https://git.lttng.org/?a=blobdiff_plain;f=src%2Fbin%2Flttng-sessiond%2Fcontext.c;h=941ab2535a0476d062b6de45820c430738f7f850;hb=c0c66aecd959ec1bfb895abdd8442e2faf1159a6;hp=0de1d069a705494e61905602cd68966715ecdaa7;hpb=890d8fe47755c3bad936389cf48ffa141cff41c9;p=lttng-tools.git diff --git a/src/bin/lttng-sessiond/context.c b/src/bin/lttng-sessiond/context.c index 0de1d069a..941ab2535 100644 --- a/src/bin/lttng-sessiond/context.c +++ b/src/bin/lttng-sessiond/context.c @@ -87,7 +87,8 @@ error: /* * Add UST context to channel. */ -static int add_uctx_to_channel(struct ltt_ust_session *usess, int domain, +static int add_uctx_to_channel(struct ltt_ust_session *usess, + enum lttng_domain_type domain, struct ltt_ust_channel *uchan, struct lttng_event_context *ctx) { int ret; @@ -96,6 +97,7 @@ static int add_uctx_to_channel(struct ltt_ust_session *usess, int domain, assert(usess); assert(uchan); assert(ctx); + assert(domain == LTTNG_DOMAIN_UST); /* Check if context is duplicate */ cds_list_for_each_entry(uctx, &uchan->ctx_list, list) { @@ -112,15 +114,8 @@ static int add_uctx_to_channel(struct ltt_ust_session *usess, int domain, goto error; } - switch (domain) { - case LTTNG_DOMAIN_UST: - ret = ust_app_add_ctx_channel_glb(usess, uchan, uctx); - if (ret < 0) { - goto error; - } - break; - default: - ret = -ENOSYS; + ret = ust_app_add_ctx_channel_glb(usess, uchan, uctx); + if (ret < 0) { goto error; } @@ -239,8 +234,9 @@ error: /* * Add UST context to tracer. */ -int context_ust_add(struct ltt_ust_session *usess, int domain, - struct lttng_event_context *ctx, char *channel_name) +int context_ust_add(struct ltt_ust_session *usess, + enum lttng_domain_type domain, struct lttng_event_context *ctx, + char *channel_name) { int ret = LTTNG_OK; struct lttng_ht_iter iter; @@ -284,7 +280,8 @@ int context_ust_add(struct ltt_ust_session *usess, int domain, cds_lfht_for_each_entry(chan_ht->ht, &iter.iter, uchan, node.node) { ret = add_uctx_to_channel(usess, domain, uchan, ctx); if (ret < 0) { - ERR("Context failed for channel %s", uchan->name); + ERR("Failed to add context to channel %s", + uchan->name); continue; } }