X-Git-Url: https://git.lttng.org/?a=blobdiff_plain;f=src%2Fbin%2Flttng%2Fcommands%2Flist.c;h=f69b3ba3d67b1b8ce5a2b02b839d032f306f4a0e;hb=1a2416565951eff19530564c552931cc71866e8c;hp=bca06e75d49cecd7bee2b07a03aa415f7e468aba;hpb=3c6a091f88fa6b237729cab17d6f6d227da82f59;p=lttng-tools.git diff --git a/src/bin/lttng/commands/list.c b/src/bin/lttng/commands/list.c index bca06e75d..f69b3ba3d 100644 --- a/src/bin/lttng/commands/list.c +++ b/src/bin/lttng/commands/list.c @@ -168,6 +168,15 @@ const char *filter_string(int value) } } +static +const char *exclusion_string(int value) +{ + switch (value) { + case 1: return " [has exclusions]"; + default: return ""; + } +} + static const char *loglevel_string(int value) { switch (value) { @@ -208,6 +217,20 @@ static const char *loglevel_string(int value) } } +static const char *logleveltype_string(enum lttng_loglevel_type value) +{ + switch (value) { + case LTTNG_EVENT_LOGLEVEL_ALL: + return ":"; + case LTTNG_EVENT_LOGLEVEL_RANGE: + return " <="; + case LTTNG_EVENT_LOGLEVEL_SINGLE: + return " =="; + default: + return " <>"; + } +} + /* * Pretty print single event. */ @@ -217,18 +240,21 @@ static void print_events(struct lttng_event *event) case LTTNG_EVENT_TRACEPOINT: { if (event->loglevel != -1) { - MSG("%s%s (loglevel: %s (%d)) (type: tracepoint)%s%s", + MSG("%s%s (loglevel%s %s (%d)) (type: tracepoint)%s%s%s", indent6, event->name, + logleveltype_string(event->loglevel_type), loglevel_string(event->loglevel), event->loglevel, enabled_string(event->enabled), + exclusion_string(event->exclusion), filter_string(event->filter)); } else { - MSG("%s%s (type: tracepoint)%s%s", + MSG("%s%s (type: tracepoint)%s%s%s", indent6, event->name, enabled_string(event->enabled), + exclusion_string(event->exclusion), filter_string(event->filter)); } break; @@ -464,6 +490,8 @@ static int list_ust_event_fields(void) cmdline = get_cmdline_by_pid(cur_pid); MSG("\nPID: %d - Name: %s", cur_pid, cmdline); free(cmdline); + /* Wipe current event since we are about to print a new PID. */ + memset(&cur_event, 0, sizeof(cur_event)); } if (strcmp(cur_event.name, event_field_list[i].event.name) != 0) { print_events(&event_field_list[i].event); @@ -907,7 +935,7 @@ int cmd_list(int argc, const char **argv) goto end; } - if (opt_kernel) { + if (opt_kernel || opt_userspace) { /* Channel listing */ ret = list_channels(opt_channel); if (ret < 0) {