X-Git-Url: https://git.liburcu.org/?a=blobdiff_plain;f=src%2Fbin%2Flttng-relayd%2Fsession.cpp;h=6e29fbc741afd1efe32723f7342f8cc809fa9a3c;hb=0114db0ec2407029052eb61a0189c9b1cd64d520;hp=ca8e183e64bbb2ca5118b52217c6228aca522271;hpb=fe88e51751c3846b91592a7d52cb975f9c0f5de4;p=lttng-tools.git diff --git a/src/bin/lttng-relayd/session.cpp b/src/bin/lttng-relayd/session.cpp index ca8e183e6..6e29fbc74 100644 --- a/src/bin/lttng-relayd/session.cpp +++ b/src/bin/lttng-relayd/session.cpp @@ -8,23 +8,23 @@ */ #define _LGPL_SOURCE -#include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include +#include #include #include -#include "ctf-trace.h" -#include "lttng-relayd.h" -#include "session.h" -#include "sessiond-trace-chunks.h" -#include "stream.h" -#include -#include "utils.h" +#include "ctf-trace.hpp" +#include "lttng-relayd.hpp" +#include "session.hpp" +#include "sessiond-trace-chunks.hpp" +#include "stream.hpp" +#include +#include "utils.hpp" /* Global session id used in the session creation. */ static uint64_t last_relay_session_id; @@ -281,7 +281,7 @@ struct relay_session *session_create(const char *session_name, const char *hostname, const char *base_path, uint32_t live_timer, bool snapshot, - const lttng_uuid sessiond_uuid, + const lttng_uuid& sessiond_uuid, const uint64_t *id_sessiond, const uint64_t *current_chunk_id, const time_t *creation_time, @@ -310,7 +310,7 @@ struct relay_session *session_create(const char *session_name, goto error; } - session = (relay_session *) zmalloc(sizeof(*session)); + session = zmalloc(); if (!session) { PERROR("Failed to allocate session"); goto error; @@ -363,7 +363,7 @@ struct relay_session *session_create(const char *session_name, session->live_timer = live_timer; session->snapshot = snapshot; - lttng_uuid_copy(session->sessiond_uuid, sessiond_uuid); + session->sessiond_uuid = sessiond_uuid; if (id_sessiond) { LTTNG_OPTIONAL_SET(&session->id_sessiond, *id_sessiond); @@ -464,7 +464,7 @@ struct relay_session *session_get_by_id(uint64_t id) DBG("Session find by ID %" PRIu64 " id NOT found", id); goto end; } - session = caa_container_of(node, struct relay_session, session_n); + session = lttng::utils::container_of(node, &relay_session::session_n); DBG("Session find by ID %" PRIu64 " id found", id); if (!session_get(session)) { session = NULL; @@ -527,8 +527,7 @@ bool session_has_ongoing_rotation(const struct relay_session *session) goto next_session; } - if (!lttng_uuid_is_equal(session->sessiond_uuid, - iterated_session->sessiond_uuid)) { + if (session->sessiond_uuid != iterated_session->sessiond_uuid) { /* Sessions do not originate from the same sessiond. */ goto next_session; } @@ -610,7 +609,7 @@ static void destroy_session(struct relay_session *session) static void session_release(struct urcu_ref *ref) { struct relay_session *session = - caa_container_of(ref, struct relay_session, ref); + lttng::utils::container_of(ref, &relay_session::ref); destroy_session(session); }