X-Git-Url: http://git.efficios.com/?a=blobdiff_plain;f=src%2Fbin%2Flttng-sessiond%2Ftrace-ust.c;h=9ec6e43b0baa8bae6c8d4602cd94743148787977;hb=4a180d9f41bd4d369745c6e6f5066a6c281cca1c;hp=9bc0b73d05cdb80363e159d76d703b102bd88141;hpb=6addfa379ee608b20cfe5e15d135bcb6a9724e90;p=lttng-tools.git diff --git a/src/bin/lttng-sessiond/trace-ust.c b/src/bin/lttng-sessiond/trace-ust.c index 9bc0b73d0..9ec6e43b0 100644 --- a/src/bin/lttng-sessiond/trace-ust.c +++ b/src/bin/lttng-sessiond/trace-ust.c @@ -788,7 +788,8 @@ int trace_ust_untrack_pid(struct ltt_ust_session *session, int pid) struct ust_app *app; if (!session->pid_tracker.ht) { - retval = LTTNG_ERR_INVALID; + /* No PID being tracked. */ + retval = LTTNG_ERR_PID_NOT_TRACKED; goto end; } /* Remove PID from tracker */ @@ -952,11 +953,6 @@ static void _trace_ust_destroy_channel(struct ltt_ust_channel *channel) DBG2("Trace destroy UST channel %s", channel->name); - /* Destroying all events of the channel */ - destroy_events(channel->events); - /* Destroying all context of the channel */ - destroy_contexts(channel->ctx); - free(channel); } @@ -975,6 +971,11 @@ static void destroy_channel_rcu(struct rcu_head *head) void trace_ust_destroy_channel(struct ltt_ust_channel *channel) { + /* Destroying all events of the channel */ + destroy_events(channel->events); + /* Destroying all context of the channel */ + destroy_contexts(channel->ctx); + call_rcu(&channel->node.head, destroy_channel_rcu); } @@ -1000,18 +1001,18 @@ void trace_ust_delete_channel(struct lttng_ht *ht, */ static void destroy_channels(struct lttng_ht *channels) { - int ret; struct lttng_ht_node_str *node; struct lttng_ht_iter iter; assert(channels); rcu_read_lock(); - cds_lfht_for_each_entry(channels->ht, &iter.iter, node, node) { - ret = lttng_ht_del(channels, &iter); - assert(!ret); - call_rcu(&node->head, destroy_channel_rcu); + struct ltt_ust_channel *chan = + caa_container_of(node, struct ltt_ust_channel, node); + + trace_ust_delete_channel(channels, chan); + trace_ust_destroy_channel(chan); } rcu_read_unlock();