]> git.lttng.org Git - lttng-tools.git/commitdiff
Clean-up: sessiond: document ownership of agent
authorJérémie Galarneau <jeremie.galarneau@efficios.com>
Tue, 26 Nov 2024 15:44:52 +0000 (15:44 +0000)
committerJérémie Galarneau <jeremie.galarneau@efficios.com>
Tue, 26 Nov 2024 17:05:50 +0000 (17:05 +0000)
`agent` instances are lazily created at various sites and their
ownership can be confusing for both analysis tools and meat bags.

Document that the ownership of the instance is transferred by the
`agent_add` function.

Change-Id: I709d2908611bdebd88c82261d1e5d5ee3bde3a09
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
src/bin/lttng-sessiond/channel.cpp
src/bin/lttng-sessiond/cmd.cpp
src/bin/lttng-sessiond/context.cpp

index 5bc446701916c73cf4cfb2b3bfbaf83d7cd3f8ad..542ad69875b862afbb30225983b88b048090e8af 100644 (file)
@@ -477,6 +477,8 @@ enum lttng_error_code channel_ust_create(struct ltt_ust_session *usess,
                                ret_code = LTTNG_ERR_NOMEM;
                                goto error_remove_chan;
                        }
+
+                       /* Ownership of agt is transferred. */
                        agent_add(agt, usess->agents);
                }
        }
index a5bf81f8911d9f3ed878115efd91c681a9d65477..6f24d0ac59da56a489472fad8932c4114ffc820a 100644 (file)
@@ -2661,6 +2661,7 @@ static lttng_error_code _cmd_enable_event(ltt_session::locked_ref& locked_sessio
                                return LTTNG_ERR_NOMEM;
                        }
 
+                       /* Ownership of agt is transferred. */
                        agent_add(agt, usess->agents);
                }
 
@@ -4828,6 +4829,7 @@ synchronize_tracer_notifier_register(struct notification_thread_handle *notifica
                                return ret_code;
                        }
 
+                       /* Ownership of agt is transferred. */
                        agent_add(agt, the_trigger_agents_ht_by_domain);
                }
 
index 9a098841cb3aaa2e1ccf98fc69a55b87cc067d2b..6409f5c1afcddfbaeef646d6dee2ca15afc75cf8 100644 (file)
@@ -135,6 +135,8 @@ static int add_uctx_to_channel(struct ltt_ust_session *usess,
                                ret = -LTTNG_ERR_NOMEM;
                                goto error;
                        }
+
+                       /* Ownership of agt is transferred. */
                        agent_add(agt, usess->agents);
                }
                ret = agent_add_context(ctx, agt);
This page took 0.032765 seconds and 4 git commands to generate.