On Wed, Sep 1, 2010 at 11:09 PM, stephane eranian
<eran...@googlemail.com> wrote:
> On Wed, Sep 1, 2010 at 11:08 PM, stephane eranian
> <eran...@googlemail.com> wrote:
>> Vince,
>>
>> On Wed, Sep 1, 2010 at 10:54 PM, Vince Weaver <vweav...@eecs.utk.edu> wrote:
>>> On Wed, 1 Sep 2010, stephane eranian wrote:
>>>
>>>> That's because on ARM, the _NR_perf_event_open syscall is already
>>>> defined in some generic header file (I bet /usr/include/asm/unistd.h).
>>>> That means I need to fix my perf_event.h to check for that before forcing
>>>> a definition on its own.
>>>
>>> It's pulled in my /usr/include/asm/unistd.h (I'm running Debian Unstable
>>> which has recent enough headers).
>>>
>>> What's weird is that on x86_64 the same include should pull in the
>>> equivelent x86_64 header, which also has a duplicate definition, on my
>>> x86_64 machines.  Somehow it doesn't though; I wasted some time
>>> trying to figure out how it avoids the conflict.
>>>
>>> In any case, with a patch like the one at the end included, the current
>>> git of libpfm4 runs fine on my ARM system.
>>>
>> Yes, I will push this patch ASAP.
>> Thanks for the investigation.
>>
> Second thought on this: isn't it the case also that libc already
> has the syscall stub? If so I suspect you're not getting duplicate
> symbols because it is declared as weak? Or maybe I need to declare
> mine as weak.
>
Well, I know why! It's declared an inline, so we are okay.

>>> diff --git a/include/perfmon/perf_event.h b/include/perfmon/perf_event.h
>>> index 00e2748..2100e69 100644
>>> --- a/include/perfmon/perf_event.h
>>> +++ b/include/perfmon/perf_event.h
>>> @@ -446,6 +446,7 @@ enum perf_callchain_context {
>>>  #define __NR_perf_event_open 319
>>>  #endif
>>>
>>> +#ifndef __NR_perf_event_open
>>>  #ifdef __arm__
>>>  #if defined(__ARM_EABI__) || defined(__thumb__)
>>>  #define __NR_perf_event_open 364
>>> @@ -453,6 +454,7 @@ enum perf_callchain_context {
>>>  #define __NR_perf_event_open (0x900000+364)
>>>  #endif
>>>  #endif
>>> +#endif
>>>
>>>  static inline int
>>>  perf_event_open(
>>>
>>
>

------------------------------------------------------------------------------
This SF.net Dev2Dev email is sponsored by:

Show off your parallel programming skills.
Enter the Intel(R) Threading Challenge 2010.
http://p.sf.net/sfu/intel-thread-sfd
_______________________________________________
perfmon2-devel mailing list
perfmon2-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/perfmon2-devel

Reply via email to