From: Alexey Brodkin <Alexey.Brodkin@synopsys.com>
To: Vineet Gupta <Vineet.Gupta1@synopsys.com>
Cc: Aabid Rushdi <Aabid.Rushdi@synopsys.com>,
"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
"peterz@infradead.org" <peterz@infradead.org>,
"linux-perf-users@vger.kernel.org"
<linux-perf-users@vger.kernel.org>,
"dvhart@linux.intel.com" <dvhart@linux.intel.com>,
"dsahern@gmail.com" <dsahern@gmail.com>,
"acme@redhat.com" <acme@redhat.com>
Subject: Re: [RFC] perf: fix building for ARCv1
Date: Sun, 18 Oct 2015 11:15:16 +0000 [thread overview]
Message-ID: <1445166916.9672.10.camel@synopsys.com> (raw)
In-Reply-To: <C2D7FE5348E1B147BCA15975FBA23075F44C9DD2@IN01WEMBXA.internal.synopsys.com>
Hi Vineet,
Looks like this time atomics are a must. And that really sucks!
See these commits that introduce usage of atomic_xxx() all around the perf and tools it uses:
http://git.kernel.org/cgit/linux/kernel/git/torvalds/linux.git/commit/?id=f812d3045c2385ac16237e68b156859c4005526e
http://git.kernel.org/cgit/linux/kernel/git/torvalds/linux.git/commit/?id=d3a7c489c7fd2463e3b2c3a2179c7be879dd9cb4
http://git.kernel.org/cgit/linux/kernel/git/torvalds/linux.git/commit/?id=7143849a5d6a5c623d81790d92f0033507c5b14f
http://git.kernel.org/cgit/linux/kernel/git/torvalds/linux.git/commit/?id=59a51c1dc9fbb3fb4af928b852d7b35df83edd74
http://git.kernel.org/cgit/linux/kernel/git/torvalds/linux.git/commit/?id=e1ed3a5b87ed6759e16ec93f16aae83d2cc77ca2
and that's the one that introduced usage of the following generic gcc's atomics
(__sync_add_and_fetch/__sync_sub_and_fetch):
http://git.kernel.org/cgit/linux/kernel/git/torvalds/linux.git/commit/?id=da6d8567512df11e0473b710c07de87efde5709c
So the best we may do is to implement detection of atomics in the toolchain and if there's no atomics hard stop with
perf building.
-Alexey
On Sat, 2015-10-17 at 14:19 +0000, Vineet Gupta wrote:
> On Saturday 17 October 2015 07:06 PM, Alexey Brodkin wrote:
> > Perf uses atomic options and so it is required to have atomics enabled
> > in toolchain.
> >
> > In case of ARC atomics are enabled by default for ARCv2 but disabled for
> > ARCv1. Now we explicitly enable atomics for either ARC achitecture
> > version so perf could be successfully built.
> >
> > Currently on attempt to build perf for ARCv1 you'll see tons of:
> > ----------------->8-----------------
> > undefined reference to `__sync_add_and_fetch_4'
> > ----------------->8-----------------
> >
> > Still note if ARCv1 CPU is configured without LL/SC perf will crash on
> > execution once "llock" instruction is attempted to be executed.
>
> Ok this fixes ARCompact - assuming it will have LL/SC. We do have old SoCs w/o
> that support.
> So what we are saying is that any arch (or a configuration thereof) which doesn't
> support atomic r-m-w can't even build perf now - that sucks !
>
> A better way would be to do feature test for __sync_xyz and make atomic_xxx
> wrappers call __sync_xyz) vs. an empty stub.
> So atleast such arches can build and do "some" perf work !
>
> -Vineet
>
> > Cc: Vineet Gupta <vgupta@synopsys.com>
> > Cc: Peter Zijlstra <peterz@infradead.org>
> > Cc: Arnaldo Carvalho de Melo <acme@kernel.org>
> > Signed-off-by: Alexey Brodkin <abrodkin@synopsys.com>
> > ---
> > tools/perf/config/Makefile | 5 +++++
> > 1 file changed, 5 insertions(+)
> >
> > diff --git a/tools/perf/config/Makefile b/tools/perf/config/Makefile
> > index 38a0853..dc7c0a8 100644
> > --- a/tools/perf/config/Makefile
> > +++ b/tools/perf/config/Makefile
> > @@ -47,6 +47,11 @@ ifeq ($(ARCH),arm64)
> > LIBUNWIND_LIBS = -lunwind -lunwind-aarch64
> > endif
> >
> > +# Additional ARCH settings for ARC
> > +ifeq ($(ARCH),arc)
> > + CFLAGS += -matomic
> > +endif
> > +
> > ifeq ($(NO_PERF_REGS),0)
> > $(call detected,CONFIG_PERF_REGS)
> > endif
>
>
next prev parent reply other threads:[~2015-10-18 11:15 UTC|newest]
Thread overview: 22+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <1445088959-3058-1-git-send-email-abrodkin@synopsys.com>
2015-10-17 14:19 ` [RFC] perf: fix building for ARCv1 Vineet Gupta
2015-10-18 11:15 ` Alexey Brodkin [this message]
2015-10-18 23:14 ` Andi Kleen
2015-10-19 4:58 ` Vineet Gupta
2015-10-19 5:49 ` Andi Kleen
2015-10-19 9:28 ` Vineet Gupta
2015-10-19 9:35 ` Peter Zijlstra
2015-10-19 9:46 ` Vineet Gupta
2015-10-19 9:51 ` Peter Zijlstra
2015-10-19 10:04 ` Vineet Gupta
2015-10-20 8:00 ` Vineet Gupta
2015-10-20 10:11 ` Peter Zijlstra
2015-10-20 10:45 ` Vineet Gupta
2015-10-29 15:58 ` Alexey Brodkin
2015-10-30 6:19 ` Vineet Gupta
2016-02-03 16:20 ` Alexey Brodkin
[not found] ` <1454516455.2811.4.camel__10775.5710989752$1454516490$gmane$org@synopsys.com>
2016-02-04 4:13 ` Vineet Gupta
2016-02-05 11:18 ` Noam Camus
2016-02-05 16:10 ` acme
2016-02-10 3:09 ` Vineet Gupta
2016-10-18 18:58 ` Vineet Gupta
2015-10-30 6:21 ` Vineet Gupta
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=1445166916.9672.10.camel@synopsys.com \
--to=alexey.brodkin@synopsys.com \
--cc=Aabid.Rushdi@synopsys.com \
--cc=Vineet.Gupta1@synopsys.com \
--cc=acme@redhat.com \
--cc=dsahern@gmail.com \
--cc=dvhart@linux.intel.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-perf-users@vger.kernel.org \
--cc=peterz@infradead.org \
/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).