From a864fb02d6918ad014596afef779c964e061c127 Mon Sep 17 00:00:00 2001 From: Mathieu Desnoyers Date: Thu, 23 Jun 2011 21:28:47 -0400 Subject: [PATCH] Add uuid wrapper for kernels < 2.6.35 Signed-off-by: Mathieu Desnoyers --- ltt-events.c | 2 +- ltt-events.h | 2 +- wrapper/uuid.h | 29 +++++++++++++++++++++++++++++ 3 files changed, 31 insertions(+), 2 deletions(-) create mode 100644 wrapper/uuid.h 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 */ -- 2.34.1