ret = snprintf(ll_value, LTTNG_SYMBOL_NAME_LEN,
" (%lld)", (long long) event->loglevel_value);
- if (ret < 0)
+ if (ret < 0) {
ERR("snprintf error");
+ }
}
MSG("%s%s%s%s%s%s (type: tracepoint)%s", indent6,
event->name,
MSG("%s (type: noop)%s", indent6,
enabled_string(event->enabled));
break;
- case LTTNG_EVENT_TRACEPOINT_LOGLEVEL:
- MSG("%s%s (type: tracepoint loglevel)%s", indent6,
- event->name,
- enabled_string(event->enabled));
- break;
case LTTNG_EVENT_ALL:
/* We should never have "all" events in list. */
assert(0);
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) {
}
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;
}
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) {
if (argc < 1) {
usage(stderr);
+ ret = CMD_ERROR;
goto end;
}
while ((opt = poptGetNextOpt(pc)) != -1) {
switch (opt) {
case OPT_HELP:
- usage(stderr);
+ usage(stdout);
goto end;
case OPT_USERSPACE:
opt_userspace = 1;
break;
case OPT_LIST_OPTIONS:
list_cmd_options(stdout, long_options);
- ret = CMD_SUCCESS;
goto end;
default:
usage(stderr);
handle = lttng_create_handle(session_name, &domain);
if (handle == NULL) {
+ ret = CMD_FATAL;
goto end;
}
if (!opt_kernel && !opt_userspace) {
ret = list_sessions(NULL);
if (ret < 0) {
+ ret = CMD_ERROR;
goto end;
}
}
if (opt_kernel) {
ret = list_kernel_events();
if (ret < 0) {
+ ret = CMD_ERROR;
goto end;
}
}
if (opt_userspace) {
ret = list_ust_events();
if (ret < 0) {
+ ret = CMD_ERROR;
goto end;
}
}
/* List session attributes */
ret = list_sessions(session_name);
if (ret < 0) {
+ ret = CMD_ERROR;
goto end;
}
/* Domain listing */
if (opt_domain) {
ret = list_domains(session_name);
+ if (ret < 0) {
+ ret = CMD_ERROR;
+ }
goto end;
}
/* Channel listing */
ret = list_channels(opt_channel);
if (ret < 0) {
+ ret = CMD_ERROR;
goto end;
}
} else {
/* We want all domain(s) */
nb_domain = lttng_list_domains(session_name, &domains);
if (nb_domain < 0) {
- ret = nb_domain;
+ ret = CMD_ERROR;
goto end;
}
handle = lttng_create_handle(session_name, &domains[i]);
if (handle == NULL) {
+ ret = CMD_FATAL;
goto end;
}
ret = list_channels(opt_channel);
if (ret < 0) {
+ ret = CMD_ERROR;
goto end;
}
}
}
lttng_destroy_handle(handle);
+ poptFreeContext(pc);
return ret;
}