X-Git-Url: https://git.lttng.org/?a=blobdiff_plain;f=src%2Fbin%2Flttng%2Fcommands%2Fstop.c;h=998a2a42a425c1472c6b704fdf993a39e8772dc9;hb=5556277c49932fd8a53d0da595de3870839b05d8;hp=fbabc510039f2f5fc8c5486b6240bf64d6326780;hpb=d14d33bf091e72b23b1f90ea18a0a01bed098b76;p=lttng-tools.git diff --git a/src/bin/lttng/commands/stop.c b/src/bin/lttng/commands/stop.c index fbabc5100..998a2a42a 100644 --- a/src/bin/lttng/commands/stop.c +++ b/src/bin/lttng/commands/stop.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 stop [options] [NAME]\n"); + fprintf(ofp, "usage: lttng stop [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"); @@ -75,7 +78,14 @@ static int stop_tracing(void) ret = lttng_stop_tracing(session_name); if (ret < 0) { - /* Don't set ret so lttng can interpret the sessiond error. */ + switch (-ret) { + case LTTCOMM_TRACE_ALREADY_STOPPED: + WARN("Tracing already stopped for session %s", session_name); + break; + default: + ERR("%s", lttng_strerror(ret)); + break; + } goto free_name; }