X-Git-Url: http://git.efficios.com/?a=blobdiff_plain;f=src%2Fbin%2Flttng%2Fcommands%2Flist.c;h=5f58f10f662aaf40b848c8dc11a217c31836a2bc;hb=2c425ff76ee434cf386fd7ee40a727480be95dff;hp=6040d008d09a7b5f55f06dfdb05f7eb42981bf53;hpb=ef021732eab101776844ec263468004e287fe6e2;p=lttng-tools.git diff --git a/src/bin/lttng/commands/list.c b/src/bin/lttng/commands/list.c index 6040d008d..5f58f10f6 100644 --- a/src/bin/lttng/commands/list.c +++ b/src/bin/lttng/commands/list.c @@ -221,7 +221,7 @@ static void print_events(struct lttng_event *event) MSG("%ssymbol: \"%s\"", indent8, event->attr.ftrace.symbol_name); break; case LTTNG_EVENT_SYSCALL: - MSG("%s (type: syscall)%s", indent6, + MSG("%ssyscalls (type: syscall)%s", indent6, enabled_string(event->enabled)); break; case LTTNG_EVENT_NOOP: @@ -604,16 +604,14 @@ int cmd_list(int argc, const char **argv) } else if (opt_userspace) { DBG2("Listing userspace global domain"); domain.type = LTTNG_DOMAIN_UST; - } else { - usage(stderr); - ret = CMD_UNDEFINED; - goto end; } - handle = lttng_create_handle(session_name, &domain); - if (handle == NULL) { - ret = CMD_FATAL; - goto end; + if (opt_kernel || opt_userspace) { + handle = lttng_create_handle(session_name, &domain); + if (handle == NULL) { + ret = CMD_FATAL; + goto end; + } } if (session_name == NULL) { @@ -676,7 +674,9 @@ int cmd_list(int argc, const char **argv) } /* Clean handle before creating a new one */ - lttng_destroy_handle(handle); + if (handle) { + lttng_destroy_handle(handle); + } handle = lttng_create_handle(session_name, &domains[i]); if (handle == NULL) { @@ -696,7 +696,9 @@ end: if (domains) { free(domains); } - lttng_destroy_handle(handle); + if (handle) { + lttng_destroy_handle(handle); + } poptFreeContext(pc); return ret;