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);
}
*/
if (channel->uchan) {
lttng_ustconsumer_del_channel(channel);
+ lttng_ustconsumer_free_channel(channel);
}
free(channel);
}
if (chan->switch_timer_enabled == 1) {
consumer_timer_switch_stop(chan);
}
- consumer_metadata_cache_destroy(chan);
- ustctl_destroy_channel(chan->uchan);
for (i = 0; i < chan->nr_stream_fds; i++) {
int ret;
}
}
}
- free(chan->stream_fds);
/* Try to rmdir all directories under shm_path root. */
if (chan->root_shm_path[0]) {
(void) run_as_recursive_rmdir(chan->root_shm_path,
}
}
+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);
+ free(chan->stream_fds);
+}
+
void lttng_ustconsumer_del_stream(struct lttng_consumer_stream *stream)
{
assert(stream);
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);
{
}
+static inline
+void lttng_ustconsumer_free_channel(struct lttng_consumer_channel *chan)
+{
+}
+
static inline
int lttng_ustconsumer_add_stream(struct lttng_consumer_stream *stream)
{