+#include <limits.h>
+#include <urcu/list.h>
+#include "lttng-kernel.h"
+
+/* Default kernel channel attributes */
+#define DEFAULT_KERNEL_OVERWRITE 0
+#define DEFAULT_KERNEL_SUBBUF_SIZE 4096 /* bytes */
+#define DEFAULT_KERNEL_SUBBUF_NUM 8 /* Must always be a power of 2 */
+#define DEFAULT_KERNEL_SWITCH_TIMER 0 /* usec */
+#define DEFAULT_KERNEL_READ_TIMER 200 /* usec */
+
+/* Kernel event list */
+struct ltt_kernel_event_list {
+ struct cds_list_head head;
+};
+
+/* Channel stream list */
+struct ltt_kernel_stream_list {
+ struct cds_list_head head;
+};
+
+/* Channel list */
+struct ltt_kernel_channel_list {
+ struct cds_list_head head;
+};
+
+/* Kernel event */
+struct ltt_kernel_event {
+ int fd;
+ struct lttng_kernel_event *event;
+ struct cds_list_head list;
+};
+
+/* Kernel channel */
+struct ltt_kernel_channel {
+ int fd;
+ char *pathname;
+ unsigned int stream_count;
+ struct lttng_kernel_channel *channel;
+ struct ltt_kernel_event_list events_list;
+ struct ltt_kernel_stream_list stream_list;
+ struct cds_list_head list;
+};
+
+/* Metadata */
+struct ltt_kernel_metadata {
+ int fd;
+ char *pathname;
+ struct lttng_kernel_channel *conf;
+};
+
+/* Channel stream */
+struct ltt_kernel_stream {
+ int fd;
+ char *pathname;
+ int state;