X-Git-Url: https://git.lttng.org/?a=blobdiff_plain;f=src%2Fbin%2Flttng%2Fcommands%2Flist.c;h=ef1efc79371876406eccea376fcec64083d2575c;hb=2722170124d7942f34b991237874a6d6c17fc421;hp=d84fd2ba97d6e78551b3f07d07ea649d5dc6ffb5;hpb=ca1c3607d2f5654163875cda874f43971df0f696;p=lttng-tools.git diff --git a/src/bin/lttng/commands/list.c b/src/bin/lttng/commands/list.c index d84fd2ba9..ef1efc793 100644 --- a/src/bin/lttng/commands/list.c +++ b/src/bin/lttng/commands/list.c @@ -70,22 +70,22 @@ static struct poptOption long_options[] = { */ static void usage(FILE *ofp) { - fprintf(ofp, "usage: lttng list [SESSION []]\n"); + fprintf(ofp, "usage: lttng list [OPTIONS] [SESSION []]\n"); fprintf(ofp, "\n"); fprintf(ofp, "With no arguments, list available tracing session(s)\n"); fprintf(ofp, "\n"); - fprintf(ofp, "With -k alone, list available kernel events\n"); - fprintf(ofp, "With -u alone, list available userspace events\n"); + fprintf(ofp, "Without a session, -k lists available kernel events\n"); + fprintf(ofp, "Without a session, -u lists available userspace events\n"); fprintf(ofp, "\n"); fprintf(ofp, " -h, --help Show this help\n"); - fprintf(ofp, " --list-options Simple listing of options\n"); + fprintf(ofp, " --list-options Simple listing of options\n"); fprintf(ofp, " -k, --kernel Select kernel domain\n"); fprintf(ofp, " -u, --userspace Select user-space domain.\n"); #if 0 fprintf(ofp, " -p, --pid PID List user-space events by PID\n"); #endif fprintf(ofp, "\n"); - fprintf(ofp, "Options:\n"); + fprintf(ofp, "Session Options:\n"); fprintf(ofp, " -c, --channel NAME List details of a channel\n"); fprintf(ofp, " -d, --domain List available domain(s)\n"); fprintf(ofp, "\n"); @@ -389,10 +389,10 @@ static int list_channels(const char *channel_name) count = lttng_list_channels(handle, &channels); if (count < 0) { ret = count; - goto error; + goto error_channels; } else if (count == 0) { - MSG("No channel found"); - goto end; + ERR("Channel %s not found", channel_name); + goto error; } if (channel_name == NULL) { @@ -421,14 +421,16 @@ static int list_channels(const char *channel_name) } if (!chan_found && channel_name != NULL) { - MSG("Channel %s not found", channel_name); + ERR("Channel %s not found", channel_name); + goto error; } -end: - free(channels); ret = CMD_SUCCESS; error: + free(channels); + +error_channels: return ret; } @@ -475,7 +477,7 @@ static int list_sessions(const char *session_name) free(sessions); if (!session_found && session_name != NULL) { - MSG("Session %s not found", session_name); + ERR("Session %s not found", session_name); } if (session_name == NULL) {