X-Git-Url: https://git.lttng.org/?a=blobdiff_plain;f=src%2Fbin%2Flttng%2Flttng.c;h=16582b0363b86fa1405d4afd6d1751f3c36b9499;hb=a186a15913c34e8adc83ea71565d3b0eec296774;hp=438320d97616bca6f6ac3bbe4280e4a0d61ddf55;hpb=ae8564917fa3cb3497ec17951d8ac0ee28de9c81;p=lttng-tools.git diff --git a/src/bin/lttng/lttng.c b/src/bin/lttng/lttng.c index 438320d97..16582b036 100644 --- a/src/bin/lttng/lttng.c +++ b/src/bin/lttng/lttng.c @@ -26,6 +26,7 @@ #include #include #include +#include #include #include @@ -76,6 +77,7 @@ static struct cmd_struct commands[] = { { "set-session", cmd_set_session}, { "version", cmd_version}, { "calibrate", cmd_calibrate}, + { "view", cmd_view}, { NULL, NULL} /* Array closure */ }; @@ -108,6 +110,7 @@ static void usage(FILE *ofp) fprintf(ofp, " start Start tracing\n"); fprintf(ofp, " stop Stop tracing\n"); fprintf(ofp, " version Show version information\n"); + fprintf(ofp, " view Start trace viewer\n"); fprintf(ofp, "\n"); fprintf(ofp, "Each command also has its own -h, --help option.\n"); fprintf(ofp, "\n"); @@ -399,7 +402,8 @@ static int check_args_no_sessiond(int argc, char **argv) strncmp(argv[i], "--h", sizeof("--h")) == 0 || strncmp(argv[i], "--list-options", sizeof("--list-options")) == 0 || strncmp(argv[i], "--list-commands", sizeof("--list-commands")) == 0 || - strncmp(argv[i], "version", sizeof("version"))) { + strncmp(argv[i], "version", sizeof("version")) == 0 || + strncmp(argv[i], "view", sizeof("view")) == 0) { return 1; } } @@ -465,12 +469,14 @@ static int parse_args(int argc, char **argv) /* Spawn session daemon if needed */ if (opt_no_sessiond == 0 && check_args_no_sessiond(argc, argv) == 0 && (check_sessiond() < 0)) { + ret = 1; goto error; } /* No leftovers, print usage and quit */ if ((argc - optind) == 0) { usage(stderr); + ret = 1; goto error; }