X-Git-Url: https://git.lttng.org/?p=lttng-tools.git;a=blobdiff_plain;f=src%2Fbin%2Flttng%2Fcommands%2Fenable_events.c;h=3f30ab8ba5156449ee3dba7084f957bbf7027664;hp=8360821fb09221304b386f3dc45fac19a7107c59;hb=69892bbba677a6695b216046d586e58bfa0f82c9;hpb=d78d661021eb1c5761c631dbd525697769fe638b diff --git a/src/bin/lttng/commands/enable_events.c b/src/bin/lttng/commands/enable_events.c index 8360821fb..3f30ab8ba 100644 --- a/src/bin/lttng/commands/enable_events.c +++ b/src/bin/lttng/commands/enable_events.c @@ -54,6 +54,7 @@ enum { OPT_SYSCALL, OPT_USERSPACE, OPT_TRACEPOINT_LOGLEVEL, + OPT_LIST_OPTIONS, }; static struct lttng_handle *handle; @@ -84,6 +85,7 @@ static struct poptOption long_options[] = { #endif {"syscall", 0, POPT_ARG_NONE, 0, OPT_SYSCALL, 0, 0}, {"loglevel", 0, POPT_ARG_NONE, 0, OPT_TRACEPOINT_LOGLEVEL, 0, 0}, + {"list-options", 0, POPT_ARG_NONE, NULL, OPT_LIST_OPTIONS, NULL, NULL}, {0, 0, 0, 0, 0, 0, 0} }; @@ -95,6 +97,7 @@ static void usage(FILE *ofp) fprintf(ofp, "usage: lttng enable-event NAME[,NAME2,...] [options] [event_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, " -c, --channel Apply on this channel\n"); fprintf(ofp, " -a, --all Enable all tracepoints\n"); @@ -232,7 +235,7 @@ static int enable_events(char *session_name) dom.type = LTTNG_DOMAIN_UST; } else { ERR("Please specify a tracer (-k/--kernel or -u/--userspace)"); - ret = CMD_NOT_IMPLEMENTED; + ret = CMD_ERROR; goto error; } @@ -327,14 +330,14 @@ static int enable_events(char *session_name) MSG("per-syscall selection not supported yet. Use \"-a\" " "for all syscalls."); default: - ret = CMD_NOT_IMPLEMENTED; + ret = CMD_UNDEFINED; goto error; } } else if (opt_userspace) { /* User-space tracer action */ #if 0 if (opt_cmd_name != NULL || opt_pid) { MSG("Only supporting tracing all UST processes (-u) for now."); - ret = CMD_NOT_IMPLEMENTED; + ret = CMD_UNDEFINED; goto error; } #endif @@ -362,7 +365,7 @@ static int enable_events(char *session_name) case LTTNG_EVENT_FUNCTION_ENTRY: case LTTNG_EVENT_SYSCALL: default: - ret = CMD_NOT_IMPLEMENTED; + ret = CMD_UNDEFINED; goto error; } } else { @@ -432,6 +435,10 @@ int cmd_enable_events(int argc, const char **argv) case OPT_TRACEPOINT_LOGLEVEL: opt_event_type = LTTNG_EVENT_TRACEPOINT_LOGLEVEL; break; + case OPT_LIST_OPTIONS: + list_cmd_options(stdout, long_options); + ret = CMD_SUCCESS; + goto end; default: usage(stderr); ret = CMD_UNDEFINED;