+/*
+ * Key used to reference a channel between the sessiond and the consumer. This
+ * is only read and updated with the session_list lock held.
+ */
+uint64_t next_kernel_channel_key;
+
+const char *module_proc_lttng = "/proc/lttng";
+
+int kernel_tracer_fd = -1;
+nonstd::optional<enum lttng_kernel_tracer_status> kernel_tracer_status = nonstd::nullopt;
+int kernel_tracer_event_notifier_group_fd = -1;
+int kernel_tracer_event_notifier_group_notification_fd = -1;
+struct cds_lfht *kernel_token_to_event_notifier_rule_ht;
+
+const char *kernel_tracer_status_to_str(lttng_kernel_tracer_status status)
+{
+ switch (status) {
+ case LTTNG_KERNEL_TRACER_STATUS_INITIALIZED:
+ return "LTTNG_KERNEL_TRACER_STATUS_INITIALIZED";
+ case LTTNG_KERNEL_TRACER_STATUS_ERR_UNKNOWN:
+ return "LTTNG_KERNEL_TRACER_STATUS_ERR_UNKNOWN";
+ case LTTNG_KERNEL_TRACER_STATUS_ERR_NEED_ROOT:
+ return "LTTNG_KERNEL_TRACER_STATUS_ERR_NEED_ROOT";
+ case LTTNG_KERNEL_TRACER_STATUS_ERR_NOTIFIER:
+ return "LTTNG_KERNEL_TRACER_STATUS_ERR_NOTIFIER";
+ case LTTNG_KERNEL_TRACER_STATUS_ERR_OPEN_PROC_LTTNG:
+ return "LTTNG_KERNEL_TRACER_STATUS_ERR_OPEN_PROC_LTTNG";
+ case LTTNG_KERNEL_TRACER_STATUS_ERR_VERSION_MISMATCH:
+ return "LTTNG_KERNEL_TRACER_STATUS_ERR_VERSION_MISMATCH";
+ case LTTNG_KERNEL_TRACER_STATUS_ERR_MODULES_UNKNOWN:
+ return "LTTNG_KERNEL_TRACER_STATUS_ERR_MODULES_UNKNOWN";
+ case LTTNG_KERNEL_TRACER_STATUS_ERR_MODULES_MISSING:
+ return "LTTNG_KERNEL_TRACER_STATUS_ERR_MODULES_MISSING";
+ case LTTNG_KERNEL_TRACER_STATUS_ERR_MODULES_SIGNATURE:
+ return "LTTNG_KERNEL_TRACER_STATUS_ERR_MODULES_SIGNATURE";
+ }
+
+ abort();
+}
+