Clean-up: sessiond: rename public accessors
authorJérémie Galarneau <jeremie.galarneau@efficios.com>
Thu, 12 Jan 2023 22:09:05 +0000 (17:09 -0500)
committerJérémie Galarneau <jeremie.galarneau@efficios.com>
Thu, 12 Jan 2023 22:14:38 +0000 (17:14 -0500)
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
Change-Id: Icf87c518d632a176c7786a48b3921e0638545d9c

16 files changed:
src/bin/lttng-sessiond/ctf2-trace-class-visitor.cpp
src/bin/lttng-sessiond/stream-class.cpp
src/bin/lttng-sessiond/stream-class.hpp
src/bin/lttng-sessiond/trace-class.hpp
src/bin/lttng-sessiond/tsdl-trace-class-visitor.cpp
src/bin/lttng-sessiond/ust-app.cpp
src/bin/lttng-sessiond/ust-consumer.cpp
src/bin/lttng-sessiond/ust-field-convert.cpp
src/bin/lttng-sessiond/ust-registry-channel.cpp
src/bin/lttng-sessiond/ust-registry-channel.hpp
src/bin/lttng-sessiond/ust-registry-session-pid.cpp
src/bin/lttng-sessiond/ust-registry-session-pid.hpp
src/bin/lttng-sessiond/ust-registry-session-uid.cpp
src/bin/lttng-sessiond/ust-registry-session-uid.hpp
src/bin/lttng-sessiond/ust-registry-session.cpp
src/bin/lttng-sessiond/ust-registry-session.hpp

index f2f32c1686186b7e8dc7693e6605967ae3d385f1..b7ab303a17294198d89662bca7eb4f7b4affe454 100644 (file)
@@ -390,7 +390,7 @@ void lsc::trace_class_visitor::visit(const lst::trace_class& trace_class)
        trace_class.accept(environment_visitor);
        trace_class_fragment["environment"] = environment_visitor.move_fragment();
 
-       const auto packet_header = trace_class.get_packet_header();
+       const auto packet_header = trace_class.packet_header();
        if (packet_header) {
                ::ctf2::field_visitor field_visitor;
 
@@ -432,7 +432,7 @@ void lsc::trace_class_visitor::visit(const lst::stream_class& stream_class)
                                *stream_class.default_clock_class_name;
        }
 
-       const auto packet_context = stream_class.get_packet_context();
+       const auto packet_context = stream_class.packet_context();
        if (packet_context) {
                ::ctf2::field_visitor visitor;
 
@@ -440,7 +440,7 @@ void lsc::trace_class_visitor::visit(const lst::stream_class& stream_class)
                stream_class_fragment["packet-context-field-class"] = visitor.move_fragment();
        }
 
-       const auto event_header = stream_class.get_event_header();
+       const auto event_header = stream_class.event_header();
        if (event_header) {
                ::ctf2::field_visitor visitor;
 
@@ -449,7 +449,7 @@ void lsc::trace_class_visitor::visit(const lst::stream_class& stream_class)
                                visitor.move_fragment();
        }
 
-       const auto event_context = stream_class.get_event_context();
+       const auto event_context = stream_class.event_context();
        if (event_context) {
                ::ctf2::field_visitor visitor;
 
index 883a65e4122e2c460218eae294e8a4ce645f449c..b56f0e2a02af77d89db85f1426f809ec557df966 100644 (file)
@@ -25,17 +25,17 @@ void lst::stream_class::accept(trace_class_visitor& visitor) const
        _accept_on_event_classes(visitor);
 }
 
-const lttng::sessiond::trace::type *lst::stream_class::get_packet_context() const
+const lttng::sessiond::trace::type *lst::stream_class::packet_context() const
 {
        return _packet_context.get();
 }
 
-const lttng::sessiond::trace::type *lst::stream_class::get_event_header() const
+const lttng::sessiond::trace::type *lst::stream_class::event_header() const
 {
        return _event_header.get();
 }
 
-const lttng::sessiond::trace::type *lst::stream_class::get_event_context() const
+const lttng::sessiond::trace::type *lst::stream_class::event_context() const
 {
        return _event_context.get();
 }
