Deprecate enable/disable-consumer
authorDavid Goulet <dgoulet@efficios.com>
Fri, 15 Feb 2013 22:09:09 +0000 (17:09 -0500)
committerDavid Goulet <dgoulet@efficios.com>
Mon, 18 Feb 2013 18:48:48 +0000 (13:48 -0500)
The concept of consumer should change to the fact that a user can
enable/disable outputs such as file or network for streaming. We
envision that multiple outputs can be attached to a channel in the
future.

We want to minimise the amount of puzzlement for users. Having an error
message from the consumer daemon when --no-consumer has been specified
can be considered puzzling.

This calls for "add output" semantic, so we can support this "tee"
use-case seemlessly. We plan on allowing add/del output while tracing is
active, which is not currently permitted by enable-consumer.

Everything enable-consumer does can be done by lttng create options
Therefore, it seems easier for development of upcoming features and for
the sake of simplicity of interfaces to deprecate the current
enable/disable consumer.

This applies for both to the lttng UI commands and API calls. The
documentation has been removed from the man page and the help of the
lttng command. So, it exists but is simply not documented.

Signed-off-by: David Goulet <dgoulet@efficios.com>
16 files changed:
doc/man/lttng.1
include/lttng/lttng-error.h
include/lttng/lttng.h
src/bin/lttng-sessiond/cmd.c
src/bin/lttng-sessiond/cmd.h
src/bin/lttng-sessiond/main.c
src/bin/lttng-sessiond/session.c
src/bin/lttng-sessiond/session.h
src/bin/lttng/commands/create.c
src/bin/lttng/commands/disable_consumer.c
src/bin/lttng/commands/enable_consumer.c
src/bin/lttng/lttng.c
src/common/error.c
src/lib/lttng-ctl/lttng-ctl.c
tests/tools/streaming/run-kernel
tests/tools/streaming/run-ust

index f773e61f89b7659ad95a5f2a8d9645d3c1ff0864..814e1c64fad9bb62fa4b24088f8ba2baf20a8eb9 100644 (file)
@@ -231,19 +231,31 @@ instance, \-C does not enable the consumer automatically. You'll need the \-e
 option for that.
 
 \-U, \-\-set-uri=URL
-        Set URL for the enable-consumer destination. It is persistent for the
+        Set URL for the consumer output destination. It is persistent for the
         session lifetime. Redo the command to change it. This will set both
         data and control URL for network.
 \-C, \-\-ctrl-url=URL
         Set control path URL. (Must use -D also)
 \-D, \-\-data-url=URL
         Set data path URL. (Must use -C also)
-     \-\-no-consumer
-        Don't activate a consumer for this session.
-     \-\-disable-consumer
-        Disable consumer for this session.
 
-See \fBenable-consumer\fP command below for the supported URL format.
+.B URL FORMAT:
+
+proto://[HOST|IP][:PORT1[:PORT2]][/TRACE_PATH]
+
+Supported protocols are (proto):
+> file://...
+        Local filesystem full path.
+
+> net://...
+        This will use the default network transport layer which is TCP for both
+        control (PORT1) and data port (PORT2). The default ports are
+        respectively 5342 and 5343. Note that net[6]:// is not yet supported.
+
+> tcp[6]://...
+        Can only be used with -C and -D together
+
+NOTE: IPv6 address MUST be enclosed in brackets '[]' (rfc2732)
 
 .B EXAMPLES:
 
@@ -325,80 +337,6 @@ file.
 
 .IP
 
-.IP "\fBenable-consumer\fP [-u|-k] [URL] [OPTIONS]"
-.nf
-Enable a consumer for the tracing session and domain.
-
-By default, every tracing session has a consumer attached to it using the local
-filesystem as output. The trace is written in $HOME/lttng-traces. This command
-allows the user to specify a specific URL after the session was created for a
-specific domain. If no domain is specified, the consumer is applied on all
-domains.
-
-Without options, the behavior is to enable a consumer to the current URL. The
-default URL is the local filesystem at the path of the session mentioned above.
-
-The enable-consumer feature supports both local and network transport. You must
-have a running \fBlttng-relayd(8)\fP for network transmission or any other daemon
-that can understand the streaming protocol of LTTng.
-.fi
-
-.B OPTIONS:
-
-.nf
-\-h, \-\-help
-        Show summary of possible options and commands.
-\-\-list-options
-        Simple listing of options
-\-s, \-\-session NAME
-        Apply on session name
-\-k, \-\-kernel
-        Apply for the kernel tracer
-\-u, \-\-userspace
-        Apply for the user-space tracer
-
-Using these options, each API call can be controlled individually. For
-instance, \-C does not enable the consumer automatically. You'll need the \-e
-option for that.
-
-\-U, \-\-set-uri=URL
-        Set URL for the enable-consumer destination. It is persistent for the
-        session lifetime. Redo the command to change it. This will set both
-        data and control URL for network.
-\-C, \-\-ctrl-url=URL
-        Set control path URL. (Must use -D also)
-\-D, \-\-data-url=URL
-        Set data path URL. (Must use -C also)
-\-e, \-\-enable
-        Enable consumer
-
-.B URL FORMAT:
-
-proto://[HOST|IP][:PORT1[:PORT2]][/TRACE_PATH]
-
-Supported protocols are (proto):
-> file://...
-        Local filesystem full path.
-
-> net://...
-        This will use the default network transport layer which is TCP for both
-        control (PORT1) and data port (PORT2). The default ports are
-        respectively 5342 and 5343. Note that net[6]:// is not yet supported.
-
-> tcp[6]://...
-        Can only be used with -C and -D together
-
-NOTE: IPv6 address MUST be enclosed in brackets '[]' (rfc2732)
-
-.B EXAMPLES:
-
-$ lttng enable-consumer -u net://192.168.1.42
-
-Uses TCP and default ports for user space tracing (-u) where the IP address
-above is the destination machine where the traces will be streamed and a
-\fBlttng-relayd(8)\fP is listening.
-.fi
-
 .IP "\fBenable-event\fP NAME[,NAME2,...] [-k|-u] [OPTIONS]"
 .nf
 Enable tracing event
@@ -503,28 +441,6 @@ file.
         Apply for the user-space tracer
 .fi
 
-.IP "\fBdisable-consumer\fP [\-k|\-u] [OPTIONS]"
-.nf
-Disable the consumer of a tracing session.
-
-This call MUST be done BEFORE tracing has started.
-.fi
-
-.B OPTIONS:
-
-.nf
-\-h, \-\-help
-        Show summary of possible options and commands.
-\-\-list-options
-        Simple listing of options
-\-s, \-\-session NAME
-        Apply on session name
-\-k, \-\-kernel
-        Apply for the kernel tracer
-\-u, \-\-userspace
-        Apply for the user-space tracer
-.fi
-
 .IP "\fBdisable-event\fP NAME[,NAME2,...] [\-k|\-u] [OPTIONS]"
 .nf
 Disable tracing event
