summary |
shortlog |
log |
commit | commitdiff |
tree
raw |
patch |
inline | side by side (from parent 1:
3b42439)
[ Backport from master branch
commit
b83e03c499 "Fix: free metadata cache after grace period in consumer" ]
Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
struct lttng_consumer_channel *channel =
caa_container_of(node, struct lttng_consumer_channel, node);
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();
+ }
*/
if (channel->uchan) {
lttng_ustconsumer_del_channel(channel);
*/
if (channel->uchan) {
lttng_ustconsumer_del_channel(channel);
+ lttng_ustconsumer_free_channel(channel);
if (chan->switch_timer_enabled == 1) {
consumer_timer_switch_stop(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);
}
consumer_metadata_cache_destroy(chan);
ustctl_destroy_channel(chan->uchan);
}
extern int lttng_ustconsumer_allocate_channel(struct lttng_consumer_channel *chan);
extern void lttng_ustconsumer_del_channel(struct lttng_consumer_channel *chan);
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);
extern int lttng_ustconsumer_add_stream(struct lttng_consumer_stream *stream);
extern void lttng_ustconsumer_del_stream(struct lttng_consumer_stream *stream);
+static inline
+void lttng_ustconsumer_free_channel(struct lttng_consumer_channel *chan)
+{
+}
+
static inline
int lttng_ustconsumer_add_stream(struct lttng_consumer_stream *stream)
{
static inline
int lttng_ustconsumer_add_stream(struct lttng_consumer_stream *stream)
{