index 78f0c83cb8ee46c7a2f37cf7d8457954fe928006..754b723fa5eec49f316089ab8d0c4c13288f6045 100644 (file)
@@ -31,9 +31,9 @@ public:
        void accept(trace_class_visitor& visitor) const;
        virtual ~stream_class() = default;
 
-       virtual const type* get_packet_context() const;
-       virtual const type* get_event_header() const;
-       virtual const type* get_event_context() const;
+       virtual const type* packet_context() const;
+       virtual const type* event_header() const;
+       virtual const type* event_context() const;
 
        const unsigned int id;
        /*
index ed72f3f579e9cdaabc34a91ddcade7ec5ac60c2d..72ba7559dde480a8b7e15a3e66f38746a75e1708 100644 (file)
@@ -55,7 +55,7 @@ public:
         */
        virtual void accept(trace_class_visitor& trace_class_visitor) const;
        virtual void accept(trace_class_environment_visitor& environment_visitor) const = 0;
-       virtual const lttng::sessiond::trace::type *get_packet_header() const noexcept = 0;
+       virtual const lttng::sessiond::trace::type *packet_header() const noexcept = 0;
 
        const struct abi abi;
        const lttng_uuid uuid;
index 60e1f2f6a110831b8cdf877d3cc0df7341bc9275..dce1af96c8f6045622c34372fde818116576b3b6 100644 (file)
@@ -828,7 +828,7 @@ void tsdl::trace_class_visitor::visit(const lttng::sessiond::trace::trace_class&
 
        tsdl_field_visitor packet_header_visitor{trace_class.abi, 1, _sanitized_types_overrides};
 
-       trace_class.get_packet_header()->accept(packet_header_visitor);
+       trace_class.packet_header()->accept(packet_header_visitor);
 
        /* Declare type aliases, trace class, and packet header. */
        auto trace_class_tsdl = fmt::format(
@@ -903,7 +903,7 @@ void tsdl::trace_class_visitor::visit(const lttng::sessiond::trace::stream_class
                                return _lookup_field_type(location);
                        });
 
-       const auto *event_header = stream_class.get_event_header();
+       const auto *event_header = stream_class.event_header();
        if (event_header) {
                tsdl_field_visitor event_header_visitor{_trace_abi, 1, _sanitized_types_overrides,
                                stream_class.default_clock_class_name};
@@ -914,7 +914,7 @@ void tsdl::trace_class_visitor::visit(const lttng::sessiond::trace::stream_class
                                event_header_visitor.move_description());
        }
 
-       const auto *packet_context = stream_class.get_packet_context();
+       const auto *packet_context = stream_class.packet_context();
        if (packet_context) {
                tsdl_field_visitor packet_context_visitor{_trace_abi, 1, _sanitized_types_overrides,
                                stream_class.default_clock_class_name};
@@ -925,7 +925,7 @@ void tsdl::trace_class_visitor::visit(const lttng::sessiond::trace::stream_class
                                packet_context_visitor.move_description());
        }
 
-       const auto *event_context = stream_class.get_event_context();
+       const auto *event_context = stream_class.event_context();
        if (event_context) {
                tsdl_field_visitor event_context_visitor{_trace_abi, 1, _sanitized_types_overrides};
 
@@ -1094,16 +1094,16 @@ const lttng::sessiond::trace::type& lttng::sessiond::tsdl::trace_class_visitor::
        switch (location.root_) {
        case lst::field_location::root::PACKET_HEADER:
                return lookup_type_from_root_type(
-                               *_current_trace_class->get_packet_header(), location);
+                               *_current_trace_class->packet_header(), location);
        case lst::field_location::root::PACKET_CONTEXT:
                return lookup_type_from_root_type(
-                               *_current_stream_class->get_packet_context(), location);
+                               *_current_stream_class->packet_context(), location);
        case lst::field_location::root::EVENT_RECORD_HEADER:
                return lookup_type_from_root_type(
-                               *_current_stream_class->get_event_header(), location);
+                               *_current_stream_class->event_header(), location);
        case lst::field_location::root::EVENT_RECORD_COMMON_CONTEXT:
                return lookup_type_from_root_type(
-                               *_current_stream_class->get_event_context(), location);
+                               *_current_stream_class->event_context(), location);
        case lst::field_location::root::EVENT_RECORD_PAYLOAD:
                return lookup_type_from_root_type(
                                *_current_event_class->payload, location);
