Fix: free ust channel object after grace period in consumer
A message that is not in the archive (sent off-list or not yet received): [email protected]
Merged in stable-2.6. Thanks!
Jérémie
Quoted 85 lines · Mathieu Desnoyers
[ Backport from master branch
commitb83e03c499"Fix: free metadata cache after grace period in consumer" ]Signed-off-by Mathieu Desnoyers <[email protected]>--- src/common/consumer.c | 11 +++++++++++ src/common/ust-consumer/ust-consumer.c | 8 ++++++++ src/common/ust-consumer/ust-consumer.h | 6 ++++++ 3 files changed, 25 insertions(+)src/common/consumer.c +11
-0@@ -285,6 +285,17 @@ static void free_channel_rcu(struct rcu_head *head)struct lttng_consumer_channel *channel = caa_container_of(node, struct lttng_consumer_channel, node); +switch (consumer_data.type) { +case LTTNG_CONSUMER_KERNEL : +break ; +case LTTNG_CONSUMER32_UST : +case LTTNG_CONSUMER64_UST : +lttng_ustconsumer_free_channel (channel); +break ; +default : +ERR ("Unknown consumer_data type" ); +abort (); + }free (channel); }src/common/ust-consumer/ust-consumer.c +8
-0@@ -79,6 +79,7 @@ static void destroy_channel(struct lttng_consumer_channel *channel)*/ if (channel->uchan) {lttng_ustconsumer_del_channel (channel); +lttng_ustconsumer_free_channel (channel); }free (channel); }@@ -1687,6 +1688,13 @@ void lttng_ustconsumer_del_channel(struct lttng_consumer_channel *chan)if (chan->switch_timer_enabled ==1 ) {consumer_timer_switch_stop (chan); } +} + +void lttng_ustconsumer_free_channel (struct lttng_consumer_channel *chan) +{ +assert (chan); +assert (chan->uchan); +consumer_metadata_cache_destroy (chan);ustctl_destroy_channel (chan->uchan); }src/common/ust-consumer/ust-consumer.h +6
-1@@ -38,6 +38,7 @@ int lttng_ustconsumer_recv_cmd(struct lttng_consumer_local_data *ctx,extern int lttng_ustconsumer_allocate_channel (struct lttng_consumer_channel *chan);extern void lttng_ustconsumer_del_channel (struct lttng_consumer_channel *chan); +extern void lttng_ustconsumer_free_channel (struct lttng_consumer_channel *chan);extern int lttng_ustconsumer_add_stream (struct lttng_consumer_stream *stream);extern void lttng_ustconsumer_del_stream (struct lttng_consumer_stream *stream);@@ -120,6 +121,11 @@ void lttng_ustconsumer_del_channel(struct lttng_consumer_channel *chan) }static inline +void lttng_ustconsumer_free_channel (struct lttng_consumer_channel *chan) +{ +} + +static inline int lttng_ustconsumer_add_stream (struct lttng_consumer_stream *stream) {return -ENOSYS ; --2.1.4
Signature · 7 lines
Jérémie Galarneau EfficiOS Inc. http://www.efficios.com _______________________________________________ lttng-dev mailing list [email protected] https://lists.lttng.org/cgi-bin/mailman/listinfo/lttng-dev