X-Git-Url: http://git.efficios.com/?a=blobdiff_plain;f=src%2Fbin%2Flttng-sessiond%2Fcmd.c;h=b78af9e771022c08e55fd61c8fa098ea0340460f;hb=025faf73cdb6942ebf437dc4c4f6631f0134b128;hp=37a803b05ff12d399bb9d6de6a1c8bafe9fb2b2f;hpb=784303b0777959c71c7f6ad404fea1ed3cc22f14;p=lttng-tools.git diff --git a/src/bin/lttng-sessiond/cmd.c b/src/bin/lttng-sessiond/cmd.c index 37a803b05..b78af9e77 100644 --- a/src/bin/lttng-sessiond/cmd.c +++ b/src/bin/lttng-sessiond/cmd.c @@ -826,9 +826,6 @@ int cmd_enable_channel(struct ltt_session *session, { struct ltt_kernel_channel *kchan; - /* Mandatory for a kernel channel. */ - assert(wpipe > 0); - kchan = trace_kernel_get_channel_by_name(attr->name, session->kernel_session); if (kchan == NULL) { @@ -1038,8 +1035,7 @@ error: * Command LTTNG_ADD_CONTEXT processed by the client thread. */ int cmd_add_context(struct ltt_session *session, int domain, - char *channel_name, char *event_name, struct lttng_event_context *ctx, - int kwpipe) + char *channel_name, struct lttng_event_context *ctx, int kwpipe) { int ret; @@ -1056,8 +1052,7 @@ int cmd_add_context(struct ltt_session *session, int domain, } /* Add kernel context to kernel tracer */ - ret = context_kernel_add(session->kernel_session, ctx, - event_name, channel_name); + ret = context_kernel_add(session->kernel_session, ctx, channel_name); if (ret != LTTNG_OK) { goto error; } @@ -1086,47 +1081,7 @@ int cmd_add_context(struct ltt_session *session, int domain, free(attr); } - - ret = context_ust_add(usess, domain, ctx, event_name, channel_name); - if (ret != LTTNG_OK) { - goto error; - } - break; - } -#if 0 - case LTTNG_DOMAIN_UST_EXEC_NAME: - case LTTNG_DOMAIN_UST_PID: - case LTTNG_DOMAIN_UST_PID_FOLLOW_CHILDREN: -#endif - default: - ret = LTTNG_ERR_UND; - goto error; - } - - ret = LTTNG_OK; - -error: - return ret; -} - -/* - * Command LTTNG_SET_FILTER processed by the client thread. - */ -int cmd_set_filter(struct ltt_session *session, int domain, - char *channel_name, char *event_name, - struct lttng_filter_bytecode *bytecode) -{ - int ret; - - switch (domain) { - case LTTNG_DOMAIN_KERNEL: - ret = LTTNG_ERR_FATAL; - break; - case LTTNG_DOMAIN_UST: - { - struct ltt_ust_session *usess = session->ust_session; - - ret = filter_ust_set(usess, domain, bytecode, event_name, channel_name); + ret = context_ust_add(usess, domain, ctx, channel_name); if (ret != LTTNG_OK) { goto error; } @@ -1146,15 +1101,14 @@ int cmd_set_filter(struct ltt_session *session, int domain, error: return ret; - } - /* * Command LTTNG_ENABLE_EVENT processed by the client thread. */ int cmd_enable_event(struct ltt_session *session, int domain, - char *channel_name, struct lttng_event *event, int wpipe) + char *channel_name, struct lttng_event *event, + struct lttng_filter_bytecode *filter, int wpipe) { int ret; struct lttng_channel *attr; @@ -1237,7 +1191,7 @@ int cmd_enable_event(struct ltt_session *session, int domain, } /* At this point, the session and channel exist on the tracer */ - ret = event_ust_enable_tracepoint(usess, domain, uchan, event); + ret = event_ust_enable_tracepoint(usess, domain, uchan, event, filter); if (ret != LTTNG_OK) { goto error; } @@ -1263,7 +1217,8 @@ error: * Command LTTNG_ENABLE_ALL_EVENT processed by the client thread. */ int cmd_enable_event_all(struct ltt_session *session, int domain, - char *channel_name, int event_type, int wpipe) + char *channel_name, int event_type, + struct lttng_filter_bytecode *filter, int wpipe) { int ret; struct lttng_channel *attr; @@ -1370,7 +1325,8 @@ int cmd_enable_event_all(struct ltt_session *session, int domain, switch (event_type) { case LTTNG_EVENT_ALL: case LTTNG_EVENT_TRACEPOINT: - ret = event_ust_enable_all_tracepoints(usess, domain, uchan); + ret = event_ust_enable_all_tracepoints(usess, domain, uchan, + filter); if (ret != LTTNG_OK) { goto error; }