Standardize lttng command line usage text
authorDavid Goulet <dgoulet@efficios.com>
Tue, 21 Aug 2012 15:38:27 +0000 (11:38 -0400)
committerDavid Goulet <dgoulet@efficios.com>
Tue, 21 Aug 2012 15:38:27 +0000 (11:38 -0400)
Signed-off-by: David Goulet <dgoulet@efficios.com>
14 files changed:
src/bin/lttng/commands/add_context.c
src/bin/lttng/commands/calibrate.c
src/bin/lttng/commands/destroy.c
src/bin/lttng/commands/disable_channels.c
src/bin/lttng/commands/disable_consumer.c
src/bin/lttng/commands/disable_events.c
src/bin/lttng/commands/enable_channels.c
src/bin/lttng/commands/enable_consumer.c
src/bin/lttng/commands/enable_events.c
src/bin/lttng/commands/start.c
src/bin/lttng/commands/stop.c
src/bin/lttng/commands/version.c
src/bin/lttng/commands/view.c
src/bin/lttng/lttng.c

index 38708fce15dd784a2e0ae97700d7041793fd885d..b580d037b9924dfbbea909c9561ab7587ed4b3f1 100644 (file)
@@ -142,13 +142,7 @@ static struct poptOption long_options[] = {
        {"channel",        'c', POPT_ARG_STRING, &opt_channel_name, 0, 0, 0},
        {"event",          'e', POPT_ARG_STRING, &opt_event_name, 0, 0, 0},
        {"kernel",         'k', POPT_ARG_VAL, &opt_kernel, 1, 0, 0},
-#if 0
-       /* Not implemented yet */
-       {"pid",            'p', POPT_ARG_INT, &opt_pid, 0, 0, 0},
-       {"userspace",      'u', POPT_ARG_STRING | POPT_ARGFLAG_OPTIONAL, &opt_cmd_name, OPT_USERSPACE, 0, 0},
-#else
        {"userspace",      'u', POPT_ARG_NONE, 0, OPT_USERSPACE, 0, 0},
-#endif
        {"type",           't', POPT_ARG_STRING, &opt_type, OPT_TYPE, 0, 0},
        {"list-options",   0, POPT_ARG_NONE, NULL, OPT_LIST_OPTIONS, NULL, NULL},
        {0, 0, 0, 0, 0, 0, 0}
@@ -302,13 +296,15 @@ static void print_ctx_type(FILE *ofp)
  */
 static void usage(FILE *ofp)
 {
-       fprintf(ofp, "usage: lttng add-context -t TYPE\n");
+       fprintf(ofp, "usage: lttng add-context -t TYPE [-k|-u] [OPTIONS]\n");
        fprintf(ofp, "\n");
        fprintf(ofp, "If no channel and no event is given (-c/-e), the context\n");
-       fprintf(ofp, "will be added to all events and all channels.\n");
-       fprintf(ofp, "Otherwise the context will be added only to the channel (-c)\n");
+       fprintf(ofp, "is added to all events and all channels.\n");
+       fprintf(ofp, "\n");
+       fprintf(ofp, "Otherwise the context is added only to the channel (-c)\n");
        fprintf(ofp, "and/or event (-e) indicated.\n");
-       fprintf(ofp, "Exactly one domain (-k/--kernel or -u/--userspace) must be specified.\n");
+       fprintf(ofp, "\n");
+       fprintf(ofp, "Exactly one domain (-k or -u) must be specified.\n");
        fprintf(ofp, "\n");
        fprintf(ofp, "Options:\n");
        fprintf(ofp, "  -h, --help               Show this help\n");
@@ -317,14 +313,9 @@ static void usage(FILE *ofp)
        fprintf(ofp, "  -c, --channel NAME       Apply to channel\n");
        fprintf(ofp, "  -e, --event NAME         Apply to event\n");
        fprintf(ofp, "  -k, --kernel             Apply to the kernel tracer\n");
-#if 0
-       fprintf(ofp, "  -u, --userspace [CMD]    Apply to the user-space tracer\n");
-       fprintf(ofp, "                           If no CMD, the domain used is UST global\n");
-       fprintf(ofp, "                           otherwise the domain is UST EXEC_NAME\n");
-       fprintf(ofp, "  -p, --pid PID            If -u, apply to specific PID (domain: UST PID)\n");
-#else
        fprintf(ofp, "  -u, --userspace          Apply to the user-space tracer\n");
-#endif
+       fprintf(ofp, "\n");
+       fprintf(ofp, "Context:\n");
        fprintf(ofp, "  -t, --type TYPE          Context type. You can repeat that option on\n");
        fprintf(ofp, "                           the command line to specify multiple contexts at once.\n");
        fprintf(ofp, "                           (--kernel preempts --userspace)\n");
index a14570eea5e3341b173595ff91c07323e66d2cbb..600765fcc2d79c312adeee2e2e9e08af57bda8dc 100644 (file)
@@ -84,21 +84,16 @@ static struct poptOption long_options[] = {
  */
 static void usage(FILE *ofp)
 {
-       fprintf(ofp, "usage: lttng calibrate [options] [calibrate_options]\n");
+       fprintf(ofp, "usage: lttng calibrate [-k|-u] [OPTIONS]\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, "  -k, --kernel             Apply to the kernel tracer\n");
-#if 0
-       fprintf(ofp, "  -u, --userspace [CMD]    Apply to the user-space tracer (domain: UST\n");
-       fprintf(ofp, "                           EXEC_NAME). If no CMD, the domain is UST global.\n";
-       fprintf(ofp, "                           (-k preempts -u)\n");
-       fprintf(ofp, "  -p, --pid PID            If -u, apply to specific PID (domain: UST PID)\n");
-#else
        fprintf(ofp, "  -u, --userspace          Apply to the user-space tracer\n");
-#endif
        fprintf(ofp, "\n");
        fprintf(ofp, "Calibrate options:\n");
+       fprintf(ofp, "    --function             Dynamic function entry/return probe (default)\n");
 #if 0
        fprintf(ofp, "    --tracepoint           Tracepoint event (default)\n");
        fprintf(ofp, "    --probe\n");
@@ -109,8 +104,6 @@ static void usage(FILE *ofp)
 #endif
        fprintf(ofp, "    --syscall              System call eventl\n");
        fprintf(ofp, "    --marker               User-space marker (deprecated)\n");
-#else
-       fprintf(ofp, "    --function             Dynamic function entry/return probe (default)\n");
 #endif
        fprintf(ofp, "\n");
 }
index cdc2c538c597eb4a33b82fde72bd2af0597e4ff5..fea96f1757907178ea8e89b7ee6a21bdd18c27be 100644 (file)
@@ -49,11 +49,12 @@ static struct poptOption long_options[] = {
  */
 static void usage(FILE *ofp)
 {
-       fprintf(ofp, "usage: lttng destroy [options] [NAME]\n");
+       fprintf(ofp, "usage: lttng destroy [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, "  -a, --all            Destroy all sessions\n");
        fprintf(ofp, "      --list-options   Simple listing of options\n");
index 7378ee7a0fd59309bb9ba0b382ec527e63321df9..d861b37704a67aa52d01473cc04032eb2b67e96e 100644 (file)
@@ -65,20 +65,14 @@ static struct poptOption long_options[] = {
  */
 static void usage(FILE *ofp)
 {
-       fprintf(ofp, "usage: lttng disable-channel NAME[,NAME2,...] [options]\n");
+       fprintf(ofp, "usage: lttng disable-channel NAME[,NAME2,...] [-k|-u] [OPTIONS]\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, "  -s, --session            Apply to session name\n");
+       fprintf(ofp, "  -s, --session NAME       Apply to session name\n");
        fprintf(ofp, "  -k, --kernel             Apply to the kernel tracer\n");
-#if 0
-       fprintf(ofp, "  -u, --userspace [CMD]    Apply to the user-space tracer\n");
-       fprintf(ofp, "                           If no CMD, the domain used is UST global\n");
-       fprintf(ofp, "                           or else the domain is UST EXEC_NAME\n");
-       fprintf(ofp, "  -p, --pid PID            If -u, apply to specific PID (domain: UST PID)\n");
-#else
        fprintf(ofp, "  -u, --userspace          Apply to the user-space tracer\n");
-#endif
        fprintf(ofp, "\n");
 }
 
index 58361db1e7b3a711bed1a4c33f791d2b6c989231..ead58b89051353f7c3d91352c6d522525adb23bf 100644 (file)
@@ -66,7 +66,7 @@ static void usage(FILE *ofp)
        fprintf(ofp, "Options:\n");
        fprintf(ofp, "  -h, --help           Show this help\n");
        fprintf(ofp, "      --list-options   Simple listing of options\n");
-       fprintf(ofp, "  -s, --session=NAME   Apply to session name\n");
+       fprintf(ofp, "  -s, --session NAME   Apply to session name\n");
        fprintf(ofp, "  -k, --kernel         Apply to the kernel tracer\n");
        fprintf(ofp, "  -u, --userspace      Apply to the user-space tracer\n");
        fprintf(ofp, "\n");
index c0b8bf9d012d53ed908a8bea019d7ba64955a851..b238b9d60ed42c38c447be06d823a2278db32678 100644 (file)
@@ -69,22 +69,16 @@ static struct poptOption long_options[] = {
  */
 static void usage(FILE *ofp)
 {
-       fprintf(ofp, "usage: lttng disable-event NAME[,NAME2,...] [options]\n");
+       fprintf(ofp, "usage: lttng disable-event NAME[,NAME2,...] [-k|-u] [OPTIONS]\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, "  -s, --session            Apply to session name\n");
-       fprintf(ofp, "  -c, --channel            Apply to this channel\n");
+       fprintf(ofp, "  -s, --session NAME       Apply to session name\n");
+       fprintf(ofp, "  -c, --channel NAME       Apply to this channel\n");
        fprintf(ofp, "  -a, --all-events         Disable all tracepoints\n");
        fprintf(ofp, "  -k, --kernel             Apply for the kernel tracer\n");
-#if 0
-       fprintf(ofp, "  -u, --userspace [CMD]    Apply to the user-space tracer\n");
-       fprintf(ofp, "                           If no CMD, the domain used is UST global\n");
-       fprintf(ofp, "                           or else the domain is UST EXEC_NAME\n");
-       fprintf(ofp, "  -p, --pid PID            If -u, apply to specific PID (domain: UST PID)\n");
-#else
        fprintf(ofp, "  -u, --userspace          Apply to the user-space tracer\n");
-#endif
        fprintf(ofp, "\n");
 }
 
index 9b5f8d64d302b276f3faee598c30e43dfcde28a2..57c8a1eb8eb54e747b1a76757a850ab65186c7ab 100644 (file)
@@ -81,20 +81,14 @@ static struct poptOption long_options[] = {
  */
 static void usage(FILE *ofp)
 {
-       fprintf(ofp, "usage: lttng enable-channel NAME[,NAME2,...] [options] [channel_options]\n");
+       fprintf(ofp, "usage: lttng enable-channel NAME[,NAME2,...] [-u|-k] [OPTIONS]\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, "  -s, --session            Apply to session name\n");
+       fprintf(ofp, "  -s, --session NAME       Apply to session name\n");
        fprintf(ofp, "  -k, --kernel             Apply to the kernel tracer\n");
-#if 0
-       fprintf(ofp, "  -u, --userspace [CMD]    Apply to the user-space tracer\n");
-       fprintf(ofp, "                           If no CMD, the domain used is UST global\n");
-       fprintf(ofp, "                           or else the domain is UST EXEC_NAME\n");
-       fprintf(ofp, "  -p, --pid PID            If -u, apply to specific PID (domain: UST PID)\n");
-#else
        fprintf(ofp, "  -u, --userspace          Apply to the user-space tracer\n");
-#endif
        fprintf(ofp, "\n");
        fprintf(ofp, "Channel options:\n");
        fprintf(ofp, "      --discard            Discard event when buffers are full%s\n",
index 77e3ad9112ff2d3504df7b8f2ed078e7f56f2a2e..692cdda02d63c4455b9b205523ad772123be4856 100644 (file)
@@ -78,7 +78,7 @@ static void usage(FILE *ofp)
        fprintf(ofp, "Options:\n");
        fprintf(ofp, "  -h, --help           Show this help\n");
        fprintf(ofp, "      --list-options   Simple listing of options\n");
-       fprintf(ofp, "  -s, --session=NAME   Apply to session name\n");
+       fprintf(ofp, "  -s, --session NAME   Apply to session name\n");
        fprintf(ofp, "  -k, --kernel         Apply to the kernel tracer\n");
        fprintf(ofp, "  -u, --userspace      Apply to the user-space tracer\n");
        fprintf(ofp, "\n");
index 45354573207cc9995106d5862e01e106526eccd1..a2c8a68b233e0ed7beeef1b893c7f453b874e08d 100644 (file)
@@ -71,13 +71,7 @@ static struct poptOption long_options[] = {
        {"all",            'a', POPT_ARG_VAL, &opt_enable_all, 1, 0, 0},
        {"channel",        'c', POPT_ARG_STRING, &opt_channel_name, 0, 0, 0},
        {"kernel",         'k', POPT_ARG_VAL, &opt_kernel, 1, 0, 0},
-#if 0
-       /* Not implemented yet */
-       {"userspace",      'u', POPT_ARG_STRING | POPT_ARGFLAG_OPTIONAL, &opt_cmd_name, OPT_USERSPACE, 0, 0},
-       {"pid",            'p', POPT_ARG_INT, &opt_pid, 0, 0, 0},
-#else
        {"userspace",      'u', POPT_ARG_NONE, 0, OPT_USERSPACE, 0, 0},
-#endif
        {"tracepoint",     0,   POPT_ARG_NONE, 0, OPT_TRACEPOINT, 0, 0},
        {"probe",          0,   POPT_ARG_STRING, &opt_probe, OPT_PROBE, 0, 0},
        {"function",       0,   POPT_ARG_STRING, &opt_function, OPT_FUNCTION, 0, 0},
@@ -101,22 +95,16 @@ static struct poptOption long_options[] = {
  */
 static void usage(FILE *ofp)
 {
-       fprintf(ofp, "usage: lttng enable-event NAME[,NAME2,...] [options] [event_options]\n");
+       fprintf(ofp, "usage: lttng enable-event NAME[,NAME2,...] [-k|-u] [OPTIONS] \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, "  -s, --session            Apply to session name\n");
-       fprintf(ofp, "  -c, --channel            Apply to this channel\n");
+       fprintf(ofp, "  -s, --session NAME       Apply to session name\n");
+       fprintf(ofp, "  -c, --channel NAME       Apply to this channel\n");
        fprintf(ofp, "  -a, --all                Enable all tracepoints and syscalls\n");
        fprintf(ofp, "  -k, --kernel             Apply for the kernel tracer\n");
-#if 0
-       fprintf(ofp, "  -u, --userspace [CMD]    Apply to the user-space tracer\n");
-       fprintf(ofp, "                           If no CMD, the domain used is UST global\n");
-       fprintf(ofp, "                           or else the domain is UST EXEC_NAME\n");
-       fprintf(ofp, "  -p, --pid PID            If -u, apply to specific PID (domain: UST PID)\n");
-#else
        fprintf(ofp, "  -u, --userspace          Apply to the user-space tracer\n");
-#endif
        fprintf(ofp, "\n");
        fprintf(ofp, "Event options:\n");
        fprintf(ofp, "    --tracepoint           Tracepoint event (default)\n");
index 44554fb37e223d11f62cb0d0f7bce33e096f79f2..b1840c3e85f2cfd1ce4e82debb035663894a0908 100644 (file)
@@ -47,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");
index 6ed67fdabcaaf0194cbbe911c3853609aa3720de..998a2a42a425c1472c6b704fdf993a39e8772dc9 100644 (file)
@@ -47,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");
index a6bbd6aece3c7a9e674705ddda560dd4bcd0e39b..7f69de3dd19a9a1ac438c455ee2231c628c5a93d 100644 (file)
@@ -44,8 +44,9 @@ static struct poptOption long_options[] = {
  */
 static void usage(FILE *ofp)
 {
-       fprintf(ofp, "usage: lttng version\n");
+       fprintf(ofp, "usage: lttng version [OPTIONS]\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");
@@ -78,7 +79,8 @@ int cmd_version(int argc, const char **argv)
        }
 
        MSG("lttng version " VERSION " - " VERSION_NAME);
-       MSG("Web site: http://lttng.org/");
+       MSG("\n" VERSION_DESCRIPTION "\n");
+       MSG("Web site: http://lttng.org");
        MSG("\nlttng is free software and under the GPL license and part LGPL");
 
 end:
index 9508743e62878ade2428905ba0bfdc9e831537f5..430f8b62cfd208375691f3dda72ceb64f9ee881a 100644 (file)
@@ -88,6 +88,7 @@ static void usage(FILE *ofp)
        fprintf(ofp, "Where SESSION_NAME is an optional session name. If not specified, lttng will\n");
        fprintf(ofp, "get it from the configuration file (.lttngrc).\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, "  -t, --trace-path PATH    Trace directory path for the viewer\n");
index f41e9767dcf20240e5809d4f179c71e042412a87..e6ca9cfd9877485339188fbbbf1626f0a8d21ae7 100644 (file)
@@ -82,7 +82,7 @@ static struct cmd_struct commands[] =  {
 static void usage(FILE *ofp)
 {
        fprintf(ofp, "LTTng Trace Control " VERSION" - " VERSION_NAME"\n\n");
-       fprintf(ofp, "usage: lttng [OPTIONS] <COMMAND>\n");
+       fprintf(ofp, "usage: lttng [OPTIONS] <COMMAND> [<ARGS>]\n");
        fprintf(ofp, "\n");
        fprintf(ofp, "Options:\n");
        fprintf(ofp, "  -h, --help                 Show this help\n");
This page took 0.032545 seconds and 4 git commands to generate.