2 * Copyright (C) 2022 Jérémie Galarneau <jeremie.galarneau@efficios.com>
4 * SPDX-License-Identifier: GPL-2.0-only
8 #ifndef LTTNG_UST_REGISTRY_EVENT_H
9 #define LTTNG_UST_REGISTRY_EVENT_H
11 #include "event-class.hpp"
14 #include <common/format.hpp>
15 #include <common/hashtable/hashtable.hpp>
17 #include <vendor/optional.hpp>
26 * Event registered from a UST tracer sent to the session daemon. This is
27 * indexed and matched by <event_name/signature>.
29 class registry_event : public lttng::sessiond::trace::event_class {
31 registry_event(unsigned int id,
32 unsigned int stream_class_id,
36 std::string signature,
37 std::vector<lttng::sessiond::trace::field::cuptr> fields,
39 nonstd::optional<std::string> model_emf_uri);
40 ~registry_event() override = default;
41 registry_event(const registry_event&) = delete;
42 registry_event(registry_event&&) = delete;
43 registry_event& operator=(registry_event&&) = delete;
44 registry_event& operator=(const registry_event&) = delete;
46 /* Both objd are set by the tracer. */
47 const int session_objd;
48 const int channel_objd;
49 const std::string signature;
52 * Flag for this channel if the metadata was dumped once during
55 bool _metadata_dumped;
58 * Node in the ust-registry hash table. The event name is used to
59 * initialize the node and the event_name/signature for the match function.
61 struct cds_lfht_node _node;
62 struct rcu_head _head;
65 void registry_event_destroy(registry_event *event);
68 } /* namespace sessiond */
69 } /* namespace lttng */
72 * Due to a bug in g++ < 7.1, this specialization must be enclosed in the fmt namespace,
73 * see https://gcc.gnu.org/bugzilla/show_bug.cgi?id=56480.
77 struct formatter<lttng::sessiond::ust::registry_event> : formatter<std::string> {
78 template <typename FormatContextType>
79 typename FormatContextType::iterator
80 format(const lttng::sessiond::ust::registry_event& event, FormatContextType& ctx)
84 "{{ name = `{}`, signature = `{}`, id = {}, session objd = {}, channel objd = {} }}",
94 #endif /* LTTNG_UST_REGISTRY_EVENT_H */