index 11d604ea9a463e7c32126b5189e46707e74f7ce1..ec8aa1c39ca7e4dd270c2d828e248a8f6b1dfd73 100644 (file)
@@ -3454,7 +3454,7 @@ static int create_channel_per_uid(struct ust_app *app,
 
        {
                auto locked_registry = reg_uid->registry->reg.ust->lock();
-               auto& ust_reg_chan = locked_registry->get_channel(ua_chan->tracing_channel_id);
+               auto& ust_reg_chan = locked_registry->channel(ua_chan->tracing_channel_id);
 
                ust_reg_chan._consumer_key = ua_chan->key;
        }
@@ -3554,7 +3554,7 @@ static int create_channel_per_pid(struct ust_app *app,
        {
                auto locked_registry = registry->lock();
 
-               auto& ust_reg_chan = locked_registry->get_channel(chan_reg_key);
+               auto& ust_reg_chan = locked_registry->channel(chan_reg_key);
                ust_reg_chan._consumer_key = ua_chan->key;
        }
 
@@ -6408,7 +6408,7 @@ static int handle_app_register_channel_notification(int sock,
                chan_reg_key = ua_chan->key;
        }
 
-       auto& ust_reg_chan = locked_registry_session->get_channel(chan_reg_key);
+       auto& ust_reg_chan = locked_registry_session->channel(chan_reg_key);
 
        /* Channel id is set during the object creation. */
        chan_id = ust_reg_chan.id;
@@ -6439,14 +6439,14 @@ static int handle_app_register_channel_notification(int sock,
                                                        0, std::move(app_context_fields)) :
                                        nullptr;
 
-                       ust_reg_chan.set_event_context(std::move(event_context));
+                       ust_reg_chan.event_context(std::move(event_context));
                } else {
                        /*
                         * Validate that the context fields match between
                         * registry and newcoming application.
                         */
                        bool context_fields_match;
-                       const auto *previous_event_context = ust_reg_chan.get_event_context();
+                       const auto *previous_event_context = ust_reg_chan.event_context();
 
                        if (!previous_event_context) {
                                context_fields_match = app_context_fields.size() == 0;
@@ -6559,7 +6559,7 @@ static int add_event_ust_registry(int sock, int sobjd, int cobjd, const char *na
                         * These three variables MUST NOT be read/write after this.
                         */
                        try {
-                               auto& channel = locked_registry->get_channel(chan_reg_key);
+                               auto& channel = locked_registry->channel(chan_reg_key);
 
                                /* event_id is set on success. */
                                channel.add_event(sobjd, cobjd, name, signature.get(),
index df4689920eb0b90ffff3eb45c368b42be8727c28..ef61cfc7e0f00271e5babb82b2c0f7e19118d0de 100644 (file)
@@ -108,7 +108,7 @@ static int ask_channel_creation(struct ust_app_session *ua_sess,
        } else {
                {
                        auto locked_registry = registry->lock();
-                       auto& ust_reg_chan = registry->get_channel(chan_reg_key);
+                       auto& ust_reg_chan = registry->channel(chan_reg_key);
 
                        chan_id = ust_reg_chan.id;
                }
index 21fd3e0c968bc2c5018adf3762339a1fa4399852..e7e5d392452bc5c383f2d8fc6d8d2627fd50069e 100644 (file)
@@ -843,7 +843,7 @@ std::vector<lst::field::cuptr> create_fields_from_ust_ctl_fields(
        const auto trace_native_byte_order = session.abi.byte_order;
        const session_attributes session_attributes{
                        [&session](const char *enum_name, uint64_t enum_id) {
-                               return session.get_enumeration(enum_name, enum_id);
+                               return session.enumeration(enum_name, enum_id);
                        },
                        trace_native_byte_order};
        /* Location of field being created. */
index de14432fa65cd4fc442247853384bb03dd6d3fc1..f8295df4513806d60fb66a7b0903b47a49626894 100644 (file)
@@ -404,13 +404,13 @@ lsu::registry_channel::~registry_channel()
        lttng_ht_destroy(_events);
 }
 
-const lttng::sessiond::trace::type* lsu::registry_channel::get_event_context() const
+const lttng::sessiond::trace::type* lsu::registry_channel::event_context() const
 {
        LTTNG_ASSERT(_is_registered);
-       return lst::stream_class::get_event_context();
+       return lst::stream_class::event_context();
 }
 
-void lsu::registry_channel::set_event_context(lttng::sessiond::trace::type::cuptr context)
+void lsu::registry_channel::event_context(lttng::sessiond::trace::type::cuptr context)
 {
        /* Must only be set once, on the first channel registration provided by an application. */
        LTTNG_ASSERT(!_event_context);
index 5a99c1bdbbee3bd4e1bd6a242e73bfe00ab09a1b..a32b8088eed172ed7443f7d37fffb61d661080db 100644 (file)
@@ -48,8 +48,8 @@ public:
                        uint32_t& out_event_id);
        virtual ~registry_channel();
 
-       virtual const lttng::sessiond::trace::type *get_event_context() const override final;
-       void set_event_context(lttng::sessiond::trace::type::cuptr context);
+       virtual const lttng::sessiond::trace::type *event_context() const override final;
+       void event_context(lttng::sessiond::trace::type::cuptr context);
 
        /* Channel was registered to at least one application. */
        bool is_registered() const;
index db7bf58ce4e8d07676e3371fcca9b53d7fac10a2..9060e80bab95e8a0f8491bc070f1d0842be9298d 100644 (file)
@@ -32,7 +32,7 @@ lsu::registry_session_per_pid::registry_session_per_pid(const struct ust_app& ap
        _generate_metadata();
 }
 
-lttng_buffer_type lsu::registry_session_per_pid::get_buffering_scheme() const noexcept
+lttng_buffer_type lsu::registry_session_per_pid::buffering_scheme() const noexcept
 {
        return LTTNG_BUFFER_PER_PID;
 }
index 4fd541d584848dd02992f2d7a87884f4dd7a1009..4c414a1ec8e6cb0ea827a1f40e4737f039969f54 100644 (file)
@@ -33,7 +33,7 @@ public:
                        gid_t egid,
                        uint64_t tracing_id);
 
-       virtual lttng_buffer_type get_buffering_scheme() const noexcept override final;
+       virtual lttng_buffer_type buffering_scheme() const noexcept override final;
        virtual void accept(lttng::sessiond::trace::trace_class_environment_visitor&
                                        environment_visitor) const override final;
 
index 77c46fd7c45dab499722a3044c4cc5fe51275692..bfa50f3913d4adf1ea5f74e767a97c779d19d672 100644 (file)
@@ -27,7 +27,7 @@ lsu::registry_session_per_uid::registry_session_per_uid(
        _generate_metadata();
 }
 
-lttng_buffer_type lsu::registry_session_per_uid::get_buffering_scheme() const noexcept
+lttng_buffer_type lsu::registry_session_per_uid::buffering_scheme() const noexcept
 {
        return LTTNG_BUFFER_PER_UID;
 }
index 10da75818fd718e750d86e9dfdfb1e308b1c46b1..01f55fc2ebd83e19134efd07a6a63509b5fb8eda 100644 (file)
@@ -31,7 +31,7 @@ public:
                        uint64_t tracing_id,
                        uid_t tracing_uid);
 
-       virtual lttng_buffer_type get_buffering_scheme() const noexcept override final;
+       virtual lttng_buffer_type buffering_scheme() const noexcept override final;
        virtual void accept(lttng::sessiond::trace::trace_class_environment_visitor&
                                        environment_visitor) const override final;
 
index e1089bd58678eaf07e07a416b0ffbe4373cd5513..a8199bb6253ced527bf857cdeee12ab28262ac96 100644 (file)
@@ -321,7 +321,7 @@ lst::type::cuptr lsu::registry_session::_create_packet_header() const
        return lttng::make_unique<lst::structure_type>(0, std::move(packet_header_fields));
 }
 
-const lst::type *lsu::registry_session::get_packet_header() const noexcept
+const lst::type *lsu::registry_session::packet_header() const noexcept
 {
        return _packet_header.get();
 }
@@ -457,7 +457,7 @@ void lsu::registry_session::add_channel(uint64_t key)
        lttng_ht_add_unique_u64(_channels.get(), &chan->_node);
 }
 
-lttng::sessiond::ust::registry_channel& lsu::registry_session::get_channel(
+lttng::sessiond::ust::registry_channel& lsu::registry_session::channel(
                uint64_t channel_key) const
 {
        lttng::urcu::read_lock_guard read_lock_guard;
@@ -487,12 +487,12 @@ void lsu::registry_session::remove_channel(uint64_t channel_key, bool notify)
        lttng::urcu::read_lock_guard read_lock_guard;
 
        ASSERT_LOCKED(_lock);
-       auto& channel = get_channel(channel_key);
+       auto& channel_to_remove = channel(channel_key);
 
-       iter.iter.node = &channel._node.node;
+       iter.iter.node = &channel_to_remove._node.node;
        ret = lttng_ht_del(_channels.get(), &iter);
        LTTNG_ASSERT(!ret);
-       destroy_channel(&channel, notify);
+       destroy_channel(&channel_to_remove, notify);
 }
 
 void lsu::registry_session::accept(
@@ -505,7 +505,7 @@ void lsu::registry_session::accept(
        visitor.visit(lst::environment_field<int64_t>("tracer_major", _app_tracer_version.major));
        visitor.visit(lst::environment_field<int64_t>("tracer_minor", _app_tracer_version.minor));
        visitor.visit(lst::environment_field<const char *>("tracer_buffering_scheme",
-                       get_buffering_scheme() == LTTNG_BUFFER_PER_PID ? "pid" : "uid"));
+                       buffering_scheme() == LTTNG_BUFFER_PER_PID ? "pid" : "uid"));
        visitor.visit(lst::environment_field<int64_t>("architecture_bit_width", abi.bits_per_long));
 
        {
@@ -671,7 +671,7 @@ void lsu::registry_session::regenerate_metadata()
  * disposes of the object.
  */
 lsu::registry_enum::const_rcu_protected_reference
-lsu::registry_session::get_enumeration(const char *enum_name, uint64_t enum_id) const
+lsu::registry_session::enumeration(const char *enum_name, uint64_t enum_id) const
 {
        lsu::registry_enum *reg_enum = NULL;
        struct lttng_ht_node_str *node;
index 5f59e6160612521a6f7dae4bf0c8d9b7d0527b87..3ef3d2a4f47daa97a292981dbc95ff60fa71f434 100644 (file)
@@ -41,13 +41,13 @@ public:
                                        details::locked_registry_session_release>::
                                        deleter>;
 
-       virtual lttng_buffer_type get_buffering_scheme() const noexcept = 0;
+       virtual lttng_buffer_type buffering_scheme() const noexcept = 0;
        locked_ptr lock() noexcept;
 
        void add_channel(uint64_t channel_key);
 
        /* A channel is protected by its parent registry session's lock. */
-       lttng::sessiond::ust::registry_channel& get_channel(uint64_t channel_key) const;
+       lttng::sessiond::ust::registry_channel& channel(uint64_t channel_key) const;
 
        void remove_channel(uint64_t channel_key, bool notify);
 
@@ -56,13 +56,13 @@ public:
                        struct lttng_ust_ctl_enum_entry *raw_entries,
                        size_t nr_entries,
                        uint64_t *enum_id);
-       registry_enum::const_rcu_protected_reference get_enumeration(
+       registry_enum::const_rcu_protected_reference enumeration(
                        const char *enum_name, uint64_t enum_id) const;
 
        void regenerate_metadata();
        virtual ~registry_session();
 
-       virtual const lttng::sessiond::trace::type *get_packet_header() const noexcept override;
+       virtual const lttng::sessiond::trace::type *packet_header() const noexcept override;
 
        /*
         * With multiple writers and readers, use this lock to access
This page took 0.037671 seconds and 4 git commands to generate.