X-Git-Url: https://git.lttng.org/?a=blobdiff_plain;f=src%2Fbin%2Flttng%2Fcommands%2Fenable_channels.c;h=03de5241d59c6536578c328113704c40867262c5;hb=dad47fc4c65ec0acbfedc676895833b465d25cd6;hp=5443d78a3c8826138cf9e3813de8ea88936befa8;hpb=1ab1ea0b77d5fc71765e06b5c84431e403e8bd2e;p=lttng-tools.git diff --git a/src/bin/lttng/commands/enable_channels.c b/src/bin/lttng/commands/enable_channels.c index 5443d78a3..03de5241d 100644 --- a/src/bin/lttng/commands/enable_channels.c +++ b/src/bin/lttng/commands/enable_channels.c @@ -48,6 +48,7 @@ enum { OPT_SWITCH_TIMER, OPT_READ_TIMER, OPT_USERSPACE, + OPT_LIST_OPTIONS, }; static struct lttng_handle *handle; @@ -70,6 +71,7 @@ static struct poptOption long_options[] = { {"num-subbuf", 0, POPT_ARG_INT, 0, OPT_NUM_SUBBUF, 0, 0}, {"switch-timer", 0, POPT_ARG_INT, 0, OPT_SWITCH_TIMER, 0, 0}, {"read-timer", 0, POPT_ARG_INT, 0, OPT_READ_TIMER, 0, 0}, + {"list-options", 0, POPT_ARG_NONE, NULL, OPT_LIST_OPTIONS, NULL, NULL}, {0, 0, 0, 0, 0, 0, 0} }; @@ -81,6 +83,7 @@ static void usage(FILE *ofp) fprintf(ofp, "usage: lttng enable-channel NAME[,NAME2,...] [options] [channel_options]\n"); fprintf(ofp, "\n"); fprintf(ofp, " -h, --help Show this help\n"); + fprintf(ofp, " --list-options Simple listing of options\n"); fprintf(ofp, " -s, --session Apply on session name\n"); fprintf(ofp, " -k, --kernel Apply on the kernel tracer\n"); #if 0 @@ -159,7 +162,7 @@ static int enable_channel(char *session_name) dom.type = LTTNG_DOMAIN_UST; } else { ERR("Please specify a tracer (-k/--kernel or -u/--userspace)"); - ret = CMD_UNDEFINED; + ret = CMD_ERROR; goto error; } @@ -258,6 +261,10 @@ int cmd_enable_channels(int argc, const char **argv) case OPT_USERSPACE: opt_userspace = 1; break; + case OPT_LIST_OPTIONS: + list_cmd_options(stdout, long_options); + ret = CMD_SUCCESS; + goto end; default: usage(stderr); ret = CMD_UNDEFINED;