linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Ingo Molnar <mingo@kernel.org>
To: Riku Voipio <riku.voipio@iki.fi>,
	Rusty Russell <rusty@rustcorp.com.au>,
	Stephen Rothwell <sfr@canb.auug.org.au>
Cc: Peter Zijlstra <peterz@infradead.org>,
	mingo@redhat.com, acme@kernel.org, linux-kernel@vger.kernel.org,
	"Paul E. McKenney" <paulmck@us.ibm.com>
Subject: [PATCH] tools/perf, rbtree: Add RCU wrappers to make rbtree.h usable in user-space
Date: Wed, 17 Jun 2015 11:17:04 +0200	[thread overview]
Message-ID: <20150617091703.GA2883@gmail.com> (raw)
In-Reply-To: <20150617060952.GA5375@kos.to>


* 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(+)

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
+

  reply	other threads:[~2015-06-17  9:17 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-06-17  6:09 Building tools/perf fails on next Riku Voipio
2015-06-17  9:17 ` Ingo Molnar [this message]
2015-06-17  9:33   ` [PATCH] tools/perf, rbtree: Add RCU wrappers to make rbtree.h usable in user-space Riku Voipio
2015-07-06  8:13   ` Stephen Rothwell
2015-07-06  9:41     ` Ingo Molnar
2015-07-06 22:39       ` Stephen Rothwell
  -- strict thread matches above, loose matches on Subject: below --
2015-07-02  0:52 [PATCH 1/2 block/for-linus] writeback: don't embed root bdi_writeback_congested in bdi_writeback Tejun Heo
2015-07-02  0:53 ` [PATCH 2/2 block/for-linus] writeback: don't drain bdi_writeback_congested on bdi destruction Tejun Heo
2015-07-02  3:02   ` Jon Christopherson
     [not found]     ` <5594AD98.4050402@jons.org>
2015-07-02 13:21       ` [PATCH] tools/perf, rbtree: Add RCU wrappers to make rbtree.h usable in user-space Tejun Heo
2015-07-02 20:51         ` Rusty Russell
2015-07-03  7:14           ` Peter Zijlstra
2015-07-03 10:00             ` Jon Christopherson
2015-07-04 16:15             ` Arnaldo Carvalho de Melo
2015-07-06 10:57               ` Peter Zijlstra

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20150617091703.GA2883@gmail.com \
    --to=mingo@kernel.org \
    --cc=acme@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@redhat.com \
    --cc=paulmck@us.ibm.com \
    --cc=peterz@infradead.org \
    --cc=riku.voipio@iki.fi \
    --cc=rusty@rustcorp.com.au \
    --cc=sfr@canb.auug.org.au \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).