#include <linux/jhash.h>
#include <linux/uaccess.h>
#include <linux/vmalloc.h>
-#include <linux/uuid.h>
#include <linux/dmi.h>
+#include <wrapper/uuid.h>
#include <wrapper/vmalloc.h> /* for wrapper_vmalloc_sync_all() */
#include <wrapper/random.h>
#include <wrapper/tracepoint.h>
goto err;
INIT_LIST_HEAD(&session->chan);
INIT_LIST_HEAD(&session->events);
- uuid_le_gen(&session->uuid);
+ lttng_guid_gen(&session->uuid);
metadata_cache = kzalloc(sizeof(struct lttng_metadata_cache),
GFP_KERNEL);
--- /dev/null
+/* SPDX-License-Identifier: (GPL-2.0-only or LGPL-2.1-only)
+ *
+ * wrapper/uuid.h
+ *
+ * Copyright (C) 2020 Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
+ */
+
+#ifndef _LTTNG_WRAPPER_UUID_H
+#define _LTTNG_WRAPPER_UUID_H
+
+#include <linux/version.h>
+#include <linux/uuid.h>
+
+#if (LINUX_VERSION_CODE >= KERNEL_VERSION(5,7,0))
+static inline
+void lttng_guid_gen(guid_t *u)
+{
+ return guid_gen(u);
+}
+#else /* #if (LINUX_VERSION_CODE >= KERNEL_VERSION(5,7,0)) */
+static inline
+void lttng_guid_gen(guid_t *u)
+{
+ return uuid_le_gen(u);
+}
+#endif /* #else #if (LINUX_VERSION_CODE >= KERNEL_VERSION(5,7,0)) */
+
+#endif /* _LTTNG_WRAPPER_UUID_H */