X-Git-Url: https://git.lttng.org/?a=blobdiff_plain;f=src%2Fbin%2Flttng%2Flttng.c;h=10b5d191e84dc068a0ed713760990ac4e798ce27;hb=97e190465f6a2a7d5bf72f445bb4d9d8544a0916;hp=f84ba63d7e8de48e4a9b6f44c79bbeffa72a7a89;hpb=baa81d3ac6e60bf3caf261342e10a7f85e87e23a;p=lttng-tools.git diff --git a/src/bin/lttng/lttng.c b/src/bin/lttng/lttng.c index f84ba63d7..10b5d191e 100644 --- a/src/bin/lttng/lttng.c +++ b/src/bin/lttng/lttng.c @@ -26,6 +26,7 @@ #include #include #include +#include #include #include @@ -34,9 +35,6 @@ /* Variables */ static char *progname; - -int opt_quiet; -int opt_verbose; static int opt_no_sessiond; static char *opt_sessiond_path; static pid_t sessiond_pid; @@ -76,6 +74,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 +107,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 +399,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")) == 0) { + strncmp(argv[i], "version", sizeof("version")) == 0 || + strncmp(argv[i], "view", sizeof("view")) == 0) { return 1; } } @@ -428,10 +429,10 @@ static int parse_args(int argc, char **argv) ret = 0; goto end; case 'v': - opt_verbose += 1; + lttng_opt_verbose += 1; break; case 'q': - opt_quiet = 1; + lttng_opt_quiet = 1; break; case 'g': lttng_set_tracing_group(optarg); @@ -458,8 +459,8 @@ static int parse_args(int argc, char **argv) } /* If both options are specified, quiet wins */ - if (opt_verbose && opt_quiet) { - opt_verbose = 0; + if (lttng_opt_verbose && lttng_opt_quiet) { + lttng_opt_verbose = 0; } /* Spawn session daemon if needed */