X-Git-Url: https://git.lttng.org/?a=blobdiff_plain;f=src%2Fbin%2Flttng-sessiond%2Fust-registry-event.hpp;fp=src%2Fbin%2Flttng-sessiond%2Fust-registry-event.hpp;h=08b18a5c7504da8cfa5c3efd10ac021f64a1d35f;hb=d7bfb9b0fa35679d3e728b9165699d9faf905539;hp=0000000000000000000000000000000000000000;hpb=0220be14254fac4f7af642fd6630282b29776a70;p=lttng-tools.git diff --git a/src/bin/lttng-sessiond/ust-registry-event.hpp b/src/bin/lttng-sessiond/ust-registry-event.hpp new file mode 100644 index 000000000..08b18a5c7 --- /dev/null +++ b/src/bin/lttng-sessiond/ust-registry-event.hpp @@ -0,0 +1,78 @@ +/* + * Copyright (C) 2022 Jérémie Galarneau + * + * SPDX-License-Identifier: GPL-2.0-only + * + */ + +#ifndef LTTNG_UST_REGISTRY_EVENT_H +#define LTTNG_UST_REGISTRY_EVENT_H + +#include "event-class.hpp" +#include "field.hpp" + +#include +#include +#include + +#include + +namespace lttng { +namespace sessiond { +namespace ust { + +/* + * Event registered from a UST tracer sent to the session daemon. This is + * indexed and matched by . + */ +class registry_event : public lttng::sessiond::trace::event_class { +public: + registry_event(unsigned int id, + unsigned int stream_class_id, + int session_objd, + int channel_objd, + std::string name, + std::string signature, + std::vector fields, + int loglevel_value, + nonstd::optional model_emf_uri); + virtual ~registry_event() = default; + + /* Both objd are set by the tracer. */ + const int session_objd; + const int channel_objd; + const std::string signature; + + /* + * Flag for this channel if the metadata was dumped once during + * registration. + */ + bool _metadata_dumped; + + /* + * Node in the ust-registry hash table. The event name is used to + * initialize the node and the event_name/signature for the match function. + */ + struct lttng_ht_node_u64 _node; +}; + +void registry_event_destroy(registry_event *event); + +} /* namespace ust */ +} /* namespace sessiond */ +} /* namespace lttng */ + +template <> +struct fmt::formatter : fmt::formatter { + template + typename FormatCtx::iterator format( + const lttng::sessiond::ust::registry_event& event, FormatCtx& ctx) + { + return fmt::format_to(ctx.out(), + "{{ name = `{}`, signature = `{}`, id = {}, session objd = {}, channel objd = {} }}", + event.name, event.signature, event.id, event.session_objd, + event.channel_objd); + } +}; + +#endif /* LTTNG_UST_REGISTRY_EVENT_H */