X-Git-Url: http://git.lttng.org./?a=blobdiff_plain;f=src%2Fbin%2Flttng-sessiond%2Ftrace-ust.c;h=999f0dfc21e75f4e988476be894adcff3e33f4bc;hb=7756a65dc449aad4ab12e2fbc319c4cebeeaf9b3;hp=ac980fd45fc6673b1008b4887255e3c9a14e339e;hpb=3a4009667b330f62fc4d6100ead0bcfd5f5526d6;p=lttng-tools.git diff --git a/src/bin/lttng-sessiond/trace-ust.c b/src/bin/lttng-sessiond/trace-ust.c index ac980fd45..999f0dfc2 100644 --- a/src/bin/lttng-sessiond/trace-ust.c +++ b/src/bin/lttng-sessiond/trace-ust.c @@ -202,6 +202,9 @@ error: /* * Lookup an agent in the session agents hash table by domain type and return * the object if found else NULL. + * + * RCU read side lock must be acquired before calling and only released + * once the agent is no longer in scope or being used. */ struct agent *trace_ust_find_agent(struct ltt_ust_session *session, enum lttng_domain_type domain_type) @@ -362,6 +365,7 @@ error: /* * Allocate and initialize a ust event. Set name and event type. + * We own filter_expression, filter, and exclusion. * * Return pointer to structure or NULL. */ @@ -442,6 +446,9 @@ struct ltt_ust_event *trace_ust_create_event(struct lttng_event *ev, error_free_event: free(lue); error: + free(filter_expression); + free(filter); + free(exclusion); return NULL; } @@ -754,10 +761,12 @@ void trace_ust_destroy_session(struct ltt_ust_session *session) /* Cleaning up UST domain */ destroy_domain_global(&session->domain_global); + rcu_read_lock(); cds_lfht_for_each_entry(session->agents->ht, &iter.iter, agt, node.node) { lttng_ht_del(session->agents, &iter); agent_destroy(agt); } + rcu_read_unlock(); /* Cleanup UID buffer registry object(s). */ cds_list_for_each_entry_safe(reg, sreg, &session->buffer_reg_uid_list,