-/*
- * For a session name, enable the consumer.
- */
-static int enable_consumer(const char *session_name)
-{
- int ret;
- struct lttng_handle *handle;
- struct lttng_domain dom;
-
- assert(session_name);
-
- /*
- * Set handle with the session name and the domain set to 0. This means to
- * the session daemon that the next action applies on the tracing session
- * rather then the domain specific session.
- *
- * XXX: This '0' value should be a domain enum value.
- */
- memset(&dom, 0, sizeof(dom));
-
- handle = lttng_create_handle(session_name, 0);
- if (handle == NULL) {
- ret = CMD_FATAL;
- goto error;
- }
-
- ret = lttng_enable_consumer(handle);
- if (ret < 0) {
- goto error;
- }
-
- MSG("Consumer enabled for session %s", session_name);
-
-error:
- lttng_destroy_handle(handle);
- return ret;
-}
-
-/*
- * For a session name, disable the consumer.
- */
-static int disable_consumer(const char *session_name)
-{
- int ret;
- struct lttng_handle *handle;
-
- assert(session_name);
-
- /*
- * Set handle with the session name and the domain set to 0. This means to
- * the session daemon that the next action applies on the tracing session
- * rather then the domain specific session.
- *
- * XXX: This '0' value should be a domain enum value.
- */
- handle = lttng_create_handle(session_name, 0);
- if (handle == NULL) {
- ret = CMD_FATAL;
- goto error;
- }
-
- ret = lttng_disable_consumer(handle);
- if (ret < 0) {
- goto error;
- }
- free(handle);
-
- MSG("Consumer disabled for session %s", session_name);
-
-error:
- return ret;
-}
-