X-Git-Url: https://git.lttng.org/?p=lttng-tools.git;a=blobdiff_plain;f=lttng%2Fcommands%2Fenable_events.c;h=5740d3cbcf95547c72f8d20080da7d8f4318140d;hp=3bf50fbeaf5c779b58233af5b4bbf4785ac60374;hb=13dce3b738049495c54e14b7401c6f2aa421f5ed;hpb=eeac7d463a09ac924c3c98f1fa5fa6c19748b4de diff --git a/lttng/commands/enable_events.c b/lttng/commands/enable_events.c index 3bf50fbea..5740d3cbc 100644 --- a/lttng/commands/enable_events.c +++ b/lttng/commands/enable_events.c @@ -48,12 +48,12 @@ static char *opt_channel_name; enum { OPT_HELP = 1, OPT_TRACEPOINT, - OPT_MARKER, OPT_PROBE, OPT_FUNCTION, OPT_FUNCTION_ENTRY, OPT_SYSCALL, OPT_USERSPACE, + OPT_TRACEPOINT_LOGLEVEL, }; static struct lttng_handle *handle; @@ -65,15 +65,21 @@ static struct poptOption long_options[] = { {"all-events", '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}, - {"userspace", 'u', POPT_ARG_STRING | POPT_ARGFLAG_OPTIONAL, 0, OPT_USERSPACE, 0, 0}, + {"userspace", 'u', POPT_ARG_STRING | POPT_ARGFLAG_OPTIONAL, &opt_cmd_name, OPT_USERSPACE, 0, 0}, {"all", 0, POPT_ARG_VAL, &opt_pid_all, 1, 0, 0}, {"pid", 'p', POPT_ARG_INT, &opt_pid, 0, 0, 0}, {"tracepoint", 0, POPT_ARG_NONE, 0, OPT_TRACEPOINT, 0, 0}, - {"marker", 0, POPT_ARG_NONE, 0, OPT_MARKER, 0, 0}, - {"probe", 0, POPT_ARG_STRING, 0, OPT_PROBE, 0, 0}, - {"function", 0, POPT_ARG_STRING, 0, OPT_FUNCTION, 0, 0}, - {"function:entry", 0, POPT_ARG_STRING, 0, OPT_FUNCTION_ENTRY, 0, 0}, - {"syscall", 0, POPT_ARG_NONE, 0, OPT_SYSCALL, 0, 0}, + {"probe", 0, POPT_ARG_STRING, &opt_probe, OPT_PROBE, 0, 0}, + {"function", 0, POPT_ARG_STRING, &opt_function, OPT_FUNCTION, 0, 0}, +#if 0 + /* + * Currently removed from lttng kernel tracer. Removed from + * lttng UI to discourage its use. + */ + {"function:entry", 0, POPT_ARG_STRING, &opt_function_entry_symbol, OPT_FUNCTION_ENTRY, 0, 0}, +#endif + {"syscall", 0, POPT_ARG_NONE, 0, OPT_SYSCALL, 0, 0}, + {"loglevel", 0, POPT_ARG_NONE, 0, OPT_TRACEPOINT_LOGLEVEL, 0, 0}, {0, 0, 0, 0, 0, 0, 0} }; @@ -95,6 +101,7 @@ static void usage(FILE *ofp) fprintf(ofp, "\n"); fprintf(ofp, "Event options:\n"); fprintf(ofp, " --tracepoint Tracepoint event (default)\n"); + fprintf(ofp, " --loglevel Tracepoint loglevel\n"); fprintf(ofp, " --probe [addr | symbol | symbol+offset]\n"); fprintf(ofp, " Dynamic probe.\n"); fprintf(ofp, " Addr and offset can be octal (0NNN...),\n"); @@ -103,10 +110,11 @@ static void usage(FILE *ofp) 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"); +#if 0 fprintf(ofp, " --function:entry symbol\n"); fprintf(ofp, " Function tracer event\n"); +#endif fprintf(ofp, " --syscall System call event\n"); - fprintf(ofp, " --marker User-space marker (deprecated)\n"); fprintf(ofp, "\n"); } @@ -338,6 +346,9 @@ static int enable_events(char *session_name) /* Fall-through */ case LTTNG_EVENT_TRACEPOINT: break; + case LTTNG_EVENT_TRACEPOINT_LOGLEVEL: + ev.type = LTTNG_EVENT_TRACEPOINT_LOGLEVEL; + break; case LTTNG_EVENT_PROBE: case LTTNG_EVENT_FUNCTION: case LTTNG_EVENT_FUNCTION_ENTRY: @@ -388,7 +399,6 @@ int cmd_enable_events(int argc, const char **argv) opt_event_type = LTTNG_EVENT_ALL; while ((opt = poptGetNextOpt(pc)) != -1) { - fprintf(stderr, "OPT TEST %d\n", opt); switch (opt) { case OPT_HELP: usage(stderr); @@ -397,27 +407,23 @@ int cmd_enable_events(int argc, const char **argv) case OPT_TRACEPOINT: opt_event_type = LTTNG_EVENT_TRACEPOINT; break; - case OPT_MARKER: - ret = CMD_NOT_IMPLEMENTED; - goto end; case OPT_PROBE: opt_event_type = LTTNG_EVENT_PROBE; - opt_probe = poptGetOptArg(pc); break; case OPT_FUNCTION: opt_event_type = LTTNG_EVENT_FUNCTION; - opt_function = poptGetOptArg(pc); break; case OPT_FUNCTION_ENTRY: opt_event_type = LTTNG_EVENT_FUNCTION_ENTRY; - opt_function_entry_symbol = poptGetOptArg(pc); break; case OPT_SYSCALL: opt_event_type = LTTNG_EVENT_SYSCALL; break; case OPT_USERSPACE: opt_userspace = 1; - opt_cmd_name = poptGetOptArg(pc); + break; + case OPT_TRACEPOINT_LOGLEVEL: + opt_event_type = LTTNG_EVENT_TRACEPOINT_LOGLEVEL; break; default: usage(stderr);