Use the trace format type for ust metadata generation
[deliverable/lttng-tools.git] / src / bin / lttng-sessiond / ust-registry.cpp
index 323fdd6a757b82a0a6938adec9bb41cb1d520e25..e2fef3a7fc5cd7d69d29be19ced228143a39f5a5 100644 (file)
@@ -21,6 +21,7 @@
 #include <common/hashtable/utils.hpp>
 #include <common/make-unique-wrapper.hpp>
 #include <lttng/lttng.h>
+#include <lttng/trace-format-descriptor-internal.hpp>
 
 #include <inttypes.h>
 
@@ -33,11 +34,10 @@ namespace lsu = lttng::sessiond::ust;
  */
 static void ust_registry_event_destroy_rcu(struct rcu_head *head)
 {
-       struct lttng_ht_node_u64 *node = caa_container_of(head, struct lttng_ht_node_u64, head);
        DIAGNOSTIC_PUSH
        DIAGNOSTIC_IGNORE_INVALID_OFFSETOF
        lttng::sessiond::ust::registry_event *event =
-                       caa_container_of(node, lttng::sessiond::ust::registry_event, _node);
+                       lttng::utils::container_of(head, &lttng::sessiond::ust::registry_event::_head);
        DIAGNOSTIC_POP
 
        lttng::sessiond::ust::registry_event_destroy(event);
@@ -58,11 +58,11 @@ void ust_registry_channel_destroy_event(lsu::registry_channel *chan,
        ASSERT_RCU_READ_LOCKED();
 
        /* Delete the node first. */
-       iter.iter.node = &event->_node.node;
+       iter.iter.node = &event->_node;
        ret = lttng_ht_del(chan->_events, &iter);
        LTTNG_ASSERT(!ret);
 
-       call_rcu(&event->_node.head, ust_registry_event_destroy_rcu);
+       call_rcu(&event->_head, ust_registry_event_destroy_rcu);
 
        return;
 }
@@ -75,11 +75,12 @@ lsu::registry_session *ust_registry_session_per_uid_create(const lttng::sessiond
                uid_t euid,
                gid_t egid,
                uint64_t tracing_id,
-               uid_t tracing_uid)
+               uid_t tracing_uid,
+               const lttng::trace_format_descriptor& trace_format)
 {
        try {
                return new lsu::registry_session_per_uid(abi, major, minor, root_shm_path, shm_path,
-                               euid, egid, tracing_id, tracing_uid);
+                               euid, egid, tracing_id, tracing_uid, trace_format);
        } catch (const std::exception& ex) {
                ERR("Failed to create per-uid registry session: %s", ex.what());
                return nullptr;
@@ -94,11 +95,12 @@ lsu::registry_session *ust_registry_session_per_pid_create(struct ust_app *app,
                const char *shm_path,
                uid_t euid,
                gid_t egid,
-               uint64_t tracing_id)
+               uint64_t tracing_id,
+               const lttng::trace_format_descriptor& trace_format)
 {
        try {
                return new lsu::registry_session_per_pid(*app, abi, major, minor, root_shm_path,
-                               shm_path, euid, egid, tracing_id);
+                               shm_path, euid, egid, tracing_id, trace_format);
        } catch (const std::exception& ex) {
                ERR("Failed to create per-pid registry session: %s", ex.what());
                return nullptr;
This page took 0.025569 seconds and 5 git commands to generate.