index 9cb74a12237d82298a4caf0b78f22b01510036e3..2bcc2c365436efda24e18440c111a7458fbb2a20 100644 (file)
 extern "C" {
 #endif
 
+#ifndef LTTNG_DEPRECATED
+#if defined (__GNUC__) \
+       && ((__GNUC_MAJOR__ == 4) && (__GNUC_MINOR__ >= 5)  \
+                       || __GNUC_MAJOR__ >= 5)
+#define LTTNG_DEPRECATED(msg) __attribute__((deprecated(msg)))
+#else
+#define LTTNG_DEPRECATED(msg) __attribute__((deprecated))
+#endif /* defined __GNUC__ */
+#endif /* LTTNG_DEPRECATED */
+
 enum lttng_error_code {
        LTTNG_OK                         = 10,  /* Ok */
        LTTNG_ERR_UNK                    = 11,  /* Unknown Error */
@@ -40,8 +50,8 @@ enum lttng_error_code {
        LTTNG_ERR_CREATE_DIR_FAIL        = 17,  /* Create directory fail */
        LTTNG_ERR_SESSION_FAIL           = 18,  /* Create session fail */
        LTTNG_ERR_NO_SESSIOND            = 19,  /* No session daemon available */
-       /* 20 */
-       /* 21 */
+       LTTNG_ERR_SET_URL                = 20,  /* Error setting URL */
+       LTTNG_ERR_URL_EXIST              = 21,  /* URL already exists. */
        /* 22 */
        LTTNG_ERR_SESS_NOT_FOUND         = 23,  /* Session by name not found */
        /* 24 */
index e21b479777b0760d028876218cd12e63decb992f..6077047642fe628530a1b7803f40b69dcb9be3f0 100644 (file)
@@ -590,12 +590,14 @@ extern int lttng_set_consumer_url(struct lttng_handle *handle,
 /*
  * Enable the consumer for a session and domain.
  */
-extern int lttng_enable_consumer(struct lttng_handle *handle);
+extern LTTNG_DEPRECATED("This call is now obselete.")
+int lttng_enable_consumer(struct lttng_handle *handle);
 
 /*
  * Disable consumer for a session and domain.
  */
-extern int lttng_disable_consumer(struct lttng_handle *handle);
+extern LTTNG_DEPRECATED("This call is now obselete.")
+int lttng_disable_consumer(struct lttng_handle *handle);
 
 /*
  * Check session daemon health for a specific component.
index 150a2dfe4675bfbfaf90d5e30b51d54ab6eb284d..a47c504c718736e86425bd4c58d95134ec4f8b9c 100644 (file)
@@ -378,6 +378,14 @@ static int add_uri_to_consumer(struct consumer_output *consumer,
 
                consumer->type = CONSUMER_DST_NET;
 
+               if ((uri->stype == LTTNG_STREAM_CONTROL &&
+                               consumer->dst.net.control_isset) ||
+                               (uri->stype == LTTNG_STREAM_DATA &&
+                               consumer->dst.net.data_isset)) {
+                       ret = LTTNG_ERR_URL_EXIST;
+                       goto error;
+               }
+
                /* Set URI into consumer output object */
                ret = consumer_set_network_uri(consumer, uri);
                if (ret < 0) {
@@ -662,7 +670,7 @@ int cmd_setup_relayd(struct ltt_session *session)
        usess = session->ust_session;
        ksess = session->kernel_session;
 
-       DBG2("Setting relayd for session %s", session->name);
+       DBG("Setting relayd for session %s", session->name);
 
        rcu_read_lock();
 
@@ -1634,38 +1642,14 @@ int cmd_set_consumer_uri(int domain, struct ltt_session *session,
        case LTTNG_DOMAIN_KERNEL:
                /* Code flow error if we don't have a kernel session here. */
                assert(ksess);
-
-               /* Create consumer output if none exists */
-               consumer = ksess->tmp_consumer;
-               if (consumer == NULL) {
-                       consumer = consumer_copy_output(ksess->consumer);
-                       if (consumer == NULL) {
-                               ret = LTTNG_ERR_FATAL;
-                               goto error;
-                       }
-                       /* Trash the consumer subdir, we are about to set a new one. */
-                       memset(consumer->subdir, 0, sizeof(consumer->subdir));
-                       ksess->tmp_consumer = consumer;
-               }
-
+               assert(ksess->consumer);
+               consumer = ksess->consumer;
                break;
        case LTTNG_DOMAIN_UST:
                /* Code flow error if we don't have a kernel session here. */
                assert(usess);
-
-               /* Create consumer output if none exists */
-               consumer = usess->tmp_consumer;
-               if (consumer == NULL) {
-                       consumer = consumer_copy_output(usess->consumer);
-                       if (consumer == NULL) {
-                               ret = LTTNG_ERR_FATAL;
-                               goto error;
-                       }
-                       /* Trash the consumer subdir, we are about to set a new one. */
-                       memset(consumer->subdir, 0, sizeof(consumer->subdir));
-                       usess->tmp_consumer = consumer;
-               }
-
+               assert(usess->consumer);
+               consumer = usess->consumer;
                break;
        }
 
@@ -1695,6 +1679,12 @@ int cmd_create_session_uri(char *name, struct lttng_uri *uris,
 
        assert(name);
 
+       /* No URIs is not possible. */
+       if (uris == NULL) {
+               ret = LTTNG_ERR_SESSION_FAIL;
+               goto session_error;
+       }
+
        /*
         * Verify if the session already exist
         *
@@ -1732,22 +1722,6 @@ int cmd_create_session_uri(char *name, struct lttng_uri *uris,
                goto consumer_error;
        }
 
-       /*
-        * This means that the lttng_create_session call was called with the _path_
-        * argument set to NULL.
-        */
-       if (uris == NULL) {
-               /*
-                * At this point, we'll skip the consumer URI setup and create a
-                * session with a NULL path which will flag the session to NOT spawn a
-                * consumer.
-                */
-               DBG("Create session %s with NO uri, skipping consumer setup", name);
-               goto end;
-       }
-
-       session->start_consumer = 1;
-
        ret = cmd_set_consumer_uri(0, session, nb_uri, uris);
        if (ret != LTTNG_OK) {
                goto consumer_error;
@@ -1755,7 +1729,6 @@ int cmd_create_session_uri(char *name, struct lttng_uri *uris,
 
        session->consumer->enabled = 1;
 
-end:
        return LTTNG_OK;
 
 consumer_error:
@@ -2116,266 +2089,6 @@ void cmd_list_lttng_sessions(struct lttng_session *sessions, uid_t uid,
        }
 }
 
-/*
- * Command LTTNG_DISABLE_CONSUMER processed by the client thread.
- */
-int cmd_disable_consumer(int domain, struct ltt_session *session)
-{
-       int ret;
-       struct ltt_kernel_session *ksess = session->kernel_session;
-       struct ltt_ust_session *usess = session->ust_session;
-       struct consumer_output *consumer;
-
-       assert(session);
-
-       if (session->enabled) {
-               /* Can't disable consumer on an already started session */
-               ret = LTTNG_ERR_TRACE_ALREADY_STARTED;
-               goto error;
-       }
-
-       if (!session->start_consumer) {
-               ret = LTTNG_ERR_NO_CONSUMER;
-               goto error;
-       }
-
-       switch (domain) {
-       case 0:
-               DBG("Disable tracing session %s consumer", session->name);
-               consumer = session->consumer;
-               break;
-       case LTTNG_DOMAIN_KERNEL:
-               /* Code flow error if we don't have a kernel session here. */
-               assert(ksess);
-
-               DBG("Disabling kernel consumer");
-               consumer = ksess->consumer;
-
-               break;
-       case LTTNG_DOMAIN_UST:
-               /* Code flow error if we don't have a UST session here. */
-               assert(usess);
-
-               DBG("Disabling UST consumer");
-               consumer = usess->consumer;
-
-               break;
-       default:
-               ret = LTTNG_ERR_UNKNOWN_DOMAIN;
-               goto error;
-       }
-
-       if (consumer) {
-               consumer->enabled = 0;
-               /* Success at this point */
-               ret = LTTNG_OK;
-       } else {
-               ret = LTTNG_ERR_NO_CONSUMER;
-       }
-
-error:
-       return ret;
-}
-
-/*
- * Command LTTNG_ENABLE_CONSUMER processed by the client thread.
- */
-int cmd_enable_consumer(int domain, struct ltt_session *session)
-{
-       int ret;
-       struct ltt_kernel_session *ksess = session->kernel_session;
-       struct ltt_ust_session *usess = session->ust_session;
-       struct consumer_output *consumer = NULL;
-
-       assert(session);
-
-       /* Can't enable consumer after session started. */
-       if (session->enabled) {
-               ret = LTTNG_ERR_TRACE_ALREADY_STARTED;
-               goto error;
-       }
-
-       switch (domain) {
-       case 0:
-               assert(session->consumer);
-               consumer = session->consumer;
-               break;
-       case LTTNG_DOMAIN_KERNEL:
-               /* Code flow error if we don't have a kernel session here. */
-               assert(ksess);
-
-               /*
-                * Check if we have already sent fds to the consumer. In that case,
-                * the enable-consumer command can't be used because a start trace
-                * had previously occured.
-                */
-               if (ksess->consumer_fds_sent) {
-                       ret = LTTNG_ERR_ENABLE_CONSUMER_FAIL;
-                       goto error;
-               }
-
-               consumer = ksess->tmp_consumer;
-               if (consumer == NULL) {
-                       ret = LTTNG_OK;
-                       /* No temp. consumer output exists. Using the current one. */
-                       DBG3("No temporary consumer. Using default");
-                       consumer = ksess->consumer;
-                       goto error;
-               }
-
-               switch (consumer->type) {
-               case CONSUMER_DST_LOCAL:
-                       DBG2("Consumer output is local. Creating directory(ies)");
-
-                       /* Create directory(ies) */
-                       ret = run_as_mkdir_recursive(consumer->dst.trace_path,
-                                       S_IRWXU | S_IRWXG, session->uid, session->gid);
-                       if (ret < 0) {
-                               if (ret != -EEXIST) {
-                                       ERR("Trace directory creation error");
-                                       ret = LTTNG_ERR_FATAL;
-                                       goto error;
-                               }
-                       }
-                       break;
-               case CONSUMER_DST_NET:
-                       DBG2("Consumer output is network. Validating URIs");
-                       /* Validate if we have both control and data path set. */
-                       if (!consumer->dst.net.control_isset) {
-                               ret = LTTNG_ERR_URL_CTRL_MISS;
-                               goto error;
-                       }
-
-                       if (!consumer->dst.net.data_isset) {
-                               ret = LTTNG_ERR_URL_DATA_MISS;
-                               goto error;
-                       }
-
-                       /* Check established network session state */
-                       if (session->net_handle == 0) {
-                               ret = LTTNG_ERR_ENABLE_CONSUMER_FAIL;
-                               ERR("Session network handle is not set on enable-consumer");
-                               goto error;
-                       }
-
-                       break;
-               }
-
-               /*
-                * @session-lock
-                * This is race free for now since the session lock is acquired before
-                * ending up in this function. No other threads can access this kernel
-                * session without this lock hence freeing the consumer output object
-                * is valid.
-                */
-               rcu_read_lock();
-               /* Destroy current consumer. We are about to replace it */
-               consumer_destroy_output(ksess->consumer);
-               rcu_read_unlock();
-               ksess->consumer = consumer;
-               ksess->tmp_consumer = NULL;
-
-               break;
-       case LTTNG_DOMAIN_UST:
-               /* Code flow error if we don't have a UST session here. */
-               assert(usess);
-
-               /*
-                * Check if we have already sent fds to the consumer. In that case,
-                * the enable-consumer command can't be used because a start trace
-                * had previously occured.
-                */
-               if (usess->start_trace) {
-                       ret = LTTNG_ERR_ENABLE_CONSUMER_FAIL;
-                       goto error;
-               }
-
-               consumer = usess->tmp_consumer;
-               if (consumer == NULL) {
-                       ret = LTTNG_OK;
-                       /* No temp. consumer output exists. Using the current one. */
-                       DBG3("No temporary consumer. Using default");
-                       consumer = usess->consumer;
-                       goto error;
-               }
-
-               switch (consumer->type) {
-               case CONSUMER_DST_LOCAL:
-                       DBG2("Consumer output is local. Creating directory(ies)");
-
-                       /* Create directory(ies) */
-                       ret = run_as_mkdir_recursive(consumer->dst.trace_path,
-                                       S_IRWXU | S_IRWXG, session->uid, session->gid);
-                       if (ret < 0) {
-                               if (ret != -EEXIST) {
-                                       ERR("Trace directory creation error");
-                                       ret = LTTNG_ERR_FATAL;
-                                       goto error;
-                               }
-                       }
-                       break;
-               case CONSUMER_DST_NET:
-                       DBG2("Consumer output is network. Validating URIs");
-                       /* Validate if we have both control and data path set. */
-                       if (!consumer->dst.net.control_isset) {
-                               ret = LTTNG_ERR_URL_CTRL_MISS;
-                               goto error;
-                       }
-
-                       if (!consumer->dst.net.data_isset) {
-                               ret = LTTNG_ERR_URL_DATA_MISS;
-                               goto error;
-                       }
-
-                       /* Check established network session state */
-                       if (session->net_handle == 0) {
-                               ret = LTTNG_ERR_ENABLE_CONSUMER_FAIL;
-                               DBG2("Session network handle is not set on enable-consumer");
-                               goto error;
-                       }
-
-                       if (consumer->net_seq_index == -1) {
-                               ret = LTTNG_ERR_ENABLE_CONSUMER_FAIL;
-                               DBG2("Network index is not set on the consumer");
-                               goto error;
-                       }
-
-                       break;
-               }
-
-               /*
-                * @session-lock
-                * This is race free for now since the session lock is acquired before
-                * ending up in this function. No other threads can access this kernel
-                * session without this lock hence freeing the consumer output object
-                * is valid.
-                */
-               rcu_read_lock();
-               /* Destroy current consumer. We are about to replace it */
-               consumer_destroy_output(usess->consumer);
-               rcu_read_unlock();
-               usess->consumer = consumer;
-               usess->tmp_consumer = NULL;
-
-               break;
-       }
-
-       session->start_consumer = 1;
-
-       /* Enable it */
-       if (consumer) {
-               consumer->enabled = 1;
-               /* Success at this point */
-               ret = LTTNG_OK;
-       } else {
-               /* Should not really happend... */
-               ret = LTTNG_ERR_NO_CONSUMER;
-       }
-
-error:
-       return ret;
-}
-
 /*
  * Command LTTNG_DATA_PENDING returning 0 if the data is NOT pending meaning
  * ready for trace analysis (or anykind of reader) or else 1 for pending data.
index 59216138ce4a53fa7fe1ea84800fdacb5b05416b..96a6507b5a0c0d7762d027a9a8eef375125a0c2c 100644 (file)
@@ -62,8 +62,6 @@ int cmd_stop_trace(struct ltt_session *session);
 /* Consumer commands */
 int cmd_register_consumer(struct ltt_session *session, int domain,
                const char *sock_path, struct consumer_data *cdata);
-int cmd_disable_consumer(int domain, struct ltt_session *session);
-int cmd_enable_consumer(int domain, struct ltt_session *session);
 int cmd_set_consumer_uri(int domain, struct ltt_session *session,
                size_t nb_uri, struct lttng_uri *uris);
 int cmd_setup_relayd(struct ltt_session *session);
index fc0eb5cb6bbed1ef3b4727eb74a6135b0347fb4c..e9529f1bf9378dc46bb3ddeaa250b10fafaef249 100644 (file)
@@ -2343,8 +2343,7 @@ static int process_client_msg(struct command_ctx *cmd_ctx, int sock,
                        /* Start the kernel consumer daemon */
                        pthread_mutex_lock(&kconsumer_data.pid_mutex);
                        if (kconsumer_data.pid == 0 &&
-                                       cmd_ctx->lsm->cmd_type != LTTNG_REGISTER_CONSUMER &&
-                                       cmd_ctx->session->start_consumer) {
+                                       cmd_ctx->lsm->cmd_type != LTTNG_REGISTER_CONSUMER) {
                                pthread_mutex_unlock(&kconsumer_data.pid_mutex);
                                ret = start_consumerd(&kconsumer_data);
                                if (ret < 0) {
@@ -2391,8 +2390,7 @@ static int process_client_msg(struct command_ctx *cmd_ctx, int sock,
                        pthread_mutex_lock(&ustconsumer64_data.pid_mutex);
                        if (consumerd64_bin[0] != '\0' &&
                                        ustconsumer64_data.pid == 0 &&
-                                       cmd_ctx->lsm->cmd_type != LTTNG_REGISTER_CONSUMER &&
-                                       cmd_ctx->session->start_consumer) {
+                                       cmd_ctx->lsm->cmd_type != LTTNG_REGISTER_CONSUMER) {
                                pthread_mutex_unlock(&ustconsumer64_data.pid_mutex);
                                ret = start_consumerd(&ustconsumer64_data);
                                if (ret < 0) {
@@ -2420,8 +2418,7 @@ static int process_client_msg(struct command_ctx *cmd_ctx, int sock,
                        /* 32-bit */
                        if (consumerd32_bin[0] != '\0' &&
                                        ustconsumer32_data.pid == 0 &&
-                                       cmd_ctx->lsm->cmd_type != LTTNG_REGISTER_CONSUMER &&
-                                       cmd_ctx->session->start_consumer) {
+                                       cmd_ctx->lsm->cmd_type != LTTNG_REGISTER_CONSUMER) {
                                pthread_mutex_unlock(&ustconsumer32_data.pid_mutex);
                                ret = start_consumerd(&ustconsumer32_data);
                                if (ret < 0) {
@@ -2530,41 +2527,12 @@ skip_domain:
                                cmd_ctx->lsm->u.disable.channel_name);
                break;
        }
-       case LTTNG_DISABLE_CONSUMER:
-       {
-               ret = cmd_disable_consumer(cmd_ctx->lsm->domain.type, cmd_ctx->session);
-               break;
-       }
        case LTTNG_ENABLE_CHANNEL:
        {
                ret = cmd_enable_channel(cmd_ctx->session, cmd_ctx->lsm->domain.type,
                                &cmd_ctx->lsm->u.channel.chan, kernel_poll_pipe[1]);
                break;
        }
-       case LTTNG_ENABLE_CONSUMER:
-       {
-               /*
-                * XXX: 0 means that this URI should be applied on the session. Should
-                * be a DOMAIN enuam.
-                */
-               ret = cmd_enable_consumer(cmd_ctx->lsm->domain.type, cmd_ctx->session);
-               if (ret != LTTNG_OK) {
-                       goto error;
-               }
-
-               if (cmd_ctx->lsm->domain.type == 0) {
-                       /* Add the URI for the UST session if a consumer is present. */
-                       if (cmd_ctx->session->ust_session &&
-                                       cmd_ctx->session->ust_session->consumer) {
-                               ret = cmd_enable_consumer(LTTNG_DOMAIN_UST, cmd_ctx->session);
-                       } else if (cmd_ctx->session->kernel_session &&
-                                       cmd_ctx->session->kernel_session->consumer) {
-                               ret = cmd_enable_consumer(LTTNG_DOMAIN_KERNEL,
-                                               cmd_ctx->session);
-                       }
-               }
-               break;
-       }
        case LTTNG_ENABLE_EVENT:
        {
                ret = cmd_enable_event(cmd_ctx->session, cmd_ctx->lsm->domain.type,
index 6fb6bd3602256abffe4b8f0922e0a9baeb57bc32..076d2cbc46ea9243dbe636350d01592e6d40a880 100644 (file)
@@ -199,11 +199,6 @@ int session_create(char *name, char *path, uid_t uid, gid_t gid)
                        ret = LTTNG_ERR_FATAL;
                        goto error_asprintf;
                }
-               new_session->start_consumer = 1;
-       } else {
-               /* No path indicates that there is no use for a consumer. */
-               new_session->start_consumer = 0;
-               new_session->path[0] = '\0';
        }
 
        /* Init kernel session */
index 8a3504f43b925c5389a69682e57e9be2c735a46a..d49cf430ac627379459911928f4dc40d63add329 100644 (file)
@@ -83,9 +83,6 @@ struct ltt_session {
         */
        struct consumer_output *consumer;
 
-       /* Indicates whether or not we have to spawn consumer(s) */
-       unsigned int start_consumer;
-
        /* Did a start command occured before the kern/ust session creation? */
        unsigned int started;
 };
index 6c7ab786e5d25fc90ca4b2606ee67a6bb9ff0f49..5588d4267bae2d304facb6ea73866f175f46e2e8 100644 (file)
@@ -92,8 +92,10 @@ static void usage(FILE *ofp)
        fprintf(ofp, "  -C, --ctrl-url=URL   Set control path URL. (Must use -D also)\n");
        fprintf(ofp, "  -D, --data-url=URL   Set data path URL. (Must use -C also)\n");
        fprintf(ofp, "      --no-consumer    Don't activate a consumer for this session.\n");
+       fprintf(ofp, "                       OBSELETE\n");
        fprintf(ofp, "      --disable-consumer\n");
        fprintf(ofp, "                       Disable consumer for this session.\n");
+       fprintf(ofp, "                       OBSELETE\n");
        fprintf(ofp, "\n");
        fprintf(ofp, "Please refer to the man page (lttng(1)) for more information on network\n");
        fprintf(ofp, "streaming mechanisms and explanation of the control and data port\n");
@@ -170,79 +172,6 @@ error:
        return ret;
 }
 
-/*
- * 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;
-}
-
 /*
  *  Create a tracing session.
  *  If no name is specified, a default name is generated.
@@ -291,10 +220,7 @@ static int create_session(void)
                }
        }
 
-       if (opt_no_consumer) {
-               url = NULL;
-               print_str_url = "";
-       } else if (opt_output_path != NULL) {
+       if (opt_output_path != NULL) {
                traces_path = utils_expand_path(opt_output_path);
                if (traces_path == NULL) {
                        ret = CMD_ERROR;
@@ -338,6 +264,8 @@ static int create_session(void)
                print_str_url = alloc_url + strlen("file://");
        }
 
+       assert(url);
+
        ret = _lttng_create_session_ext(session_name, url, datetime);
        if (ret < 0) {
                /* Don't set ret so lttng can interpret the sessiond error. */
@@ -360,11 +288,6 @@ static int create_session(void)
                if (ret < 0) {
                        goto error;
                }
-
-               ret = enable_consumer(session_name);
-               if (ret < 0) {
-                       goto error;
-               }
        } else if ((!opt_ctrl_url && opt_data_url) ||
                        (opt_ctrl_url && !opt_data_url)) {
                ERR("You need both control and data URL.");
@@ -372,13 +295,6 @@ static int create_session(void)
                goto error;
        }
 
-       if (opt_disable_consumer && !opt_no_consumer) {
-               ret = disable_consumer(session_name);
-               if (ret < 0) {
-                       goto error;
-               }
-       }
-
        /* Init lttng session config */
        ret = config_init(session_name);
        if (ret < 0) {
@@ -428,6 +344,18 @@ int cmd_create(int argc, const char **argv)
                }
        }
 
+       if (opt_no_consumer) {
+               MSG("The option --no-consumer is obsolete.");
+               ret = CMD_WARNING;
+               goto end;
+       }
+
+       if (opt_disable_consumer) {
+               MSG("The option --disable-consumer is obsolete.");
+               ret = CMD_WARNING;
+               goto end;
+       }
+
        opt_session_name = (char*) poptGetArg(pc);
 
        ret = create_session();
index ead58b89051353f7c3d91352c6d522525adb23bf..ca649ecd1518a4df17bde05c010522675df803db 100644 (file)
 #include "../command.h"
 #include "../utils.h"
 
-#include <common/defaults.h>
-#include <common/sessiond-comm/sessiond-comm.h>
-#include <common/uri.h>
-
-static int opt_kernel;
-static int opt_userspace;
-static char *opt_session_name;
-
-static struct lttng_handle *handle;
-
-enum {
-       OPT_HELP = 1,
-       OPT_LIST_OPTIONS,
-};
-
-static struct poptOption long_options[] = {
-       /* longName, shortName, argInfo, argPtr, value, descrip, argDesc */
-       {"help",           'h', POPT_ARG_NONE, NULL, OPT_HELP, NULL, NULL},
-       {"list-options",     0, POPT_ARG_NONE, NULL, OPT_LIST_OPTIONS, NULL, NULL},
-       {"session",        's', POPT_ARG_STRING, &opt_session_name, 0, 0, 0},
-       {"kernel",         'k', POPT_ARG_VAL, &opt_kernel, 1, 0, 0},
-       {"userspace",      'u', POPT_ARG_VAL, &opt_userspace, 1, 0, 0},
-       {0, 0, 0, 0, 0, 0, 0}
-};
-
-/*
- * usage
- */
-static void usage(FILE *ofp)
-{
-       fprintf(ofp, "usage: lttng disable-consumer [-u|-k] [OPTIONS]\n");
-       fprintf(ofp, "\n");
-       fprintf(ofp, "Disable the consumer for a tracing session. This call can\n");
-       fprintf(ofp, "be done BEFORE tracing has started.\n");
-       fprintf(ofp, "\n");
-       fprintf(ofp, "Options:\n");
-       fprintf(ofp, "  -h, --help           Show this help\n");
-       fprintf(ofp, "      --list-options   Simple listing of options\n");
-       fprintf(ofp, "  -s, --session NAME   Apply to session name\n");
-       fprintf(ofp, "  -k, --kernel         Apply to the kernel tracer\n");
-       fprintf(ofp, "  -u, --userspace      Apply to the user-space tracer\n");
-       fprintf(ofp, "\n");
-}
-
-/*
- * Disable consumer command.
- */
-static int disable_consumer(char *session_name)
-{
-       int ret = CMD_SUCCESS;
-       struct lttng_domain dom;
-
-       memset(&dom, 0, sizeof(dom));
-
-       /* Create lttng domain */
-       if (opt_kernel) {
-               dom.type = LTTNG_DOMAIN_KERNEL;
-       } else if (opt_userspace) {
-               dom.type = LTTNG_DOMAIN_UST;
-       } else {
-               ERR("Please specify a tracer (-k/--kernel or -u/--userspace)");
-               ret = CMD_ERROR;
-               goto error;
-       }
-
-       handle = lttng_create_handle(session_name, &dom);
-       if (handle == NULL) {
-               ret = -1;
-               goto error;
-       }
-
-       ret = lttng_disable_consumer(handle);
-       if (ret < 0) {
-               ERR("Disabling consumer for session %s: %s", session_name,
-                               lttng_strerror(ret));
-               goto error;
-       }
-
-       MSG("Consumer disabled successfully");
-
-error:
-       lttng_destroy_handle(handle);
-       return ret;
-}
-
 /*
  * The 'disable-consumer <options>' first level command
  *
@@ -120,46 +35,10 @@ error:
  */
 int cmd_disable_consumer(int argc, const char **argv)
 {
-       int opt, ret = CMD_SUCCESS;
-       static poptContext pc;
-       char *session_name = NULL;
-
-       pc = poptGetContext(NULL, argc, argv, long_options, 0);
-       poptReadDefaultConfig(pc, 0);
-
-       while ((opt = poptGetNextOpt(pc)) != -1) {
-               switch (opt) {
-               case OPT_HELP:
-                       usage(stdout);
-                       goto end;
-               case OPT_LIST_OPTIONS:
-                       list_cmd_options(stdout, long_options);
-                       goto end;
-               default:
-                       usage(stderr);
-                       ret = CMD_UNDEFINED;
-                       goto end;
-               }
-       }
-
-       /* Get session name */
-       if (!opt_session_name) {
-               session_name = get_session_name();
-               if (session_name == NULL) {
-                       ret = CMD_ERROR;
-                       goto end;
-               }
-       } else {
-               session_name = opt_session_name;
-       }
-
-       ret = disable_consumer(session_name);
+       int ret;
 
-end:
-       if (opt_session_name == NULL) {
-               free(session_name);
-       }
+       MSG("The disable-consumer command is now obselete.");
+       ret = CMD_WARNING;
 
-       poptFreeContext(pc);
        return ret;
 }
index 6a635f424bb9c90b0693f6b8a35eb58b7396c371..ecb0b239bb914de4b2967246cef3d270eb28aaab 100644 (file)
 #include "../command.h"
 #include "../utils.h"
 
-#include <common/defaults.h>
-#include <common/sessiond-comm/sessiond-comm.h>
-#include <common/uri.h>
-
-static int opt_kernel;
-static int opt_userspace;
-static int opt_enable;
-static char *opt_session_name;
-static char *opt_url;
-static char *opt_ctrl_url;
-static char *opt_data_url;
-static char *opt_url_arg;
-
-static struct lttng_handle *handle;
-
-enum {
-       OPT_HELP = 1,
-       OPT_LIST_OPTIONS,
-};
-
-static struct poptOption long_options[] = {
-       /* longName, shortName, argInfo, argPtr, value, descrip, argDesc */
-       {"help",           'h', POPT_ARG_NONE, NULL, OPT_HELP, NULL, NULL},
-       {"list-options",     0, POPT_ARG_NONE, NULL, OPT_LIST_OPTIONS, NULL, NULL},
-       {"session",        's', POPT_ARG_STRING, &opt_session_name, 0, 0, 0},
-       {"kernel",         'k', POPT_ARG_VAL, &opt_kernel, 1, 0, 0},
-       {"userspace",      'u', POPT_ARG_VAL, &opt_userspace, 1, 0, 0},
-       {"set-uri",        'U', POPT_ARG_STRING, &opt_url, 0, 0, 0},
-       {"ctrl-uri",       'C', POPT_ARG_STRING, &opt_ctrl_url, 0, 0, 0},
-       {"data-uri",       'D', POPT_ARG_STRING, &opt_data_url, 0, 0, 0},
-       {"enable",         'e', POPT_ARG_VAL, &opt_enable, 1, 0, 0},
-       {0, 0, 0, 0, 0, 0, 0}
-};
-
-/*
- * usage
- */
-static void usage(FILE *ofp)
-{
-       fprintf(ofp, "usage: lttng enable-consumer [-u|-k] [URL] [OPTIONS]\n");
-       fprintf(ofp, "\n");
-       fprintf(ofp, "The default behavior is to enable a consumer to the current URL.\n");
-       fprintf(ofp, "The default URL is the local filesystem at the path of the session.\n");
-       fprintf(ofp, "\n");
-       fprintf(ofp, "The enable-consumer feature supports both local and network transport.\n");
-       fprintf(ofp, "You must have a running lttng-relayd for network transmission.\n");
-       fprintf(ofp, "\n");
-       fprintf(ofp, "Options:\n");
-       fprintf(ofp, "  -h, --help           Show this help\n");
-       fprintf(ofp, "      --list-options   Simple listing of options\n");
-       fprintf(ofp, "  -s, --session NAME   Apply to session name\n");
-       fprintf(ofp, "  -k, --kernel         Apply to the kernel tracer\n");
-       fprintf(ofp, "  -u, --userspace      Apply to the user-space tracer\n");
-       fprintf(ofp, "\n");
-       fprintf(ofp, "Extended Options:\n");
-       fprintf(ofp, "\n");
-       fprintf(ofp, "Using these options, each API call can be controlled individually.\n");
-       fprintf(ofp, "For instance, -C does not enable the consumer automatically.\n");
-       fprintf(ofp, "\n");
-       fprintf(ofp, "  -U, --set-uri=URL    Set URL for the enable-consumer destination.\n");
-       fprintf(ofp, "                       It is persistent for the session lifetime.\n");
-       fprintf(ofp, "                       Redo the command to change it.\n");
-       fprintf(ofp, "                       This will set both data and control URL for network.\n");
-       fprintf(ofp, "  -C, --ctrl-url=URL   Set control path URL. (Must use -D also)\n");
-       fprintf(ofp, "  -D, --data-url=URL   Set data path URL. (Must use -C also)\n");
-       fprintf(ofp, "  -e, --enable         Enable consumer\n");
-       fprintf(ofp, "\n");
-       fprintf(ofp, "\n");
-       fprintf(ofp, "Please refer to the man page (lttng(1)) for more information on network\n");
-       fprintf(ofp, "streaming mechanisms and explanation of the control and data port\n");
-       fprintf(ofp, "\n");
-       fprintf(ofp, "URL format is has followed:\n");
-       fprintf(ofp, "\n");
-       fprintf(ofp, "  proto://[HOST|IP][:PORT1[:PORT2]][/TRACE_PATH]\n");
-       fprintf(ofp, "\n");
-       fprintf(ofp, "  Supported protocols are (proto):\n");
-       fprintf(ofp, "  > file://...\n");
-       fprintf(ofp, "    Local filesystem full path.\n");
-       fprintf(ofp, "\n");
-       fprintf(ofp, "  > net[6]://...\n");
-       fprintf(ofp, "    This will use the default network transport layer which is\n");
-       fprintf(ofp, "    TCP for both control (PORT1) and data port (PORT2).\n");
-       fprintf(ofp, "    The default ports are respectively 5342 and 5343.\n");
-       fprintf(ofp, "\n");
-       fprintf(ofp, "  > tcp[4|6]://...\n");
-       fprintf(ofp, "    Can only be used with -C and -D together\n");
-       fprintf(ofp, "\n");
-       fprintf(ofp, "NOTE: IPv6 address MUST be enclosed in brackets '[]' (rfc2732)\n");
-       fprintf(ofp, "\n");
-       fprintf(ofp, "Examples:\n");
-       fprintf(ofp, "    # lttng enable-consumer -u net://192.168.1.42\n");
-       fprintf(ofp, "    Uses TCP and default ports for user space tracing (-u).\n");
-       fprintf(ofp, "\n");
-}
-
-/*
- * Enable consumer command.
- */
-static int enable_consumer(char *session_name, int domain)
-{
-       int ret = CMD_SUCCESS;
-       int run_enable_cmd = 1;
-       struct lttng_domain dom;
-
-       memset(&dom, 0, sizeof(dom));
-
-       dom.type = domain;
-
-       handle = lttng_create_handle(session_name, &dom);
-       if (handle == NULL) {
-               ret = -1;
-               goto error;
-       }
-
-       /* Handle trailing arguments */
-       if (opt_url_arg) {
-               ret = lttng_set_consumer_url(handle, opt_url_arg, NULL);
-               if (ret < 0) {
-                       ERR("%s", lttng_strerror(ret));
-                       goto error;
-               }
-
-               MSG("URL %s set for %s session %s.", opt_url_arg,
-                               (domain == LTTNG_DOMAIN_KERNEL) ? "kernel" : "UST",
-                               session_name);
-       }
-
-       /* Handling URLs (-U opt) */
-       if (opt_url) {
-               ret = lttng_set_consumer_url(handle, opt_url, NULL);
-               if (ret < 0) {
-                       ERR("%s", lttng_strerror(ret));
-                       goto error;
-               }
-
-               /* opt_enable will tell us to run or not the enable_consumer cmd. */
-               run_enable_cmd = 0;
-
-               MSG("URL %s set for %s session %s.", opt_url,
-                               (domain == LTTNG_DOMAIN_KERNEL) ? "kernel" : "UST",
-                               session_name);
-       }
-
-       /* Setting up control URL (-C or/and -D opt) */
-       if (opt_ctrl_url || opt_data_url) {
-               ret = lttng_set_consumer_url(handle, opt_ctrl_url, opt_data_url);
-               if (ret < 0) {
-                       ERR("%s", lttng_strerror(ret));
-                       goto error;
-               }
-
-               /* opt_enable will tell us to run or not the enable_consumer cmd. */
-               run_enable_cmd = 0;
-
-               if (opt_ctrl_url) {
-                       MSG("Control URL %s set for %s session %s.", opt_ctrl_url,
-                                       (domain == LTTNG_DOMAIN_KERNEL) ? "kernel" : "UST",
-                                       session_name);
-               }
-
-               if (opt_data_url) {
-                       MSG("Data URL %s set for %s session %s.", opt_data_url,
-                                       (domain == LTTNG_DOMAIN_KERNEL) ? "kernel" : "UST",
-                                       session_name);
-               }
-       }
-
-       /* Enable consumer (-e opt) */
-       if (opt_enable || run_enable_cmd) {
-               ret = lttng_enable_consumer(handle);
-               if (ret < 0) {
-                       ERR("Enabling consumer for session %s: %s", session_name,
-                                       lttng_strerror(ret));
-                       if (ret == -LTTNG_ERR_ENABLE_CONSUMER_FAIL) {
-                               ERR("Perhaps the session was previously started?");
-                       }
-                       goto error;
-               }
-
-               MSG("Consumer enabled successfully");
-       }
-
-error:
-       lttng_destroy_handle(handle);
-       return ret;
-}
-
 /*
  * The 'enable-consumer <options>' first level command
  *
@@ -222,61 +35,10 @@ error:
  */
 int cmd_enable_consumer(int argc, const char **argv)
 {
-       int opt, ret = CMD_SUCCESS;
-       static poptContext pc;
-       char *session_name = NULL;
-
-       pc = poptGetContext(NULL, argc, argv, long_options, 0);
-       poptReadDefaultConfig(pc, 0);
-
-       while ((opt = poptGetNextOpt(pc)) != -1) {
-               switch (opt) {
-               case OPT_HELP:
-                       usage(stdout);
-                       goto end;
-               case OPT_LIST_OPTIONS:
-                       list_cmd_options(stdout, long_options);
-                       goto end;
-               default:
-                       usage(stderr);
-                       ret = CMD_UNDEFINED;
-                       goto end;
-               }
-       }
-
-       opt_url_arg = (char *) poptGetArg(pc);
-       DBG("URLs: %s", opt_url_arg);
-
-       /* Get session name */
-       if (!opt_session_name) {
-               session_name = get_session_name();
-               if (session_name == NULL) {
-                       ret = CMD_ERROR;
-                       goto end;
-               }
-       } else {
-               session_name = opt_session_name;
-       }
-
-       if (opt_kernel || (!opt_kernel && !opt_userspace)) {
-               ret = enable_consumer(session_name, LTTNG_DOMAIN_KERNEL);
-               if (ret < 0) {
-                       goto end;
-               }
-       }
-
-       if (opt_userspace || (!opt_kernel && !opt_userspace)) {
-               ret = enable_consumer(session_name, LTTNG_DOMAIN_UST);
-               if (ret < 0) {
-                       goto end;
-               }
-       }
+       int ret;
 
-end:
-       if (opt_session_name == NULL) {
-               free(session_name);
-       }
+       MSG("The enable-consumer command is now obselete.");
+       ret = CMD_WARNING;
 
-       poptFreeContext(pc);
        return ret;
 }
index e6ca9cfd9877485339188fbbbf1626f0a8d21ae7..85621444c32cb1b34f217dc2ec95ae9315c8cf29 100644 (file)
@@ -74,8 +74,8 @@ static struct cmd_struct commands[] =  {
        { "version", cmd_version},
        { "calibrate", cmd_calibrate},
        { "view", cmd_view},
-       { "enable-consumer", cmd_enable_consumer},
-       { "disable-consumer", cmd_disable_consumer},
+       { "enable-consumer", cmd_enable_consumer}, /* OBSELETE */
+       { "disable-consumer", cmd_disable_consumer}, /*OBSELETE */
        { NULL, NULL}   /* Array closure */
 };
 
@@ -103,8 +103,6 @@ static void usage(FILE *ofp)
        fprintf(ofp, "    enable-event      Enable tracing event\n");
        fprintf(ofp, "    disable-channel   Disable tracing channel\n");
        fprintf(ofp, "    disable-event     Disable tracing event\n");
-       fprintf(ofp, "    enable-consumer   Enable local or streaming consumer\n");
-       fprintf(ofp, "    disable-consumer  Disable consumer\n");
        fprintf(ofp, "    list              List possible tracing options\n");
        fprintf(ofp, "    set-session       Set current session name\n");
        fprintf(ofp, "    start             Start tracing\n");
index 62a813a3e9808f638307d864b4a6ee686189eb51..134e5a28529c943dce0707546d9192613d86aa0c 100644 (file)
@@ -103,6 +103,8 @@ static const char *error_string_array[] = {
        [ ERROR_INDEX(LTTNG_ERR_SESSION_STARTED) ] = "Session is running",
        [ ERROR_INDEX(LTTNG_ERR_NOT_SUPPORTED) ] = "Operation not supported",
        [ ERROR_INDEX(LTTNG_ERR_UST_EVENT_ENABLED) ] = "UST event already enabled",
+       [ ERROR_INDEX(LTTNG_ERR_SET_URL) ] = "Error setting URL",
+       [ ERROR_INDEX(LTTNG_ERR_URL_EXIST) ] = "URL already exists",
 
        /* Last element */
        [ ERROR_INDEX(LTTNG_ERR_NR) ] = "Unknown error code"
index 9ea891e92f980d037a47328a83ddeb79c4ec8c26..205744ef76eb596749494328553431473a9a276e 100644 (file)
@@ -1455,47 +1455,19 @@ int lttng_set_consumer_url(struct lttng_handle *handle,
 }
 
 /*
- * Enable consumer for a session and domain.
- *
- * Return 0 on success, else a negative value.
+ * [OBSELETE]
  */
 int lttng_enable_consumer(struct lttng_handle *handle)
 {
-       struct lttcomm_session_msg lsm;
-
-       if (handle == NULL) {
-               return -LTTNG_ERR_INVALID;
-       }
-
-       lsm.cmd_type = LTTNG_ENABLE_CONSUMER;
-
-       copy_string(lsm.session.name, handle->session_name,
-                       sizeof(lsm.session.name));
-       copy_lttng_domain(&lsm.domain, &handle->domain);
-
-       return ask_sessiond(&lsm, NULL);
+       return -ENOSYS;
 }
 
 /*
- * Disable consumer for a session and domain.
- *
- * Return 0 on success, else a negative value.
+ * [OBSELETE]
  */
 int lttng_disable_consumer(struct lttng_handle *handle)
 {
-       struct lttcomm_session_msg lsm;
-
-       if (handle == NULL) {
-               return -LTTNG_ERR_INVALID;
-       }
-
-       lsm.cmd_type = LTTNG_DISABLE_CONSUMER;
-
-       copy_string(lsm.session.name, handle->session_name,
-                       sizeof(lsm.session.name));
-       copy_lttng_domain(&lsm.domain, &handle->domain);
-
-       return ask_sessiond(&lsm, NULL);
+       return -ENOSYS;
 }
 
 /*
index 7d6324d296e79609b3d6a5b226ee128c7a2c2d4e..545cae7c825b605f01c034712041b36b490be5bb 100755 (executable)
@@ -43,24 +43,11 @@ if [ -z "$out" ]; then
        exit 0
 fi
 
-function lttng_create_session
+function lttng_create_session_uri
 {
        echo -n "Creating session $SESSION_NAME... "
        # Create session with default path
-       $TESTDIR/../src/bin/lttng/$LTTNG_BIN create $SESSION_NAME >/dev/null 2>&1
-       if [ $? -eq 1 ]; then
-               print_fail
-               return 1
-       else
-               print_ok
-       fi
-}
-
-function lttng_enable_consumer_localhost
-{
-       echo -n "Enabling network consumer... "
-       # Create session with default path
-       $TESTDIR/../src/bin/lttng/$LTTNG_BIN enable-consumer -k net://localhost >/dev/null 2>&1
+       $TESTDIR/../src/bin/lttng/$LTTNG_BIN create $SESSION_NAME -U net://localhost >/dev/null 2>&1
        if [ $? -eq 1 ]; then
                print_fail
                return 1
@@ -72,8 +59,7 @@ function lttng_enable_consumer_localhost
 function test_kernel_before_start ()
 {
        echo -e "\n=== Testing kernel streaming with event enable BEFORE start\n"
-       lttng_create_session
-       lttng_enable_consumer_localhost
+       lttng_create_session_uri
        lttng_enable_kernel_event $SESSION_NAME $EVENT_NAME
        start_lttng_tracing $SESSION_NAME
        # Give a second
@@ -96,8 +82,7 @@ function test_kernel_before_start ()
 function test_kernel_after_start ()
 {
        echo -e "\n=== Testing kernel streaming with event enable AFTER start\n"
-       lttng_create_session
-       lttng_enable_consumer_localhost
+       lttng_create_session_uri
        start_lttng_tracing $SESSION_NAME
        lttng_enable_kernel_event $SESSION_NAME $EVENT_NAME
        # Give a second
index 277807faa1ec4187b3dbd48333bc0c8b924b3c78..28b72f8245cceb27a5d34f961f7c4ae579509409 100755 (executable)
@@ -34,16 +34,10 @@ if [ ! -x "$CURDIR/$BIN_NAME" ]; then
        exit 0
 fi
 
-function lttng_create_session
+function lttng_create_session_uri
 {
        # Create session with default path
-       $TESTDIR/../src/bin/lttng/$LTTNG_BIN create $SESSION_NAME >/dev/null 2>&1
-}
-
-function lttng_enable_consumer
-{
-       # Create session with default path
-       $TESTDIR/../src/bin/lttng/$LTTNG_BIN enable-consumer -u net://localhost >/dev/null 2>&1
+       $TESTDIR/../src/bin/lttng/$LTTNG_BIN create $SESSION_NAME -U net://localhost >/dev/null 2>&1
 }
 
 function wait_apps
@@ -61,8 +55,7 @@ function wait_apps
 function test_ust_before_start ()
 {
        echo -e "\n=== Testing UST streaming BEFORE tracing starts\n"
-       lttng_create_session
-       lttng_enable_consumer
+       lttng_create_session_uri
        enable_ust_lttng_event $SESSION_NAME $EVENT_NAME
 
        # Run 5 times with a 1 second delay
@@ -78,8 +71,7 @@ function test_ust_before_start ()
 function test_ust_after_start ()
 {
        echo -e "\n=== Testing UST streaming AFTER tracing starts\n"
-       lttng_create_session
-       lttng_enable_consumer
+       lttng_create_session_uri
        enable_ust_lttng_event $SESSION_NAME $EVENT_NAME
        start_lttng_tracing $SESSION_NAME
 
This page took 0.070386 seconds and 4 git commands to generate.