X-Git-Url: http://git.efficios.com/?p=lttng-tools.git;a=blobdiff_plain;f=src%2Fbin%2Flttng%2Flttng.c;h=7658afc164668cbb74c1782ff290b169817ffd46;hp=bad57fd9a8a41487e33482ba5ad5e49187c4abd3;hb=6c1c0768320135c6936c371b09731851b508c023;hpb=c7e35b037773dbbfe10178c946ba44feefb226e1 diff --git a/src/bin/lttng/lttng.c b/src/bin/lttng/lttng.c index bad57fd9a..7658afc16 100644 --- a/src/bin/lttng/lttng.c +++ b/src/bin/lttng/lttng.c @@ -16,6 +16,7 @@ */ #define _GNU_SOURCE +#define _LGPL_SOURCE #include #include #include @@ -83,14 +84,13 @@ static struct cmd_struct commands[] = { { "snapshot", cmd_snapshot}, { "save", cmd_save}, { "load", cmd_load}, - { "enable-consumer", cmd_enable_consumer}, /* OBSOLETE */ - { "disable-consumer", cmd_disable_consumer}, /* OBSOLETE */ { NULL, NULL} /* Array closure */ }; static void usage(FILE *ofp) { - fprintf(ofp, "LTTng Trace Control " FULL_VERSION" - " VERSION_NAME"\n\n"); + fprintf(ofp, "LTTng Trace Control " VERSION " - " VERSION_NAME "%s\n\n", + GIT_VERSION[0] == '\0' ? "" : " - " GIT_VERSION); fprintf(ofp, "usage: lttng [OPTIONS] []\n"); fprintf(ofp, "\n"); fprintf(ofp, "Options:\n"); @@ -134,8 +134,9 @@ static void usage(FILE *ofp) static void version(FILE *ofp) { - fprintf(ofp, "%s (LTTng Trace Control) " FULL_VERSION" - " VERSION_NAME"\n", - progname); + fprintf(ofp, "%s (LTTng Trace Control) " VERSION" - " VERSION_NAME "%s\n", + progname, + GIT_VERSION[0] == '\0' ? "" : " - " GIT_VERSION); } /* @@ -442,6 +443,7 @@ static int check_args_no_sessiond(int argc, char **argv) static int parse_args(int argc, char **argv) { int opt, ret; + char *user; if (argc < 2) { usage(stderr); @@ -520,6 +522,14 @@ static int parse_args(int argc, char **argv) goto error; } + /* For Mathieu Desnoyers a.k.a. Dr. Tracing */ + user = getenv("USER"); + if (user != NULL && ((strncmp(progname, "drtrace", 7) == 0 || + strncmp("compudj", user, 7) == 0))) { + MSG("%c[%d;%dmWelcome back Dr Tracing!%c[%dm\n", 27,1,33,27,0); + } + /* Thanks Mathieu */ + /* * Handle leftovers which is a first level command with the trailing * options. @@ -566,18 +576,9 @@ error: int main(int argc, char *argv[]) { int ret; - char *user; progname = argv[0] ? argv[0] : "lttng"; - /* For Mathieu Desnoyers a.k.a. Dr. Tracing */ - user = getenv("USER"); - if (user != NULL && ((strncmp(progname, "drtrace", 7) == 0 || - strncmp("compudj", user, 7) == 0))) { - MSG("%c[%d;%dmWelcome back Dr Tracing!%c[%dm\n", 27,1,33,27,0); - } - /* Thanks Mathieu */ - ret = set_signal_handler(); if (ret < 0) { clean_exit(ret);