Add uuid wrapper for kernels < 2.6.35
authorMathieu Desnoyers <mathieu.desnoyers@efficios.com>
Fri, 24 Jun 2011 01:28:47 +0000 (21:28 -0400)
committerMathieu Desnoyers <mathieu.desnoyers@efficios.com>
Fri, 24 Jun 2011 01:28:47 +0000 (21:28 -0400)
Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
ltt-events.c
ltt-events.h
wrapper/uuid.h [new file with mode: 0644]

index 3457699f812edfaa347aec64086321b2aa341b49..e9e076d802238bc07e1aef14e0bb4f1e2914df6b 100644 (file)
@@ -14,7 +14,7 @@
 #include <linux/sched.h>
 #include <linux/slab.h>
 #include <linux/jiffies.h>
-#include <linux/uuid.h>
+#include "wrapper/uuid.h"
 #include "wrapper/vmalloc.h"   /* for wrapper_vmalloc_sync_all() */
 #include "ltt-events.h"
 #include "ltt-tracer.h"
index 4cb4919ff87a8620bfa5c40b959168f115229340..32c87358f635c9b380bce2b51fb13e1f0ebea044 100644 (file)
@@ -12,8 +12,8 @@
  */
 
 #include <linux/list.h>
-#include <linux/uuid.h>
 #include <linux/kprobes.h>
+#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 (file)
index 0000000..569ccab
--- /dev/null
@@ -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 <linux/version.h>
+
+#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,35))
+#include <linux/uuid.h>
+#else
+
+#include <linux/random.h>
+
+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 */
This page took 0.027617 seconds and 4 git commands to generate.