Fix: lttng list -u <name> should only list UST
[lttng-tools.git] / src / bin / lttng / commands / list.c
index bca06e75d49cecd7bee2b07a03aa415f7e468aba..66a322a06adb650b2a593c9147a7d9ed556bf8ba 100644 (file)
@@ -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) {
@@ -217,18 +226,20 @@ 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 (%d)) (type: tracepoint)%s%s%s",
                                indent6,
                                event->name,
                                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 +475,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 +920,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) {
This page took 0.023541 seconds and 4 git commands to generate.