summaryrefslogtreecommitdiffstats
path: root/tools-perf-rbtree-Add-RCU-wrappers-to-make-rbtree.h-.patch
blob: 44f50000ef6855c3efa143453f7e003004f9d55b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
From: Ingo Molnar <mingo@kernel.org>
Date: Wed, 17 Jun 2015 11:17:04 +0200
Subject: [PATCH] tools/perf, rbtree: Add RCU wrappers to make rbtree.h usable
 in user-space

* Riku Voipio <riku.voipio@iki.fi> wrote:

> Hi,
>
> The commit:
>
> commit d72da4a4d973d8a0a0d3c97e7cdebf287fbe3a99
> Author: Peter Zijlstra <peterz@infradead.org>
> Date:   Wed May 27 11:09:36 2015 +0930
>
>     rbtree: Make lockless searches non-fatal
>
> Adds <linux/rcupdate.h> to rbtree.h, which in turn is included from perf userspace
> headers. Now building tools/perf will fail with hundreds of lines of gcc complaining
> about kernel defines not available. Reverting the patch makes perf build again.
> This is with gcc-4.9 from debian but I don't think it's compiler specific.

Does the patch below make things work?

This fix could go into the modules tree, as this commit came via Rusty.

Stephen, feel free to add:

   make -C tools/perf

to the linux-next build tests. It's always supposed to build without failure, in
pretty much whatever x86 distro you run your build tests on.

Thanks,

	Ingo

===================>
From 62c251255f07ede8efa356d4ea9ab51827ffa0d0 Mon Sep 17 00:00:00 2001
From: Ingo Molnar <mingo@kernel.org>
Date: Wed, 17 Jun 2015 11:07:11 +0200
Subject: [PATCH] tools/perf, rbtree: Add RCU wrappers to make rbtree.h usable in user-space

Reported-by: Riku Voipio <riku.voipio@iki.fi>
Signed-off-by: Ingo Molnar <mingo@kernel.org>
---
 tools/perf/util/include/linux/rcupdate.h | 9 +++++++++
 1 file changed, 9 insertions(+)
 create mode 100644 tools/perf/util/include/linux/rcupdate.h

diff --git a/tools/perf/util/include/linux/rcupdate.h b/tools/perf/util/include/linux/rcupdate.h
new file mode 100644
index 000000000000..3e022dd9a69b
--- /dev/null
+++ b/tools/perf/util/include/linux/rcupdate.h
@@ -0,0 +1,9 @@
+#ifndef PERF_LINUX_RCUPDATE_H_
+#define PERF_LINUX_RCUPDATE_H_
+
+/* Simple trivial wrappers for now, we don't use RCU in perf user-space (yet): */
+#define WRITE_ONCE(var, val)			((var) = (val))
+#define rcu_assign_pointer(ptr, val)		WRITE_ONCE(ptr, val)
+
+#endif
+