*
* Returns LTTNG_OK, or an LTTng error code on failure.
*/
-static enum lttng_error_code send_consumer_relayd_sockets(
- unsigned int session_id, struct consumer_output *consumer,
- struct consumer_socket *sock, const char *session_name,
- const char *hostname, const char *base_path, int session_live_timer,
- const uint64_t *current_chunk_id, time_t session_creation_time,
- bool session_name_contains_creation_time)
+static lttng_error_code send_consumer_relayd_sockets(const ltt_session& session,
+ struct consumer_output *consumer,
+ struct consumer_socket *sock,
+ const char *base_path,
+ const uint64_t *current_chunk_id)
{
enum lttng_error_code status = LTTNG_OK;
struct lttcomm_relayd_sock *control_sock = nullptr;
consumer->relay_allows_clear = true;
}
- status = send_consumer_relayd_socket(session_id, &consumer->dst.net.control,
- consumer, sock, session_name, hostname, base_path,
- session_live_timer, current_chunk_id, session_creation_time,
- session_name_contains_creation_time, *control_sock);
+ status = send_consumer_relayd_socket(session.id, &consumer->dst.net.control,
+ consumer, sock, session.name, session.hostname, base_path,
+ session.live_timer, current_chunk_id, session.creation_time,
+ session.name_contains_creation_time, *control_sock);
if (status != LTTNG_OK) {
goto error;
}
LTTNG_ASSERT(data_sock);
- status = send_consumer_relayd_socket(session_id, &consumer->dst.net.data, consumer,
- sock, session_name, hostname, base_path, session_live_timer,
- current_chunk_id, session_creation_time,
- session_name_contains_creation_time, *data_sock);
+ status = send_consumer_relayd_socket(session.id, &consumer->dst.net.data, consumer,
+ sock, session.name, session.hostname, base_path, session.live_timer,
+ current_chunk_id, session.creation_time,
+ session.name_contains_creation_time, *data_sock);
if (status != LTTNG_OK) {
goto error;
if (usess && usess->consumer && usess->consumer->type == CONSUMER_DST_NET
&& usess->consumer->enabled) {
/* For each consumer socket, send relayd sockets */
- cds_lfht_for_each_entry(usess->consumer->socks->ht, &iter.iter,
- socket, node.node) {
+ cds_lfht_for_each_entry (
+ usess->consumer->socks->ht, &iter.iter, socket, node.node) {
pthread_mutex_lock(socket->lock);
- ret = send_consumer_relayd_sockets(session->id,
- usess->consumer, socket,
- session->name, session->hostname,
+ ret = send_consumer_relayd_sockets(*session, usess->consumer, socket,
session->base_path,
- session->live_timer,
- current_chunk_id.is_set ? ¤t_chunk_id.value : NULL,
- session->creation_time,
- session->name_contains_creation_time);
+ current_chunk_id.is_set ? ¤t_chunk_id.value : NULL);
pthread_mutex_unlock(socket->lock);
if (ret != LTTNG_OK) {
goto error;
if (ksess && ksess->consumer && ksess->consumer->type == CONSUMER_DST_NET
&& ksess->consumer->enabled) {
- cds_lfht_for_each_entry(ksess->consumer->socks->ht, &iter.iter,
- socket, node.node) {
+ cds_lfht_for_each_entry (
+ ksess->consumer->socks->ht, &iter.iter, socket, node.node) {
pthread_mutex_lock(socket->lock);
- ret = send_consumer_relayd_sockets(session->id,
- ksess->consumer, socket,
- session->name, session->hostname,
+ ret = send_consumer_relayd_sockets(*session, ksess->consumer, socket,
session->base_path,
- session->live_timer,
- current_chunk_id.is_set ? ¤t_chunk_id.value : NULL,
- session->creation_time,
- session->name_contains_creation_time);
+ current_chunk_id.is_set ? ¤t_chunk_id.value : NULL);
pthread_mutex_unlock(socket->lock);
if (ret != LTTNG_OK) {
goto error;
* snapshot output.
*/
rcu_read_lock();
- cds_lfht_for_each_entry(output->socks->ht, &iter.iter,
- socket, node.node) {
+ cds_lfht_for_each_entry (output->socks->ht, &iter.iter, socket, node.node) {
pthread_mutex_lock(socket->lock);
- status = send_consumer_relayd_sockets(session->id,
- output, socket,
- session->name, session->hostname,
- base_path,
- session->live_timer,
- current_chunk_id.is_set ? ¤t_chunk_id.value : NULL,
- session->creation_time,
- session->name_contains_creation_time);
+ status = send_consumer_relayd_sockets(*session, output, socket, base_path,
+ current_chunk_id.is_set ? ¤t_chunk_id.value : NULL);
pthread_mutex_unlock(socket->lock);
if (status != LTTNG_OK) {
rcu_read_unlock();