Fix: lttng list -u <name> should only list UST
[lttng-tools.git] / src / bin / lttng / commands / list.c
index 75862ffb4ba224cbc402cda0bb4c7a87625d6690..fb034a3da2a23e7b7503164853363427b00f2ea2 100644 (file)
@@ -71,7 +71,7 @@ static struct poptOption long_options[] = {
  */
 static void usage(FILE *ofp)
 {
-       fprintf(ofp, "usage: lttng list [OPTIONS] [SESSION [<OPTIONS>]]\n");
+       fprintf(ofp, "usage: lttng list [OPTIONS] [SESSION [SESSION OPTIONS]]\n");
        fprintf(ofp, "\n");
        fprintf(ofp, "With no arguments, list available tracing session(s)\n");
        fprintf(ofp, "\n");
@@ -407,6 +407,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);
@@ -799,7 +801,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.024349 seconds and 4 git commands to generate.