X-Git-Url: https://git.lttng.org/?a=blobdiff_plain;f=src%2Fbin%2Flttng%2Fcommands%2Fstart.c;h=82b3f5f867923dc1c16eaa7eff158331d4f5dc99;hb=c7e35b037773dbbfe10178c946ba44feefb226e1;hp=0f44f4cdac511a750d884546cc65d6a96001d52f;hpb=d14d33bf091e72b23b1f90ea18a0a01bed098b76;p=lttng-tools.git diff --git a/src/bin/lttng/commands/start.c b/src/bin/lttng/commands/start.c index 0f44f4cda..82b3f5f86 100644 --- a/src/bin/lttng/commands/start.c +++ b/src/bin/lttng/commands/start.c @@ -26,6 +26,8 @@ #include "../command.h" +#include + static char *opt_session_name; enum { @@ -45,11 +47,12 @@ static struct poptOption long_options[] = { */ static void usage(FILE *ofp) { - fprintf(ofp, "usage: lttng start [options] [NAME]\n"); + fprintf(ofp, "usage: lttng start [NAME] [OPTIONS]\n"); fprintf(ofp, "\n"); fprintf(ofp, "Where NAME is an optional session name. If not specified, lttng will\n"); fprintf(ofp, "get it from the configuration directory (.lttng).\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, "\n"); @@ -79,7 +82,14 @@ static int start_tracing(void) ret = lttng_start_tracing(session_name); if (ret < 0) { - /* Don't set ret so lttng can interpret the sessiond error. */ + switch (-ret) { + case LTTNG_ERR_TRACE_ALREADY_STARTED: + WARN("Tracing already started for session %s", session_name); + break; + default: + ERR("%s", lttng_strerror(ret)); + break; + } goto free_name; } @@ -108,6 +118,13 @@ int cmd_start(int argc, const char **argv) pc = poptGetContext(NULL, argc, argv, long_options, 0); poptReadDefaultConfig(pc, 0); + /* TODO: mi support */ + if (lttng_opt_mi) { + ret = -LTTNG_ERR_MI_NOT_IMPLEMENTED; + ERR("mi option not supported"); + goto end; + } + while ((opt = poptGetNextOpt(pc)) != -1) { switch (opt) { case OPT_HELP: