Re: [RFC] perf: fix building for ARCv1

2016-10-18 Thread Vineet Gupta
On 10/19/2015 02:35 AM, Peter Zijlstra wrote: > On Mon, Oct 19, 2015 at 09:28:43AM +, Vineet Gupta wrote: >> On Monday 19 October 2015 11:20 AM, Andi Kleen wrote: >>> Vineet Gupta writes: But this user space - so IMHO UP/SMP doesn't matter and we can't simulate them in C just b

Re: [RFC] perf: fix building for ARCv1

2016-02-09 Thread Vineet Gupta
On Friday 05 February 2016 09:40 PM, a...@redhat.com wrote: > Em Fri, Feb 05, 2016 at 11:18:52AM +, Noam Camus escreveu: >> Well here for EZchip I also see the: >> undefined reference to `__sync_add_and_fetch_4' >> undefined reference to `__sync_sub_and_fetch_4' > > Yeah, because there is no:

Re: [RFC] perf: fix building for ARCv1

2016-02-05 Thread Noam Camus
>From: Vineet Gupta >Sent: Thursday, February 4, 2016 6:13 AM >Noam, what's the atomic story for EZChip. Do you support such things for user space in GNU tools. If -atomic is added to perf user space builds are you guys OK! Well here for EZchip I also s

Re: [RFC] perf: fix building for ARCv1

2016-02-03 Thread Vineet Gupta
+CC Noam On Wednesday 03 February 2016 09:50 PM, Alexey Brodkin wrote: >> I agree with the current solution to add -atomic to for arc700 builds. >> > Although making that default for arc700 tools will be better but that will >> > not fix >> > things before next release of tools etc. >> > >> > Bu

Re: [RFC] perf: fix building for ARCv1

2016-02-03 Thread Alexey Brodkin
Hi Vineet, On Fri, 2015-10-30 at 06:19 +, Vineet Gupta wrote: > On Thursday 29 October 2015 09:28 PM, Alexey Brodkin wrote: > > Hi Vineet, > > > > On Tue, 2015-10-20 at 10:45 +, Vineet Gupta wrote: > > > On Tuesday 20 October 2015 03:41 PM, Peter Zijlstra wrote: > > > > > > Can we use exi

Re: [RFC] perf: fix building for ARCv1

2015-10-29 Thread Vineet Gupta
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 > ve

Re: [RFC] perf: fix building for ARCv1

2015-10-29 Thread Vineet Gupta
On Thursday 29 October 2015 09:28 PM, Alexey Brodkin wrote: > Hi Vineet, > > On Tue, 2015-10-20 at 10:45 +, Vineet Gupta wrote: >> On Tuesday 20 October 2015 03:41 PM, Peter Zijlstra wrote: > Can we use existing syscall(s) - again this is what our good old pthread > library > code

Re: [RFC] perf: fix building for ARCv1

