/*
* 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;
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) {
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;
}
/*
* 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;