X-Git-Url: https://git.lttng.org/?p=lttng-tools.git;a=blobdiff_plain;f=src%2Fbin%2Flttng%2Fcommands%2Flist.c;h=a6ea6b8c9c6c153375bac25c7b390466b830d01d;hp=eced2b7165f1836098e415aad4768c772a581240;hb=6191db77fd286967df592b572f4e232d586c7e1f;hpb=d8fbe2a9cc6ace367bfb5428df3e7649ac012f32 diff --git a/src/bin/lttng/commands/list.c b/src/bin/lttng/commands/list.c index eced2b716..a6ea6b8c9 100644 --- a/src/bin/lttng/commands/list.c +++ b/src/bin/lttng/commands/list.c @@ -281,7 +281,7 @@ static void print_event_field(struct lttng_event_field *field) return; } MSG("%sfield: %s (%s)%s", indent8, field->field_name, - field_type(field), field->written ? "" : " [no write]"); + field_type(field), field->nowrite ? " [no write]" : ""); } /* @@ -521,11 +521,17 @@ static int list_channels(const char *channel_name) count = lttng_list_channels(handle, &channels); if (count < 0) { - ret = count; + switch (-count) { + case LTTNG_ERR_KERN_CHAN_NOT_FOUND: + ret = CMD_SUCCESS; + WARN("No kernel channel"); + break; + default: + /* We had a real error */ + ret = count; + ERR("%s", lttng_strerror(ret)); + } goto error_channels; - } else if (count == 0) { - ERR("Channel %s not found", channel_name); - goto error; } if (channel_name == NULL) { @@ -674,8 +680,7 @@ error: */ int cmd_list(int argc, const char **argv) { - int opt, i, ret = CMD_SUCCESS; - int nb_domain; + int opt, ret = CMD_SUCCESS; const char *session_name; static poptContext pc; struct lttng_domain domain; @@ -739,6 +744,7 @@ int cmd_list(int argc, const char **argv) if (opt_kernel) { ret = list_kernel_events(); if (ret < 0) { + ret = CMD_ERROR; goto end; } } @@ -749,6 +755,7 @@ int cmd_list(int argc, const char **argv) ret = list_ust_events(); } if (ret < 0) { + ret = CMD_ERROR; goto end; } } @@ -772,6 +779,8 @@ int cmd_list(int argc, const char **argv) goto end; } } else { + int i, nb_domain; + /* We want all domain(s) */ nb_domain = lttng_list_domains(session_name, &domains); if (nb_domain < 0) {