- default_chan_name = DEFAULT_PYTHON_CHANNEL_NAME;
- break;
- default:
- /* The switch/case we are in should avoid this else big problem */
- assert(0);
- }
-
- {
- struct lttng_filter_bytecode *filter_copy = NULL;
-
- if (filter) {
- filter_copy = zmalloc(
- sizeof(struct lttng_filter_bytecode)
- + filter->len);
- if (!filter_copy) {
- goto error;
- }
-
- memcpy(filter_copy, filter,
- sizeof(struct lttng_filter_bytecode)
- + filter->len);
- }
-
- ret = cmd_enable_event(session, &tmp_dom,
- (char *) default_chan_name,
- &uevent, filter_expression, filter_copy,
- NULL, wpipe);
- /* We have passed ownership */
- filter_expression = NULL;
- }
-
- if (ret != LTTNG_OK && ret != LTTNG_ERR_UST_EVENT_ENABLED) {
- goto error;
- }
-
- /* The wild card * means that everything should be enabled. */
- if (strncmp(event->name, "*", 1) == 0 && strlen(event->name) == 1) {
- ret = event_agent_enable_all(usess, agt, event, filter);
- filter = NULL;
- } else {
- ret = event_agent_enable(usess, agt, event, filter);
- filter = NULL;
- }
- 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:
- free(filter_expression);
- free(filter);
- free(exclusion);
- rcu_read_unlock();
- return ret;
-}
-
-/*
- * Command LTTNG_ENABLE_EVENT for event "*" processed by the client thread.
- */
-static
-int enable_kevent_all(struct ltt_session *session,
- struct lttng_domain *domain, char *channel_name,
- struct lttng_event *event,
- char *filter_expression,
- struct lttng_filter_bytecode *filter, int wpipe)
-{
- int ret;
- struct lttng_channel *attr;
-
- assert(session);
- assert(channel_name);
-
- rcu_read_lock();
-
- switch (domain->type) {
- case LTTNG_DOMAIN_KERNEL:
- {
- struct ltt_kernel_channel *kchan;
-
- assert(session->kernel_session);
-
- /*
- * If a non-default channel has been created in the
- * session, explicitely require that -c chan_name needs
- * to be provided.
- */
- if (session->kernel_session->has_non_default_channel
- && channel_name[0] == '\0') {
- ret = LTTNG_ERR_NEED_CHANNEL_NAME;
- goto error;