2015-10-29 Thread Alexey Brodkin
Hi Vineet, On Tue, 2015-10-20 at 10:45 +, Vineet Gupta wrote: > On Tuesday 20 October 2015 03:41 PM, Peter Zijlstra wrote: > > > > Can we use existing syscall(s) - again this is what our good old > > > > pthread library > > > > code did. > > > > > > > > static void __pthread_acquire(int * sp

Re: [RFC] perf: fix building for ARCv1

2015-10-20 Thread Vineet Gupta
On Tuesday 20 October 2015 03:41 PM, Peter Zijlstra wrote: >> > Can we use existing syscall(s) - again this is what our good old pthread >> > library >> > code did. >> > >> > static void __pthread_acquire(int * spinlock) >> > { >> > int cnt = 0; >> > struct timespec tm; >> > >> > READ_MEMO

Re: [RFC] perf: fix building for ARCv1

2015-10-20 Thread Peter Zijlstra
On Tue, Oct 20, 2015 at 08:00:46AM +, Vineet Gupta wrote: > On Monday 19 October 2015 03:22 PM, Peter Zijlstra wrote: > > On Mon, Oct 19, 2015 at 09:46:35AM +, Vineet Gupta wrote: > >> On ARC we could use the atomic EXchange to implement a user space only > >> binary > >> semaphore - these

Re: [RFC] perf: fix building for ARCv1

2015-10-20 Thread Vineet Gupta
On Monday 19 October 2015 03:22 PM, Peter Zijlstra wrote: > On Mon, Oct 19, 2015 at 09:46:35AM +, Vineet Gupta wrote: >> On ARC we could use the atomic EXchange to implement a user space only binary >> semaphore - these atomic ops will be small duration so it is OK to spin wait >> for a >> lit

Re: [RFC] perf: fix building for ARCv1

2015-10-19 Thread Vineet Gupta
On Monday 19 October 2015 03:22 PM, Peter Zijlstra wrote: > On Mon, Oct 19, 2015 at 09:46:35AM +, Vineet Gupta wrote: >> > On ARC we could use the atomic EXchange to implement a user space only >> > binary >> > semaphore - these atomic ops will be small duration so it is OK to spin >> > wait

Re: [RFC] perf: fix building for ARCv1

2015-10-19 Thread Peter Zijlstra
On Mon, Oct 19, 2015 at 09:46:35AM +, Vineet Gupta wrote: > On ARC we could use the atomic EXchange to implement a user space only binary > semaphore - these atomic ops will be small duration so it is OK to spin wait > for a > little bit. That's how the old pthread library worked for ARC w/o a

Re: [RFC] perf: fix building for ARCv1

2015-10-19 Thread Vineet Gupta
On Monday 19 October 2015 03:05 PM, Peter Zijlstra wrote: > On Mon, Oct 19, 2015 at 09:28:43AM +, Vineet Gupta wrote: >> > On Monday 19 October 2015 11:20 AM, Andi Kleen wrote: >>> > > Vineet Gupta writes: > >> But this user space - so IMHO UP/SMP doesn't matter and we can't > >> si

Re: [RFC] perf: fix building for ARCv1

2015-10-19 Thread Peter Zijlstra
On Mon, Oct 19, 2015 at 09:28:43AM +, Vineet Gupta wrote: > On Monday 19 October 2015 11:20 AM, Andi Kleen wrote: > > Vineet Gupta writes: > >> But this user space - so IMHO UP/SMP doesn't matter and we can't simulate > >> them in > >> C just by itself. > > It matters when you access the perf

Re: [RFC] perf: fix building for ARCv1

2015-10-19 Thread Vineet Gupta
On Monday 19 October 2015 11:20 AM, Andi Kleen wrote: > Vineet Gupta writes: >> But this user space - so IMHO UP/SMP doesn't matter and we can't simulate >> them in >> C just by itself. > It matters when you access the perf ring buffer which is updated by kernel. That's part of the problem. The

Re: [RFC] perf: fix building for ARCv1

2015-10-18 Thread Andi Kleen
Vineet Gupta writes: > > But this user space - so IMHO UP/SMP doesn't matter and we can't simulate > them in > C just by itself. It matters when you access the perf ring buffer which is updated by kernel. Also perf is now multi threaded to some degree. -Andi -- To unsubscribe from this list: se

Re: [RFC] perf: fix building for ARCv1

2015-10-18 Thread Vineet Gupta
On Monday 19 October 2015 04:45 AM, Andi Kleen wrote: > Alexey Brodkin writes: >> 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. > If your target is single cpu only you can always simulate them in C. > > -A

Re: [RFC] perf: fix building for ARCv1

2015-10-18 Thread Andi Kleen
Alexey Brodkin writes: > > 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. If your target is single cpu only you can always simulate them in C. -Andi -- To unsubscribe from this list: send the line "unsubscr

Re: [RFC] perf: fix building for ARCv1

2015-10-18 Thread Alexey Brodkin
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.k

Re: [RFC] perf: fix building for ARCv1

2015-10-17 Thread Vineet Gupta
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 > ve