The LTTng sessiond daemon reports an error when the list_channel
command is invoked on a session which only has a metadata channel.
The error lies in assuming that a session which has an enabled
domains also has (user-visible) channels.
The metadata channel should be listed in a future fix.
Fixes #855
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
Conflicts:
src/bin/lttng/commands/list.c
session->ust_session->domain_global.channels);
}
DBG3("Number of UST global channels %zd", nb_chan);
- if (nb_chan <= 0) {
+ if (nb_chan < 0) {
ret = LTTNG_ERR_UST_CHAN_NOT_FOUND;
+ goto error;
}
break;
default:
- *channels = NULL;
ret = LTTNG_ERR_UND;
goto error;
}
}
list_lttng_channels(domain, session, *channels);
- } else {
- *channels = NULL;
- /* Ret value was set in the domain switch case */
- goto error;
}
return nb_chan;
case LTTNG_LIST_CHANNELS:
{
int nb_chan;
- struct lttng_channel *channels;
+ struct lttng_channel *channels = NULL;
nb_chan = cmd_list_channels(cmd_ctx->lsm->domain.type,
cmd_ctx->session, &channels);
goto error_channels;
}
- if (channel_name == NULL) {
+ if (count) {
MSG("Channels:\n-------------");
}