From: Jérémie Galarneau Date: Thu, 5 Sep 2024 15:26:33 +0000 (-0400) Subject: clang-format: run clang-format on the tree X-Git-Url: https://git.lttng.org./?a=commitdiff_plain;h=7c8d0f41c;p=lttng-tools.git clang-format: run clang-format on the tree Signed-off-by: Jérémie Galarneau Change-Id: Ifa81e86645655c1e4c1ee81375dad3ba45e850d1 --- diff --git a/src/bin/lttng-relayd/live.cpp b/src/bin/lttng-relayd/live.cpp index 250e05c2e..079ac6b0b 100644 --- a/src/bin/lttng-relayd/live.cpp +++ b/src/bin/lttng-relayd/live.cpp @@ -331,7 +331,6 @@ static ssize_t send_viewer_streams(struct lttcomm_sock *sock, decltype(relay_viewer_stream::stream_n), &relay_viewer_stream::stream_n>( *viewer_streams_ht->ht)) { - health_code_update(); if (!viewer_stream_get(vstream)) { @@ -364,8 +363,10 @@ static ssize_t send_viewer_streams(struct lttcomm_sock *sock, * Any remaining streams that have been seen, but are perhaps unpublished * due to a session being destroyed in between attach and get_new_streams. */ - for (auto *vstream : lttng::urcu::rcu_list_iteration_adapter(viewer_session->unannounced_stream_list)) { + for (auto *vstream : + lttng::urcu::rcu_list_iteration_adapter( + viewer_session->unannounced_stream_list)) { health_code_update(); if (!viewer_stream_get(vstream)) { continue; @@ -390,7 +391,6 @@ static ssize_t send_viewer_streams(struct lttcomm_sock *sock, viewer_stream_put(vstream); pthread_mutex_unlock(&viewer_session->unannounced_stream_list_lock); viewer_stream_put(vstream); - } ret = 0; @@ -411,12 +411,12 @@ end: * Return 0 on success or else a negative value. */ int make_viewer_streams(struct relay_session *relay_session, - struct relay_viewer_session *viewer_session, - enum lttng_viewer_seek seek_t, - unsigned int *nb_total, - unsigned int *nb_unsent, - unsigned int *nb_created, - bool *closed) + struct relay_viewer_session *viewer_session, + enum lttng_viewer_seek seek_t, + unsigned int *nb_total, + unsigned int *nb_unsent, + unsigned int *nb_created, + bool *closed) { int ret; @@ -430,8 +430,10 @@ int make_viewer_streams(struct relay_session *relay_session, /* * Check unannounced viewer streams for any that have been seen but are no longer published. */ - for (auto *viewer_stream : lttng::urcu::rcu_list_iteration_adapter(viewer_session->unannounced_stream_list)) { + for (auto *viewer_stream : + lttng::urcu::rcu_list_iteration_adapter( + viewer_session->unannounced_stream_list)) { if (!viewer_stream_get(viewer_stream)) { DBG("Couldn't get reference for viewer_stream"); continue; @@ -623,12 +625,10 @@ int make_viewer_streams(struct relay_session *relay_session, * Add the new stream to the list of streams to publish for * this session. */ - pthread_mutex_lock( - &viewer_session->unannounced_stream_list_lock); + pthread_mutex_lock(&viewer_session->unannounced_stream_list_lock); cds_list_add_rcu(&viewer_stream->viewer_stream_node, &viewer_session->unannounced_stream_list); - pthread_mutex_unlock( - &viewer_session->unannounced_stream_list_lock); + pthread_mutex_unlock(&viewer_session->unannounced_stream_list_lock); /* * Get for the unannounced stream list, this should be * put when the unannounced stream is sent. @@ -658,7 +658,7 @@ int make_viewer_streams(struct relay_session *relay_session, } /* Update number of total stream counter. */ if (nb_total) { - if (stream->is_metadata) { + if (stream->is_metadata) { if (!stream->closed || stream->metadata_received > viewer_stream->metadata_sent) { @@ -1911,7 +1911,9 @@ static int viewer_get_next_index(struct relay_connection *conn) conn->viewer_session->current_trace_chunk ? std::to_string(viewer_session_chunk_id).c_str() : "None"); - } else if (vstream->stream_file.trace_chunk && rstream->completed_rotation_count == vstream->last_seen_rotation_count && !rstream->trace_chunk) { + } else if (vstream->stream_file.trace_chunk && + rstream->completed_rotation_count == vstream->last_seen_rotation_count && + !rstream->trace_chunk) { /* * When a relay stream is closed, there is a window before the rotation of the * streams happens, during which the next index may be fetched. If the seen diff --git a/src/bin/lttng-relayd/main.cpp b/src/bin/lttng-relayd/main.cpp index c26050b45..ed5ec9d8f 100644 --- a/src/bin/lttng-relayd/main.cpp +++ b/src/bin/lttng-relayd/main.cpp @@ -1551,13 +1551,15 @@ static void publish_connection_local_streams(struct relay_connection *conn) * but may be unpublished between now and the next GET_NEW_STREAMS from the * attached live viewer. */ - for (auto *viewer_session: lttng::urcu::lfht_iteration_adapter(*viewer_sessions_ht->ht)) - { - for (auto *session_iter: lttng::urcu::rcu_list_iteration_adapter(viewer_session->session_list)) - { + for (auto *viewer_session : + lttng::urcu::lfht_iteration_adapter( + *viewer_sessions_ht->ht)) { + for (auto *session_iter : + lttng::urcu::rcu_list_iteration_adapter( + viewer_session->session_list)) { if (session != session_iter) { continue; } diff --git a/src/bin/lttng-relayd/viewer-session.cpp b/src/bin/lttng-relayd/viewer-session.cpp index 1ed625f75..0c501eea3 100644 --- a/src/bin/lttng-relayd/viewer-session.cpp +++ b/src/bin/lttng-relayd/viewer-session.cpp @@ -122,21 +122,24 @@ enum lttng_viewer_attach_return_code viewer_session_attach(struct relay_viewer_s uint32_t unsent = 0; bool closed = false; const int make_viewer_streams_ret = make_viewer_streams(session, - vsession, - LTTNG_VIEWER_SEEK_BEGINNING, - &total, - &unsent, - &created, - &closed); + vsession, + LTTNG_VIEWER_SEEK_BEGINNING, + &total, + &unsent, + &created, + &closed); if (make_viewer_streams_ret == 0) { - DBG("Created %d new viewer streams while attaching to relay session %" PRIu64, created, session->id); + DBG("Created %d new viewer streams while attaching to relay session %" PRIu64, + created, + session->id); } else { /* * Warning, since the creation of the streams will be retried when * the viewer next sends the GET_NEW_STREAMS commands. */ - WARN("Failed to create new viewer streams while attaching to relay session %" PRIu64 ", ret=%d, total=%d, unsent=%d, created=%d, closed=%d", + WARN("Failed to create new viewer streams while attaching to relay session %" PRIu64 + ", ret=%d, total=%d, unsent=%d, created=%d, closed=%d", session->id, make_viewer_streams_ret, total, @@ -223,9 +226,10 @@ void viewer_session_close_one_session(struct relay_viewer_session *vsession, viewer_stream_put(vstream); } - for (auto *vstream: lttng::urcu::rcu_list_iteration_adapter(vsession->unannounced_stream_list)) - { + for (auto *vstream : + lttng::urcu::rcu_list_iteration_adapter( + vsession->unannounced_stream_list)) { if (!viewer_stream_get(vstream)) { continue; }