{
int ret, ret_code = LTTCOMM_CONSUMERD_SUCCESS;
struct lttng_consumer_stream *stream;
- uint64_t relayd_id = -1ULL;
assert(channel);
assert(ctx);
DBG("UST consumer sending channel %s to sessiond", channel->name);
if (channel->relayd_id != (uint64_t) -1ULL) {
- cds_list_for_each_entry(stream, &channel->streams.head, send_node) {
-
- health_code_update();
-
- /* Try to send the stream to the relayd if one is available. */
- ret = consumer_send_relayd_stream(stream, stream->chan->pathname);
- if (ret < 0) {
- /*
- * Flag that the relayd was the problem here probably due to a
- * communicaton error on the socket.
- */
- if (relayd_error) {
- *relayd_error = 1;
- }
- ret_code = LTTCOMM_CONSUMERD_RELAYD_FAIL;
- }
- if (relayd_id == -1ULL) {
- relayd_id = stream->relayd_id;
+ ret = consumer_send_relayd_channel_bulk(channel);
+ if (ret < 0) {
+ /*
+ * Flag that the relayd was the problem here probably due to a
+ * communicaton error on the socket.
+ */
+ if (relayd_error) {
+ *relayd_error = 1;
}
+ ret_code = LTTCOMM_CONSUMERD_RELAYD_FAIL;
}
}
assert(cds_list_empty(&channel->streams.head));
goto end_msg_sessiond;
}
+ case LTTNG_CONSUMER_CHANNEL_STOP_LIVE_TIMER:
+ {
+ uint64_t key = msg.u.get_channel.key;
+ struct lttng_consumer_channel *channel;
+
+ channel = consumer_find_channel(key);
+ if (!channel) {
+ ERR("UST consumer get channel key %" PRIu64 " not found", key);
+ ret_code = LTTCOMM_CONSUMERD_CHAN_NOT_FOUND;
+ goto end_msg_sessiond;
+ }
+
+ health_code_update();
+
+ if (channel->live_timer_enabled == 1) {
+ consumer_timer_live_stop(channel);
+ }
+
+ health_code_update();
+
+ goto end_msg_sessiond;
+ }
+ case LTTNG_CONSUMER_CHANNEL_START_LIVE_TIMER:
+ {
+ uint64_t key = msg.u.get_channel.key;
+ struct lttng_consumer_channel *channel;
+
+ channel = consumer_find_channel(key);
+ if (!channel) {
+ ERR("UST consumer get channel key %" PRIu64 " not found", key);
+ ret_code = LTTCOMM_CONSUMERD_CHAN_NOT_FOUND;
+ goto end_msg_sessiond;
+ }
+
+ health_code_update();
+
+ if (channel->live_timer_enabled == 0) {
+ consumer_timer_live_start(channel, channel->live_timer_interval);
+ }
+
+ health_code_update();
+
+ goto end_msg_sessiond;
+ }
+
case LTTNG_CONSUMER_DESTROY_CHANNEL:
{
uint64_t key = msg.u.destroy_channel.key;