+ return NULL;
+}
+
+void trace_destroy_kernel_stream(struct ltt_kernel_stream *stream)
+{
+ DBG("[trace] Closing stream fd %d", stream->fd);
+ /* Close kernel fd */
+ close(stream->fd);
+ free(stream->pathname);
+
+ /* Remove from stream list */
+ cds_list_del(&stream->list);
+ free(stream);
+}
+
+void trace_destroy_kernel_event(struct ltt_kernel_event *event)
+{
+ DBG("[trace] Closing event fd %d", event->fd);
+ /* Close kernel fd */
+ close(event->fd);
+ /* Free attributes */
+ free(event->event);
+
+ /* Remove from event list */
+ cds_list_del(&event->list);
+ free(event);
+}
+
+void trace_destroy_kernel_channel(struct ltt_kernel_channel *channel)
+{
+ struct ltt_kernel_stream *stream;
+ struct ltt_kernel_event *event;
+
+ DBG("[trace] Closing channel fd %d", channel->fd);
+ /* Close kernel fd */
+ close(channel->fd);
+ free(channel->pathname);
+ /* Free attributes structure */
+ free(channel->channel);
+
+ /* For each stream in the channel list */
+ cds_list_for_each_entry(stream, &channel->stream_list.head, list) {
+ trace_destroy_kernel_stream(stream);
+ }
+
+ /* For each event in the channel list */
+ cds_list_for_each_entry(event, &channel->events_list.head, list) {
+ trace_destroy_kernel_event(event);
+ }
+
+ /* Remove from channel list */
+ cds_list_del(&channel->list);
+ free(channel);