X-Git-Url: https://git.lttng.org/?p=lttng-tools.git;a=blobdiff_plain;f=src%2Fbin%2Flttng%2Fcommands%2Flist.c;h=743b79ff2431f826ec2d623fe1957c834bff0a0d;hp=6f37254e41c35ce6de41c1215483ecee9058a212;hb=679b4943c3b0f451e7f4fbcd804dd8a7a679e253;hpb=10a8a2237343699e3923d87e24dbf2d7fe225377 diff --git a/src/bin/lttng/commands/list.c b/src/bin/lttng/commands/list.c index 6f37254e4..743b79ff2 100644 --- a/src/bin/lttng/commands/list.c +++ b/src/bin/lttng/commands/list.c @@ -24,14 +24,17 @@ #include #include -#include "../cmd.h" +#include "../command.h" -static int opt_pid; static int opt_userspace; -static char *opt_cmd_name; static int opt_kernel; static char *opt_channel; static int opt_domain; +#if 0 +/* Not implemented yet */ +static char *opt_cmd_name; +static pid_t opt_pid; +#endif const char *indent4 = " "; const char *indent6 = " "; @@ -40,6 +43,7 @@ const char *indent8 = " "; enum { OPT_HELP = 1, OPT_USERSPACE, + OPT_LIST_OPTIONS, }; static struct lttng_handle *handle; @@ -48,10 +52,16 @@ static struct poptOption long_options[] = { /* longName, shortName, argInfo, argPtr, value, descrip, argDesc */ {"help", 'h', POPT_ARG_NONE, 0, OPT_HELP, 0, 0}, {"kernel", 'k', POPT_ARG_VAL, &opt_kernel, 1, 0, 0}, - {"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}, +#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 {"channel", 'c', POPT_ARG_STRING, &opt_channel, 0, 0, 0}, {"domain", 'd', POPT_ARG_VAL, &opt_domain, 1, 0, 0}, + {"list-options", 0, POPT_ARG_NONE, NULL, OPT_LIST_OPTIONS, NULL, NULL}, {0, 0, 0, 0, 0, 0, 0} }; @@ -68,9 +78,12 @@ static void usage(FILE *ofp) fprintf(ofp, "With -u alone, list 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"); +#if 0 fprintf(ofp, " -p, --pid PID List user-space events by PID\n"); +#endif fprintf(ofp, "\n"); fprintf(ofp, "Options:\n"); fprintf(ofp, " -c, --channel NAME List details of a channel\n"); @@ -546,6 +559,10 @@ int cmd_list(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; @@ -553,10 +570,6 @@ int cmd_list(int argc, const char **argv) } } - if (opt_pid != 0) { - MSG("*** Userspace tracing not implemented for PID ***\n"); - } - /* Get session name (trailing argument) */ session_name = poptGetArg(pc); DBG2("Session name: %s", session_name);