From: Mathieu Desnoyers Date: Fri, 24 Jun 2011 01:28:47 +0000 (-0400) Subject: Add uuid wrapper for kernels < 2.6.35 X-Git-Tag: v2.0-pre1~45 X-Git-Url: https://git.lttng.org./?a=commitdiff_plain;h=a864fb02d6918ad014596afef779c964e061c127;p=lttng-modules.git Add uuid wrapper for kernels < 2.6.35 Signed-off-by: Mathieu Desnoyers --- diff --git a/ltt-events.c b/ltt-events.c index 3457699f..e9e076d8 100644 --- a/ltt-events.c +++ b/ltt-events.c @@ -14,7 +14,7 @@ #include #include #include -#include +#include "wrapper/uuid.h" #include "wrapper/vmalloc.h" /* for wrapper_vmalloc_sync_all() */ #include "ltt-events.h" #include "ltt-tracer.h" diff --git a/ltt-events.h b/ltt-events.h index 4cb4919f..32c87358 100644 --- a/ltt-events.h +++ b/ltt-events.h @@ -12,8 +12,8 @@ */ #include -#include #include +#include "wrapper/uuid.h" #include "ltt-debugfs-abi.h" #undef is_signed_type diff --git a/wrapper/uuid.h b/wrapper/uuid.h new file mode 100644 index 00000000..569ccab6 --- /dev/null +++ b/wrapper/uuid.h @@ -0,0 +1,29 @@ +#ifndef _LTT_WRAPPER_UUID_H +#define _LTT_WRAPPER_UUID_H + +/* + * Copyright (C) 2011 Mathieu Desnoyers (mathieu.desnoyers@efficios.com) + * + * Dual LGPL v2.1/GPL v2 license. + */ + +#include + +#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,35)) +#include +#else + +#include + +typedef struct { + __u8 b[16]; +} uuid_le; + +static inline +void uuid_le_gen(uuid_le *u) +{ + genarate_random_uuid(u); +} + +#endif +#endif /* _LTT_WRAPPER_UUID_H */