+
+ /* Generated metadata, not null-terminated. */
+ char *_metadata = nullptr; /* */
+ size_t _metadata_len = 0;
+ /* Length of bytes sent to the consumer. */
+ size_t _metadata_len_sent = 0;
+ /* Current version of the metadata. */
+ uint64_t _metadata_version = 0;
+
+ /*
+ * Unique key to identify the metadata on the consumer side.
+ */
+ uint64_t _metadata_key = 0;
+ /*
+ * Indicates if the metadata is closed on the consumer side. This is to
+ * avoid double close of metadata when an application unregisters AND
+ * deletes its sessions.
+ */
+ bool _metadata_closed = false;
+
+protected:
+ /* Prevent instanciation of this base class. */
+ registry_session(const struct lttng::sessiond::trace::abi& abi,
+ unsigned int app_tracer_version_major,
+ unsigned int app_tracer_version_minor,
+ const char *root_shm_path,
+ const char *shm_path,
+ uid_t euid,
+ gid_t egid,
+ uint64_t tracing_id);
+ virtual void _visit_environment(
+ lttng::sessiond::trace::trace_class_visitor& trace_class_visitor)
+ const override;
+ void _generate_metadata();
+
+private:
+ uint32_t _get_next_channel_id();
+ void _increase_metadata_size(size_t reservation_length);
+ void _append_metadata_fragment(const std::string& fragment);
+ void _reset_metadata();
+ void _destroy_enum(registry_enum *reg_enum);
+ registry_enum *_lookup_enum(const registry_enum *target_enum) const;
+
+ virtual void _accept_on_clock_classes(
+ lttng::sessiond::trace::trace_class_visitor& trace_class_visitor)
+ const override final;
+ virtual void _accept_on_stream_classes(
+ lttng::sessiond::trace::trace_class_visitor& trace_class_visitor)
+ const override final;
+