From 38b4ef1b199ddb15db78774a39e9c524ca7e2d24 Mon Sep 17 00:00:00 2001 From: Philippe Proulx Date: Tue, 17 Nov 2015 01:30:17 -0500 Subject: [PATCH] lttng: remove usage strings from commands MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Signed-off-by: Philippe Proulx Signed-off-by: Jérémie Galarneau --- src/bin/lttng/commands/add_context.c | 45 ------- src/bin/lttng/commands/calibrate.c | 19 --- src/bin/lttng/commands/create.c | 74 ----------- src/bin/lttng/commands/destroy.c | 19 --- src/bin/lttng/commands/disable_channels.c | 18 --- src/bin/lttng/commands/disable_events.c | 31 ----- src/bin/lttng/commands/enable_channels.c | 64 ---------- src/bin/lttng/commands/enable_events.c | 143 ---------------------- src/bin/lttng/commands/list.c | 30 ----- src/bin/lttng/commands/load.c | 19 --- src/bin/lttng/commands/save.c | 15 --- src/bin/lttng/commands/set_session.c | 15 --- src/bin/lttng/commands/snapshot.c | 39 ------ src/bin/lttng/commands/start.c | 17 --- src/bin/lttng/commands/status.c | 11 -- src/bin/lttng/commands/stop.c | 17 --- src/bin/lttng/commands/track-untrack.c | 26 ---- src/bin/lttng/commands/version.c | 14 --- src/bin/lttng/commands/view.c | 25 ---- 19 files changed, 641 deletions(-) diff --git a/src/bin/lttng/commands/add_context.c b/src/bin/lttng/commands/add_context.c index 56ee2aca4..f19a54e67 100644 --- a/src/bin/lttng/commands/add_context.c +++ b/src/bin/lttng/commands/add_context.c @@ -490,48 +490,6 @@ static void print_ctx_type(FILE *ofp) } } -/* - * usage - */ -static void usage(FILE *ofp) -{ - fprintf(ofp, "usage: lttng add-context -t TYPE [-k|-u] [OPTIONS]\n"); - fprintf(ofp, "\n"); - fprintf(ofp, "If no channel is given (-c), the context is added to\n"); - fprintf(ofp, "all channels.\n"); - fprintf(ofp, "\n"); - fprintf(ofp, "Otherwise the context is added only to the channel (-c).\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"); - fprintf(ofp, " --list-options Simple listing of options\n"); - fprintf(ofp, " -s, --session NAME Apply to session name\n"); - fprintf(ofp, " -c, --channel NAME Apply to channel\n"); - fprintf(ofp, " -k, --kernel Apply to the kernel tracer\n"); - fprintf(ofp, " -u, --userspace Apply to the user-space tracer\n"); - fprintf(ofp, " -j, --jul Apply to Java application using JUL\n"); - fprintf(ofp, " -l, --log4j Apply for Java application using LOG4j\n"); - 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"); - fprintf(ofp, " TYPE can be one of the strings below:\n"); - print_ctx_type(ofp); - fprintf(ofp, "\n"); - fprintf(ofp, "Note that the vpid, vppid and vtid context types represent the virtual process id,\n" - "virtual parent process id and virtual thread id as seen from the current execution context\n" - "as opposed to the pid, ppid and tid which are kernel internal data structures.\n\n"); - fprintf(ofp, "Example:\n"); - fprintf(ofp, "This command will add the context information 'prio' and two per-cpu\n" - "perf counters (hardware branch misses and cache misses), to all channels\n" - "in the trace data output:\n"); - fprintf(ofp, "# lttng add-context -k -t prio -t perf:cpu:branch-misses -t perf:cpu:cache-misses\n"); - fprintf(ofp, "\n"); -} - /* * Find context numerical value from string. * @@ -830,7 +788,6 @@ int cmd_add_context(int argc, const char **argv) char *session_name = NULL; if (argc < 2) { - usage(stderr); ret = CMD_ERROR; goto end; } @@ -870,7 +827,6 @@ int cmd_add_context(int argc, const char **argv) list_cmd_options(stdout, long_options); goto end; default: - usage(stderr); ret = CMD_UNDEFINED; goto end; } @@ -885,7 +841,6 @@ int cmd_add_context(int argc, const char **argv) if (!opt_type) { ERR("Missing mandatory -t TYPE"); - usage(stderr); ret = CMD_ERROR; goto end; } diff --git a/src/bin/lttng/commands/calibrate.c b/src/bin/lttng/commands/calibrate.c index ba3350fb6..95a03d212 100644 --- a/src/bin/lttng/commands/calibrate.c +++ b/src/bin/lttng/commands/calibrate.c @@ -62,24 +62,6 @@ static struct poptOption long_options[] = { {0, 0, 0, 0, 0, 0, 0} }; -/* - * usage - */ -static void usage(FILE *ofp) -{ - 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"); - fprintf(ofp, " -u, --userspace Apply to the user-space tracer\n"); - fprintf(ofp, "\n"); - fprintf(ofp, "Calibrate options:\n"); - fprintf(ofp, " --function Dynamic function entry/return probe (default)\n"); - fprintf(ofp, "\n"); -} - /* * Calibrate LTTng. * @@ -202,7 +184,6 @@ int cmd_calibrate(int argc, const char **argv) list_cmd_options(stdout, long_options); goto end; default: - usage(stderr); ret = CMD_UNDEFINED; goto end; } diff --git a/src/bin/lttng/commands/create.c b/src/bin/lttng/commands/create.c index efc9e60c1..525464aa8 100644 --- a/src/bin/lttng/commands/create.c +++ b/src/bin/lttng/commands/create.c @@ -82,79 +82,6 @@ static struct poptOption long_options[] = { extern int _lttng_create_session_ext(const char *name, const char *url, const char *datetime); -/* - * usage - */ -static void usage(FILE *ofp) -{ - fprintf(ofp, "usage: lttng create [NAME] [OPTIONS] \n"); - fprintf(ofp, "\n"); - fprintf(ofp, "Without a given NAME, the default is 'auto--'\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, " -o, --output PATH Specify output path for traces\n"); - fprintf(ofp, " --no-output Traces will not be outputted\n"); - fprintf(ofp, " --snapshot Set the session in snapshot mode.\n"); - fprintf(ofp, " Created in no-output mode and uses the URL,\n"); - fprintf(ofp, " if one, as the default snapshot output.\n"); - fprintf(ofp, " Every channel will be set in overwrite mode\n"); - fprintf(ofp, " and with mmap output (splice not supported).\n"); - fprintf(ofp, " --live [USEC] Set the session in live-reading mode.\n"); - fprintf(ofp, " The delay parameter in micro-seconds is the\n"); - fprintf(ofp, " maximum time the user can wait for the data\n"); - fprintf(ofp, " to be flushed. Can be set with a network\n"); - fprintf(ofp, " URL (-U or -C/-D) and must have a relayd listening.\n"); - fprintf(ofp, " By default, %u is used for the timer and the\n", - DEFAULT_LTTNG_LIVE_TIMER); - fprintf(ofp, " network URL is set to net://127.0.0.1.\n"); - fprintf(ofp, " --shm-path PATH Path where shared memory holding buffers\n"); - fprintf(ofp, " should be created. Useful when used with pramfs\n"); - fprintf(ofp, " to extract trace data after crash.\n"); - fprintf(ofp, "\n"); - fprintf(ofp, "Extended Options:\n"); - fprintf(ofp, "\n"); - fprintf(ofp, "Using these options, each API call can be controlled individually.\n"); - fprintf(ofp, "\n"); - fprintf(ofp, " -U, --set-url=URL Set URL destination of the trace data.\n"); - fprintf(ofp, " It is persistent for the session lifetime.\n"); - fprintf(ofp, " This will set both data and control URL.\n"); - fprintf(ofp, " -C, --ctrl-url=URL Set control path URL. (Must use -D also)\n"); - fprintf(ofp, " -D, --data-url=URL Set data path URL. (Must use -C also)\n"); - fprintf(ofp, "\n"); - fprintf(ofp, "Please refer to the man page (lttng(1)) for more information on network\n"); - fprintf(ofp, "streaming mechanisms and explanation of the control and data port\n"); - fprintf(ofp, "You must have a running remote lttng-relayd for network streaming\n"); - fprintf(ofp, "\n"); - fprintf(ofp, "URL format is has followed:\n"); - fprintf(ofp, "\n"); - fprintf(ofp, " proto://[HOST|IP][:PORT1[:PORT2]][/TRACE_PATH]\n"); - fprintf(ofp, "\n"); - fprintf(ofp, " Supported protocols are (proto):\n"); - fprintf(ofp, " > file://...\n"); - fprintf(ofp, " Local filesystem full path.\n"); - fprintf(ofp, "\n"); - fprintf(ofp, " > net[6]://...\n"); - fprintf(ofp, " This will use the default network transport layer which is\n"); - fprintf(ofp, " TCP for both control (PORT1) and data port (PORT2).\n"); - fprintf(ofp, " The default ports are respectively 5342 and 5343.\n"); - fprintf(ofp, "\n"); - fprintf(ofp, " > tcp[6]://...\n"); - fprintf(ofp, " Can only be used with -C and -D together\n"); - fprintf(ofp, "\n"); - fprintf(ofp, "NOTE: IPv6 address MUST be enclosed in brackets '[]' (rfc2732)\n"); - fprintf(ofp, "\n"); - fprintf(ofp, "Examples:\n"); - fprintf(ofp, " # lttng create -U net://192.168.1.42\n"); - fprintf(ofp, " Uses TCP and default ports for the given destination.\n"); - fprintf(ofp, " # lttng create -U net6://[fe80::f66d:4ff:fe53:d220]\n"); - fprintf(ofp, " Uses TCP, default ports and IPv6.\n"); - fprintf(ofp, " # lttng create s1 -U net://myhost.com:3229\n"); - fprintf(ofp, " Set the consumer to the remote HOST on port 3229 for control.\n"); - fprintf(ofp, "\n"); -} - /* * Retrieve the created session and mi output it based on provided argument * This is currently a summary of what was pretty printed and is subject to @@ -739,7 +666,6 @@ int cmd_create(int argc, const char **argv) break; } default: - usage(stderr); ret = CMD_UNDEFINED; goto end; } diff --git a/src/bin/lttng/commands/destroy.c b/src/bin/lttng/commands/destroy.c index 661c0a235..aad4bdd23 100644 --- a/src/bin/lttng/commands/destroy.c +++ b/src/bin/lttng/commands/destroy.c @@ -52,24 +52,6 @@ static struct poptOption long_options[] = { {0, 0, 0, 0, 0, 0, 0} }; -/* - * usage - */ -static void usage(FILE *ofp) -{ - 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"); - fprintf(ofp, " -n, --no-wait Don't wait for data availability\n"); - fprintf(ofp, "\n"); -} - /* * destroy_session * @@ -195,7 +177,6 @@ int cmd_destroy(int argc, const char **argv) list_cmd_options(stdout, long_options); break; default: - usage(stderr); ret = CMD_UNDEFINED; break; } diff --git a/src/bin/lttng/commands/disable_channels.c b/src/bin/lttng/commands/disable_channels.c index a8bfa5dea..678af746d 100644 --- a/src/bin/lttng/commands/disable_channels.c +++ b/src/bin/lttng/commands/disable_channels.c @@ -53,22 +53,6 @@ static struct poptOption long_options[] = { {0, 0, 0, 0, 0, 0, 0} }; -/* - * usage - */ -static void usage(FILE *ofp) -{ - 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 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"); -} - static int mi_partial_channel_print(char *channel_name, unsigned int enabled, int success) { @@ -242,7 +226,6 @@ int cmd_disable_channels(int argc, const char **argv) list_cmd_options(stdout, long_options); goto end; default: - usage(stderr); ret = CMD_UNDEFINED; goto end; } @@ -257,7 +240,6 @@ int cmd_disable_channels(int argc, const char **argv) opt_channels = (char*) poptGetArg(pc); if (opt_channels == NULL) { ERR("Missing channel name(s).\n"); - usage(stderr); ret = CMD_ERROR; goto end; } diff --git a/src/bin/lttng/commands/disable_events.c b/src/bin/lttng/commands/disable_events.c index b853c57f7..e301b71b3 100644 --- a/src/bin/lttng/commands/disable_events.c +++ b/src/bin/lttng/commands/disable_events.c @@ -73,34 +73,6 @@ static struct poptOption long_options[] = { {0, 0, 0, 0, 0, 0, 0} }; -/* - * usage - */ -static void usage(FILE *ofp) -{ - fprintf(ofp, "usage: lttng disable-event NAME[,NAME2,...] (-k | -u | -j | -l | -p) [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 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 to the kernel tracer\n"); - fprintf(ofp, " -u, --userspace Apply to the user-space tracer\n"); - fprintf(ofp, " -j, --jul Apply to Java application using JUL\n"); - fprintf(ofp, " -l, --log4j Apply to Java application using LOG4j\n"); - fprintf(ofp, " -p, --python Apply to Python application using logging\n"); - fprintf(ofp, "\n"); - fprintf(ofp, "Event type options (Only supported with kernel domain):\n"); - fprintf(ofp, " --all All event types (default)\n"); - fprintf(ofp, " --tracepoint Tracepoint event\n"); - fprintf(ofp, " --syscall System call event\n"); - fprintf(ofp, " --probe Probe event\n"); - fprintf(ofp, " --function Function event\n"); - fprintf(ofp, "\n"); -} - static const char *print_channel_name(const char *name) { @@ -382,7 +354,6 @@ int cmd_disable_events(int argc, const char **argv) list_cmd_options(stdout, long_options); goto end; default: - usage(stderr); ret = CMD_UNDEFINED; goto end; } @@ -410,7 +381,6 @@ int cmd_disable_events(int argc, const char **argv) if ((opt_userspace || opt_jul || opt_log4j || opt_python) && opt_event_type != LTTNG_EVENT_ALL) { ERR("Disabling userspace and agent (-j | -l | -p) event(s) based on instrumentation type is not supported.\n"); - usage(stderr); ret = CMD_ERROR; goto end; } @@ -418,7 +388,6 @@ int cmd_disable_events(int argc, const char **argv) opt_event_list = (char*) poptGetArg(pc); if (opt_event_list == NULL && opt_disable_all == 0) { ERR("Missing event name(s).\n"); - usage(stderr); ret = CMD_ERROR; goto end; } diff --git a/src/bin/lttng/commands/enable_channels.c b/src/bin/lttng/commands/enable_channels.c index 93d81d735..9a990030d 100644 --- a/src/bin/lttng/commands/enable_channels.c +++ b/src/bin/lttng/commands/enable_channels.c @@ -88,67 +88,6 @@ static struct poptOption long_options[] = { {0, 0, 0, 0, 0, 0, 0} }; -/* - * usage - */ -static void usage(FILE *ofp) -{ - 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 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"); - fprintf(ofp, "Channel options:\n"); - fprintf(ofp, " --discard Discard event when buffers are full%s\n", - DEFAULT_CHANNEL_OVERWRITE ? "" : " (default)"); - fprintf(ofp, " --overwrite Flight recorder mode%s\n", - DEFAULT_CHANNEL_OVERWRITE ? " (default)" : ""); - fprintf(ofp, " --subbuf-size SIZE Subbuffer size in bytes {+k,+M,+G}\n"); - fprintf(ofp, " (default UST uid: %zu, UST pid: %zu, kernel: %zu, metadata: %zu)\n", - default_get_ust_uid_channel_subbuf_size(), - default_get_ust_pid_channel_subbuf_size(), - default_get_kernel_channel_subbuf_size(), - default_get_metadata_subbuf_size()); - fprintf(ofp, " Rounded up to the next power of 2.\n"); - fprintf(ofp, " --num-subbuf NUM Number of subbufers\n"); - fprintf(ofp, " (default UST uid: %u, UST pid: %u, kernel: %u, metadata: %u)\n", - DEFAULT_UST_UID_CHANNEL_SUBBUF_NUM, DEFAULT_UST_PID_CHANNEL_SUBBUF_NUM, - DEFAULT_KERNEL_CHANNEL_SUBBUF_NUM, DEFAULT_METADATA_SUBBUF_NUM); - fprintf(ofp, " Rounded up to the next power of 2.\n"); - fprintf(ofp, " --switch-timer USEC Switch timer interval in usec\n"); - fprintf(ofp, " (default UST uid: %u, UST pid: %u, kernel: %u, metadata: %u)\n", - DEFAULT_UST_UID_CHANNEL_SWITCH_TIMER, DEFAULT_UST_PID_CHANNEL_SWITCH_TIMER, - DEFAULT_KERNEL_CHANNEL_SWITCH_TIMER, DEFAULT_METADATA_SWITCH_TIMER); - fprintf(ofp, " --read-timer USEC Read timer interval in usec.\n"); - fprintf(ofp, " (default UST uid: %u, UST pid: %u, kernel: %u, metadata: %u)\n", - DEFAULT_UST_UID_CHANNEL_READ_TIMER, DEFAULT_UST_UID_CHANNEL_READ_TIMER, - DEFAULT_KERNEL_CHANNEL_READ_TIMER, DEFAULT_METADATA_READ_TIMER); - fprintf(ofp, " --output TYPE Channel output type (Values: %s, %s)\n", - output_mmap, output_splice); - fprintf(ofp, " (default UST uid: %s, UST pid: %s, kernel: %s, metadata: %s)\n", - DEFAULT_UST_UID_CHANNEL_OUTPUT == LTTNG_EVENT_MMAP ? output_mmap : output_splice, - DEFAULT_UST_PID_CHANNEL_OUTPUT == LTTNG_EVENT_MMAP ? output_mmap : output_splice, - DEFAULT_KERNEL_CHANNEL_OUTPUT == LTTNG_EVENT_MMAP ? output_mmap : output_splice, - DEFAULT_METADATA_OUTPUT == LTTNG_EVENT_MMAP ? output_mmap : output_splice); - fprintf(ofp, " --buffers-uid Use per UID buffer (-u only)\n"); - fprintf(ofp, " --buffers-pid Use per PID buffer (-u only)\n"); - fprintf(ofp, " --buffers-global Use shared buffer for the whole system (-k only)\n"); - fprintf(ofp, " -C, --tracefile-size SIZE\n"); - fprintf(ofp, " Maximum size of each tracefile within a stream (in bytes). 0 means unlimited.\n"); - fprintf(ofp, " (default: %u)\n", DEFAULT_CHANNEL_TRACEFILE_SIZE); - fprintf(ofp, " Note: traces generated with this option may inaccurately report\n"); - fprintf(ofp, " discarded events as per CTF 1.8.\n"); - fprintf(ofp, " -W, --tracefile-count COUNT\n"); - fprintf(ofp, " Used in conjunction with -C option, this will limit the number\n"); - fprintf(ofp, " of files created to the specified count. 0 means unlimited.\n"); - fprintf(ofp, " (default: %u)\n", DEFAULT_CHANNEL_TRACEFILE_COUNT); - fprintf(ofp, "\n"); -} - /* * Set default attributes depending on those already defined from the command * line. @@ -248,7 +187,6 @@ static int enable_channel(char *session_name) } else { ERR("Unknown output type %s. Possible values are: %s, %s\n", opt_output, output_mmap, output_splice); - usage(stderr); ret = CMD_ERROR; goto error; } @@ -563,7 +501,6 @@ int cmd_enable_channels(int argc, const char **argv) list_cmd_options(stdout, long_options); goto end; default: - usage(stderr); ret = CMD_UNDEFINED; goto end; } @@ -603,7 +540,6 @@ int cmd_enable_channels(int argc, const char **argv) opt_channels = (char*) poptGetArg(pc); if (opt_channels == NULL) { ERR("Missing channel name.\n"); - usage(stderr); ret = CMD_ERROR; success = 0; goto mi_closing; diff --git a/src/bin/lttng/commands/enable_events.c b/src/bin/lttng/commands/enable_events.c index 2c366c6d2..8a32837e6 100644 --- a/src/bin/lttng/commands/enable_events.c +++ b/src/bin/lttng/commands/enable_events.c @@ -95,147 +95,6 @@ static struct poptOption long_options[] = { {0, 0, 0, 0, 0, 0, 0} }; -/* - * usage - */ -static void usage(FILE *ofp) -{ - fprintf(ofp, "usage: lttng enable-event NAME[,NAME2,...] (-k | -u | -j | -l | -p) [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 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 to the kernel tracer\n"); - fprintf(ofp, " -u, --userspace Apply to the user-space tracer\n"); - fprintf(ofp, " -j, --jul Apply to Java application using JUL\n"); - fprintf(ofp, " -l, --log4j Apply for Java application using LOG4j\n"); - fprintf(ofp, " -p, --python Apply for Python application\n"); - fprintf(ofp, "\n"); - fprintf(ofp, "Event options:\n"); - fprintf(ofp, " --tracepoint Tracepoint event (default)\n"); - fprintf(ofp, " - userspace tracer supports wildcards at end of string.\n"); - fprintf(ofp, " Don't forget to quote to deal with bash expansion.\n"); - fprintf(ofp, " e.g.:\n"); - fprintf(ofp, " \"*\"\n"); - fprintf(ofp, " \"app_component:na*\"\n"); - fprintf(ofp, " --probe (addr | symbol | symbol+offset)\n"); - fprintf(ofp, " Dynamic probe.\n"); - fprintf(ofp, " Addr and offset can be octal (0NNN...),\n"); - fprintf(ofp, " decimal (NNN...) or hexadecimal (0xNNN...)\n"); - fprintf(ofp, " --function (addr | symbol | symbol+offset)\n"); - fprintf(ofp, " Dynamic function entry/return probe.\n"); - fprintf(ofp, " Addr and offset can be octal (0NNN...),\n"); - fprintf(ofp, " decimal (NNN...) or hexadecimal (0xNNN...)\n"); - fprintf(ofp, " --syscall System call event\n"); - fprintf(ofp, "\n"); - fprintf(ofp, " --loglevel name\n"); - fprintf(ofp, " Tracepoint loglevel range from 0 to loglevel.\n"); - fprintf(ofp, " For JUL/LOG4j/Python domains, see the table below for the range values.\n"); - fprintf(ofp, " --loglevel-only name\n"); - fprintf(ofp, " Tracepoint loglevel (only this loglevel)\n"); - fprintf(ofp, "\n"); - fprintf(ofp, " The loglevel or loglevel-only options should be\n"); - fprintf(ofp, " combined with a tracepoint name or tracepoint\n"); - fprintf(ofp, " wildcard.\n"); - fprintf(ofp, " Available loglevels:\n"); - fprintf(ofp, " (higher value is more verbose)\n"); - fprintf(ofp, " TRACE_EMERG = 0\n"); - fprintf(ofp, " TRACE_ALERT = 1\n"); - fprintf(ofp, " TRACE_CRIT = 2\n"); - fprintf(ofp, " TRACE_ERR = 3\n"); - fprintf(ofp, " TRACE_WARNING = 4\n"); - fprintf(ofp, " TRACE_NOTICE = 5\n"); - fprintf(ofp, " TRACE_INFO = 6\n"); - fprintf(ofp, " TRACE_DEBUG_SYSTEM = 7\n"); - fprintf(ofp, " TRACE_DEBUG_PROGRAM = 8\n"); - fprintf(ofp, " TRACE_DEBUG_PROCESS = 9\n"); - fprintf(ofp, " TRACE_DEBUG_MODULE = 10\n"); - fprintf(ofp, " TRACE_DEBUG_UNIT = 11\n"); - fprintf(ofp, " TRACE_DEBUG_FUNCTION = 12\n"); - fprintf(ofp, " TRACE_DEBUG_LINE = 13\n"); - fprintf(ofp, " TRACE_DEBUG = 14\n"); - fprintf(ofp, " (shortcuts such as \"system\" are allowed)\n"); - fprintf(ofp, "\n"); - fprintf(ofp, " Available JUL domain loglevels:\n"); - fprintf(ofp, " JUL_OFF = INT32_MAX\n"); - fprintf(ofp, " JUL_SEVERE = %d\n", LTTNG_LOGLEVEL_JUL_SEVERE); - fprintf(ofp, " JUL_WARNING = %d\n", LTTNG_LOGLEVEL_JUL_WARNING); - fprintf(ofp, " JUL_INFO = %d\n", LTTNG_LOGLEVEL_JUL_INFO); - fprintf(ofp, " JUL_CONFIG = %d\n", LTTNG_LOGLEVEL_JUL_CONFIG); - fprintf(ofp, " JUL_FINE = %d\n", LTTNG_LOGLEVEL_JUL_FINE); - fprintf(ofp, " JUL_FINER = %d\n", LTTNG_LOGLEVEL_JUL_FINER); - fprintf(ofp, " JUL_FINEST = %d\n", LTTNG_LOGLEVEL_JUL_FINEST); - fprintf(ofp, " JUL_ALL = INT32_MIN\n"); - fprintf(ofp, " (shortcuts such as \"severe\" are allowed)\n"); - fprintf(ofp, "\n"); - fprintf(ofp, " Available LOG4j domain loglevels:\n"); - fprintf(ofp, " LOG4J_OFF = INT32_MAX\n"); - fprintf(ofp, " LOG4J_FATAL = %d\n", LTTNG_LOGLEVEL_LOG4J_FATAL); - fprintf(ofp, " LOG4J_ERROR = %d\n", LTTNG_LOGLEVEL_LOG4J_ERROR); - fprintf(ofp, " LOG4J_WARN = %d\n", LTTNG_LOGLEVEL_LOG4J_WARN); - fprintf(ofp, " LOG4J_INFO = %d\n", LTTNG_LOGLEVEL_LOG4J_INFO); - fprintf(ofp, " LOG4J_DEBUG = %d\n", LTTNG_LOGLEVEL_LOG4J_DEBUG); - fprintf(ofp, " LOG4J_TRACE = %d\n", LTTNG_LOGLEVEL_LOG4J_TRACE); - fprintf(ofp, " LOG4J_ALL = INT32_MIN\n"); - fprintf(ofp, " (shortcuts such as \"severe\" are allowed)\n"); - fprintf(ofp, "\n"); - fprintf(ofp, " Available Python domain loglevels:\n"); - fprintf(ofp, " PYTHON_CRITICAL = %d\n", LTTNG_LOGLEVEL_PYTHON_CRITICAL); - fprintf(ofp, " PYTHON_ERROR = %d\n", LTTNG_LOGLEVEL_PYTHON_ERROR); - fprintf(ofp, " PYTHON_WARNING = %d\n", LTTNG_LOGLEVEL_PYTHON_WARNING); - fprintf(ofp, " PYTHON_INFO = %d\n", LTTNG_LOGLEVEL_PYTHON_INFO); - fprintf(ofp, " PYTHON_DEBUG = %d\n", LTTNG_LOGLEVEL_PYTHON_DEBUG); - fprintf(ofp, " PYTHON_NOTSET = %d\n", LTTNG_LOGLEVEL_PYTHON_NOTSET); - fprintf(ofp, " (shortcuts such as \"critical\" are allowed)\n"); - fprintf(ofp, "\n"); - fprintf(ofp, " -f, --filter \'expression\'\n"); - fprintf(ofp, " Filter expression on event fields and context.\n"); - fprintf(ofp, " Event recording depends on evaluation.\n"); - fprintf(ofp, " Only specify on first activation of\n"); - fprintf(ofp, " a given event within a session.\n"); - fprintf(ofp, " Filter only allowed when enabling\n"); - fprintf(ofp, " events within a session before tracing\n"); - fprintf(ofp, " is started. If the filter fails to link\n"); - fprintf(ofp, " with the event within the traced domain,\n"); - fprintf(ofp, " the event will be discarded. Currently,\n"); - fprintf(ofp, " filter is only implemented for the user-space\n"); - fprintf(ofp, " tracer.\n"); - fprintf(ofp, " Expression examples:.\n"); - fprintf(ofp, " \n"); - fprintf(ofp, " 'intfield > 500 && intfield < 503'\n"); - fprintf(ofp, " '(strfield == \"test\" || intfield != 10) && intfield > 33'\n"); - fprintf(ofp, " 'doublefield > 1.1 && intfield < 5.3'\n"); - fprintf(ofp, " \n"); - fprintf(ofp, " Wildcards are allowed at the end of strings:\n"); - fprintf(ofp, " 'seqfield1 == \"te*\"'\n"); - fprintf(ofp, " In string literals, the escape character is '\\'.\n"); - fprintf(ofp, " Use '\\*' for the '*' character, and '\\\\' for\n"); - fprintf(ofp, " the '\\' character. Wildcard match any sequence of,\n"); - fprintf(ofp, " characters including an empty sub-string (match 0 or\n"); - fprintf(ofp, " more characters).\n"); - fprintf(ofp, "\n"); - fprintf(ofp, " Context information can be used for filtering. The\n"); - fprintf(ofp, " examples below show usage of context filtering on\n"); - fprintf(ofp, " process name (with a wildcard), process ID range, and\n"); - fprintf(ofp, " unique thread ID for filtering. The process and\n"); - fprintf(ofp, " thread ID of running applications can be found under\n"); - fprintf(ofp, " columns \"PID\" and \"LWP\" of the \"ps -eLf\" command.\n"); - fprintf(ofp, "\n"); - fprintf(ofp, " '$ctx.procname == \"demo*\"'\n"); - fprintf(ofp, " '$ctx.vpid >= 4433 && $ctx.vpid < 4455'\n"); - fprintf(ofp, " '$ctx.vtid == 1234'\n"); - fprintf(ofp, " -x, --exclude LIST\n"); - fprintf(ofp, " Add exclusions to UST tracepoints:\n"); - fprintf(ofp, " Events that match any of the items\n"); - fprintf(ofp, " in the comma-separated LIST are not\n"); - fprintf(ofp, " enabled, even if they match a wildcard\n"); - fprintf(ofp, " definition of the event.\n"); - fprintf(ofp, "\n"); -} - /* * Parse probe options. */ @@ -1434,7 +1293,6 @@ int cmd_enable_events(int argc, const char **argv) case OPT_EXCLUDE: break; default: - usage(stderr); ret = CMD_UNDEFINED; goto end; } @@ -1486,7 +1344,6 @@ int cmd_enable_events(int argc, const char **argv) opt_event_list = (char*) poptGetArg(pc); if (opt_event_list == NULL && opt_enable_all == 0) { ERR("Missing event name(s).\n"); - usage(stderr); ret = CMD_ERROR; goto end; } diff --git a/src/bin/lttng/commands/list.c b/src/bin/lttng/commands/list.c index 7a35258b4..0dd74e595 100644 --- a/src/bin/lttng/commands/list.c +++ b/src/bin/lttng/commands/list.c @@ -67,34 +67,6 @@ static struct poptOption long_options[] = { {0, 0, 0, 0, 0, 0, 0} }; -/* - * usage - */ -static void usage(FILE *ofp) -{ - fprintf(ofp, "usage: lttng list [OPTIONS] [SESSION [SESSION OPTIONS]]\n"); - fprintf(ofp, "\n"); - fprintf(ofp, "With no arguments, list available tracing session(s)\n"); - fprintf(ofp, "\n"); - fprintf(ofp, "Without a session, -k lists available kernel events\n"); - fprintf(ofp, "Without a session, -u lists available userspace events\n"); - fprintf(ofp, "\n"); - fprintf(ofp, " -h, --help Show this help\n"); - fprintf(ofp, " --list-options Simple listing of options\n"); - fprintf(ofp, " -k, --kernel Select kernel domain\n"); - fprintf(ofp, " -u, --userspace Select user-space domain.\n"); - fprintf(ofp, " -j, --jul Apply for Java application using JUL\n"); - fprintf(ofp, " -l, --log4j Apply for Java application using LOG4J\n"); - fprintf(ofp, " -p, --python Apply for Python application using logging\n"); - fprintf(ofp, " -f, --fields List event fields.\n"); - fprintf(ofp, " --syscall List available system calls.\n"); - fprintf(ofp, "\n"); - fprintf(ofp, "Session Options:\n"); - fprintf(ofp, " -c, --channel NAME List details of a channel\n"); - fprintf(ofp, " -d, --domain List available domain(s)\n"); - fprintf(ofp, "\n"); -} - /* * Get command line from /proc for a specific pid. * @@ -1726,7 +1698,6 @@ int cmd_list(int argc, const char **argv) memset(&domain, 0, sizeof(domain)); if (argc < 1) { - usage(stderr); ret = CMD_ERROR; goto end; } @@ -1746,7 +1717,6 @@ int cmd_list(int argc, const char **argv) list_cmd_options(stdout, long_options); goto end; default: - usage(stderr); ret = CMD_UNDEFINED; goto end; } diff --git a/src/bin/lttng/commands/load.c b/src/bin/lttng/commands/load.c index 7a29da52d..d58cc07e0 100644 --- a/src/bin/lttng/commands/load.c +++ b/src/bin/lttng/commands/load.c @@ -53,24 +53,6 @@ static struct poptOption load_opts[] = { {0, 0, 0, 0, 0, 0, 0} }; -/* - * usage - */ -static void usage(FILE *ofp) -{ - fprintf(ofp, "usage: lttng load [OPTIONS] [SESSION]\n"); - fprintf(ofp, "\n"); - fprintf(ofp, "Options:\n"); - fprintf(ofp, " -h, --help Show this help\n"); - fprintf(ofp, " -a, --all Load all sessions (default)\n"); - fprintf(ofp, " -i, --input-path PATH Input path of the session file(s).\n"); - fprintf(ofp, " If a directory, load all files in it\n"); - fprintf(ofp, " else try to load the given file.\n"); - fprintf(ofp, " -f, --force Override existing session(s).\n"); - fprintf(ofp, " This will destroy existing session(s)\n"); - fprintf(ofp, " before creating new one(s).\n"); -} - static int mi_partial_session(const char *session_name) { int ret; @@ -163,7 +145,6 @@ int cmd_load(int argc, const char **argv) opt_force = 1; break; default: - usage(stderr); ret = CMD_UNDEFINED; goto end; } diff --git a/src/bin/lttng/commands/save.c b/src/bin/lttng/commands/save.c index 66ec5b6eb..fe051966c 100644 --- a/src/bin/lttng/commands/save.c +++ b/src/bin/lttng/commands/save.c @@ -51,20 +51,6 @@ static struct poptOption save_opts[] = { static struct mi_writer *writer; -/* - * usage - */ -static void usage(FILE *ofp) -{ - fprintf(ofp, "usage: lttng save [OPTIONS] [SESSION]\n"); - fprintf(ofp, "\n"); - fprintf(ofp, "Options:\n"); - fprintf(ofp, " -h, --help Show this help\n"); - fprintf(ofp, " -a, --all Save all sessions (default)\n"); - fprintf(ofp, " -o, --output-path Output path of the session configuration(s)\n"); - fprintf(ofp, " -f, --force Overwrite existing session configuration(s)\n"); -} - static int mi_partial_session(const char *session_name) { int ret; @@ -158,7 +144,6 @@ int cmd_save(int argc, const char **argv) list_cmd_options(stdout, save_opts); goto end; default: - usage(stderr); ret = CMD_UNDEFINED; goto end; } diff --git a/src/bin/lttng/commands/set_session.c b/src/bin/lttng/commands/set_session.c index d41dc1d19..4a41d9068 100644 --- a/src/bin/lttng/commands/set_session.c +++ b/src/bin/lttng/commands/set_session.c @@ -45,19 +45,6 @@ static struct poptOption long_options[] = { {0, 0, 0, 0, 0, 0, 0} }; -/* - * usage - */ -static void usage(FILE *ofp) -{ - fprintf(ofp, "usage: lttng set-session NAME [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"); -} - /* * Print the necessary mi for a session and name. */ @@ -180,7 +167,6 @@ int cmd_set_session(int argc, const char **argv) list_cmd_options(stdout, long_options); goto end; default: - usage(stderr); ret = CMD_UNDEFINED; goto end; } @@ -189,7 +175,6 @@ int cmd_set_session(int argc, const char **argv) opt_session_name = (char *) poptGetArg(pc); if (opt_session_name == NULL) { ERR("Missing session name"); - usage(stderr); ret = CMD_ERROR; goto end; } diff --git a/src/bin/lttng/commands/snapshot.c b/src/bin/lttng/commands/snapshot.c index 1d7843954..abdf18901 100644 --- a/src/bin/lttng/commands/snapshot.c +++ b/src/bin/lttng/commands/snapshot.c @@ -78,41 +78,6 @@ static struct cmd_struct actions[] = { { NULL, NULL } /* Array closure */ }; -/* - * usage - */ -static void usage(FILE *ofp) -{ - fprintf(ofp, "usage: lttng snapshot [OPTION] ACTION\n"); - fprintf(ofp, "\n"); - fprintf(ofp, "Actions:\n"); - fprintf(ofp, " add-output [-m ] [-s ] [-n ] | -C -D \n"); - fprintf(ofp, " Setup and add an snapshot output for a session.\n"); - fprintf(ofp, "\n"); - fprintf(ofp, " del-output ID | NAME [-s ]\n"); - fprintf(ofp, " Delete an output for a session using the ID.\n"); - fprintf(ofp, "\n"); - fprintf(ofp, " list-output [-s ]\n"); - fprintf(ofp, " List the output of a session.\n"); - fprintf(ofp, "\n"); - fprintf(ofp, " record [-m ] [-s ] [-n ] [ | -C -D ]\n"); - fprintf(ofp, " Snapshot a session's buffer(s) for all domains. If an URL is\n"); - fprintf(ofp, " specified, it is used instead of a previously added output.\n"); - fprintf(ofp, " Specifying only a name or/a size will override the current output value.\n"); - fprintf(ofp, " For instance, you can record a snapshot with a custom maximum size\n"); - fprintf(ofp, " or with a different name.\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 NAME Apply to session name\n"); - fprintf(ofp, " -n, --name NAME Name of the output or snapshot\n"); - fprintf(ofp, " -m, --max-size SIZE Maximum bytes size of the snapshot {+k,+M,+G}\n"); - fprintf(ofp, " -C, --ctrl-url URL Set control path URL. (Must use -D also)\n"); - fprintf(ofp, " -D, --data-url URL Set data path URL. (Must use -C also)\n"); - fprintf(ofp, "\n"); -} - /* * Count and return the number of arguments in argv. */ @@ -455,7 +420,6 @@ static int cmd_add_output(int argc, const char **argv) int ret; if (argc < 2 && (!opt_data_url || !opt_ctrl_url)) { - usage(stderr); ret = CMD_ERROR; goto end; } @@ -477,7 +441,6 @@ static int cmd_del_output(int argc, const char **argv) long id; if (argc < 2) { - usage(stderr); ret = CMD_ERROR; goto end; } @@ -615,7 +578,6 @@ static int handle_command(const char **argv) if (argv == NULL || (!opt_ctrl_url && opt_data_url) || (opt_ctrl_url && !opt_data_url)) { - usage(stderr); command_ret = CMD_ERROR; goto end; } @@ -739,7 +701,6 @@ int cmd_snapshot(int argc, const char **argv) break; } default: - usage(stderr); ret = CMD_UNDEFINED; goto end; } diff --git a/src/bin/lttng/commands/start.c b/src/bin/lttng/commands/start.c index 90794c669..03d99cf41 100644 --- a/src/bin/lttng/commands/start.c +++ b/src/bin/lttng/commands/start.c @@ -45,22 +45,6 @@ static struct poptOption long_options[] = { {0, 0, 0, 0, 0, 0, 0} }; -/* - * usage - */ -static void usage(FILE *ofp) -{ - 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"); -} - static int mi_print_session(char *session_name, int enabled) { int ret; @@ -167,7 +151,6 @@ int cmd_start(int argc, const char **argv) list_cmd_options(stdout, long_options); goto end; default: - usage(stderr); ret = CMD_UNDEFINED; goto end; } diff --git a/src/bin/lttng/commands/status.c b/src/bin/lttng/commands/status.c index 693527535..5daabdac2 100644 --- a/src/bin/lttng/commands/status.c +++ b/src/bin/lttng/commands/status.c @@ -40,15 +40,6 @@ static struct poptOption long_options[] = { {0, 0, 0, 0, 0, 0, 0} }; -static void usage(FILE *ofp) -{ - fprintf(ofp, "Usage: lttng status [options]\n"); - fprintf(ofp, "\n"); - fprintf(ofp, "Options:\n"); - fprintf(ofp, " -h, --help Show this help\n"); - fprintf(ofp, " --list-options List options\n"); -} - static int status(void) { const char *argv[2]; @@ -89,7 +80,6 @@ int cmd_status(int argc, const char **argv) list_cmd_options(stdout, long_options); goto end; default: - usage(stderr); ret = CMD_UNDEFINED; goto end; } @@ -97,7 +87,6 @@ int cmd_status(int argc, const char **argv) if (poptPeekArg(pc) != NULL) { ERR("This command does not accept positional arguments.\n"); - usage(stderr); ret = CMD_UNDEFINED; goto end; } diff --git a/src/bin/lttng/commands/stop.c b/src/bin/lttng/commands/stop.c index e946d4fdb..c38fc894a 100644 --- a/src/bin/lttng/commands/stop.c +++ b/src/bin/lttng/commands/stop.c @@ -47,22 +47,6 @@ static struct poptOption long_options[] = { {0, 0, 0, 0, 0, 0, 0} }; -/* - * usage - */ -static void usage(FILE *ofp) -{ - 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, --no-wait Don't wait for data availability\n"); - fprintf(ofp, "\n"); -} /* * Mi print of partial session */ @@ -195,7 +179,6 @@ int cmd_stop(int argc, const char **argv) list_cmd_options(stdout, long_options); goto end; default: - usage(stderr); ret = CMD_UNDEFINED; goto end; } diff --git a/src/bin/lttng/commands/track-untrack.c b/src/bin/lttng/commands/track-untrack.c index 6d8d91ffd..3771de5d9 100644 --- a/src/bin/lttng/commands/track-untrack.c +++ b/src/bin/lttng/commands/track-untrack.c @@ -64,28 +64,6 @@ static struct poptOption long_options[] = { { 0, 0, 0, 0, 0, 0, 0, }, }; -/* - * usage - */ -static void usage(FILE *ofp, const char *cmd_str) -{ - fprintf(ofp, "usage: lttng %s [-k|-u] [OPTIONS]\n", cmd_str); - fprintf(ofp, "\n"); - fprintf(ofp, "If no session is given (-s), the context is added to\n"); - fprintf(ofp, "the current sesssion. Exactly one domain (-k or -u)\n"); - fprintf(ofp, "must be specified.\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 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, " -p, --pid [PID] Process ID tracker. Leave PID empty when used with --all.\n"); - fprintf(ofp, " -a, --all All PIDs (use with --pid).\n"); - fprintf(ofp, "\n"); -} - static int parse_pid_string(const char *_pid_string, int all, int **_pid_list, int *nr_pids) @@ -236,7 +214,6 @@ enum cmd_error_code track_untrack_pid(enum cmd_type cmd_type, const char *cmd_st ret = parse_pid_string(pid_string, all, &pid_list, &nr_pids); if (ret != CMD_SUCCESS) { ERR("Error parsing PID string"); - usage(stderr, cmd_str); retval = CMD_ERROR; goto end; } @@ -353,7 +330,6 @@ int cmd_track_untrack(enum cmd_type cmd_type, const char *cmd_str, struct mi_writer *writer = NULL; if (argc < 1) { - usage(stderr, cmd_str); command_ret = CMD_ERROR; goto end; } @@ -374,7 +350,6 @@ int cmd_track_untrack(enum cmd_type cmd_type, const char *cmd_str, opt_pid = 1; break; default: - usage(stderr, cmd_str); command_ret = CMD_UNDEFINED; goto end; } @@ -399,7 +374,6 @@ int cmd_track_untrack(enum cmd_type cmd_type, const char *cmd_str, /* Currently only PID tracker is supported */ if (!opt_pid) { ERR("Please specify at least one tracker with its expected arguments"); - usage(stderr, cmd_str); command_ret = CMD_ERROR; goto end; } diff --git a/src/bin/lttng/commands/version.c b/src/bin/lttng/commands/version.c index 3630950bb..cf46a8cb0 100644 --- a/src/bin/lttng/commands/version.c +++ b/src/bin/lttng/commands/version.c @@ -42,19 +42,6 @@ static struct poptOption long_options[] = { {0, 0, 0, 0, 0, 0, 0} }; -/* - * usage - */ -static void usage(FILE *ofp) -{ - 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"); -} - /* * create_version */ @@ -154,7 +141,6 @@ int cmd_version(int argc, const char **argv) list_cmd_options(stdout, long_options); goto end; default: - usage(stderr); ret = CMD_UNDEFINED; goto end; } diff --git a/src/bin/lttng/commands/view.c b/src/bin/lttng/commands/view.c index dac2c3e24..09acc30f4 100644 --- a/src/bin/lttng/commands/view.c +++ b/src/bin/lttng/commands/view.c @@ -78,30 +78,6 @@ static struct viewers { /* Is the session we are trying to view is in live mode. */ static int session_live_mode; -/* - * usage - */ -static void usage(FILE *ofp) -{ - fprintf(ofp, "usage: lttng view [SESSION_NAME] [OPTIONS]\n"); - fprintf(ofp, "\n"); - fprintf(ofp, "By default, the babeltrace viewer will be used for text viewing\n"); - fprintf(ofp, "\n"); - 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"); - fprintf(ofp, " -e, --viewer CMD Specify viewer and/or options to use\n"); - fprintf(ofp, " This will completely override the default viewers so\n"); - fprintf(ofp, " please make sure to specify the full command. The trace\n"); - fprintf(ofp, " directory path of the session will be appended at the end\n"); - fprintf(ofp, " to the arguments\n"); - fprintf(ofp, "\n"); -} - static struct viewers *parse_options(void) { if (opt_viewer == NULL) { @@ -450,7 +426,6 @@ int cmd_view(int argc, const char **argv) list_cmd_options(stdout, long_options); goto end; default: - usage(stderr); ret = CMD_UNDEFINED; goto end; } -- 2.34.1