Tests: add basic ust context tests for $app, vpid, vuid, vgid
[lttng-tools.git] / src / bin / lttng-relayd / ctf-trace.cpp
index 861bcfbb3f7a44c6d055babdc544abc584835dfc..ba4a29092ca537f28e68153027823840f3882fdc 100644 (file)
@@ -9,13 +9,13 @@
 
 #define _LGPL_SOURCE
 
-#include <common/common.h>
-#include <common/utils.h>
+#include <common/common.hpp>
+#include <common/utils.hpp>
 #include <urcu/rculist.h>
 
-#include "ctf-trace.h"
-#include "lttng-relayd.h"
-#include "stream.h"
+#include "ctf-trace.hpp"
+#include "lttng-relayd.hpp"
+#include "stream.hpp"
 
 static uint64_t last_relay_ctf_trace_id;
 static pthread_mutex_t last_relay_ctf_trace_id_lock = PTHREAD_MUTEX_INITIALIZER;
@@ -23,7 +23,7 @@ static pthread_mutex_t last_relay_ctf_trace_id_lock = PTHREAD_MUTEX_INITIALIZER;
 static void rcu_destroy_ctf_trace(struct rcu_head *rcu_head)
 {
        struct ctf_trace *trace =
-               caa_container_of(rcu_head, struct ctf_trace, rcu_node);
+               lttng::utils::container_of(rcu_head, &ctf_trace::rcu_node);
 
        free(trace);
 }
@@ -53,7 +53,7 @@ static void ctf_trace_destroy(struct ctf_trace *trace)
 static void ctf_trace_release(struct urcu_ref *ref)
 {
        struct ctf_trace *trace =
-               caa_container_of(ref, struct ctf_trace, ref);
+               lttng::utils::container_of(ref, &ctf_trace::ref);
        int ret;
        struct lttng_ht_iter iter;
 
@@ -97,7 +97,7 @@ static struct ctf_trace *ctf_trace_create(struct relay_session *session,
 {
        struct ctf_trace *trace;
 
-       trace = (ctf_trace *) zmalloc(sizeof(*trace));
+       trace = zmalloc<ctf_trace>();
        if (!trace) {
                PERROR("Failed to allocate ctf_trace");
                goto end;
@@ -156,7 +156,7 @@ struct ctf_trace *ctf_trace_get_by_path_or_create(struct relay_session *session,
                DBG("CTF Trace path %s not found", subpath);
                goto end;
        }
-       trace = caa_container_of(node, struct ctf_trace, node);
+       trace = lttng::utils::container_of(node, &ctf_trace::node);
        if (!ctf_trace_get(trace)) {
                trace = NULL;
        }
This page took 0.024498 seconds and 4 git commands to generate.