From: Mathieu Desnoyers Date: Mon, 13 Apr 2020 16:16:43 +0000 (-0400) Subject: Introduce lttng_guid_gen wrapper for kernels >= 5.7.0 X-Git-Tag: v2.11.4~11 X-Git-Url: https://git.lttng.org./?a=commitdiff_plain;h=dc61cb20e08da3e6ac798f22ca0d4a5025a18fb5;p=lttng-modules.git Introduce lttng_guid_gen wrapper for kernels >= 5.7.0 Signed-off-by: Mathieu Desnoyers --- diff --git a/lttng-events.c b/lttng-events.c index 067bcc53..6233c75c 100644 --- a/lttng-events.c +++ b/lttng-events.c @@ -29,6 +29,7 @@ #include #include +#include #include /* for wrapper_vmalloc_sync_all() */ #include #include @@ -130,7 +131,7 @@ struct lttng_session *lttng_session_create(void) 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); diff --git a/wrapper/uuid.h b/wrapper/uuid.h new file mode 100644 index 00000000..74946e23 --- /dev/null +++ b/wrapper/uuid.h @@ -0,0 +1,28 @@ +/* SPDX-License-Identifier: (GPL-2.0-only or LGPL-2.1-only) + * + * wrapper/uuid.h + * + * Copyright (C) 2020 Mathieu Desnoyers + */ + +#ifndef _LTTNG_WRAPPER_UUID_H +#define _LTTNG_WRAPPER_UUID_H + +#include +#include + +#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 */