Vince,

On Tue, Aug 31, 2010 at 6:25 PM, Vince Weaver <vweav...@eecs.utk.edu> wrote:
> On Mon, 30 Aug 2010, stephane eranian wrote:
>
>> Vince,
>>
>> I am looking at removing any OS dependencies from libpfm4.
>> In particular, I'd like to get rid of pfmlib_getcpuinfo_attr() and
>> replace with a processor specific call , e.g., cpuid(). I noticed
>> that in the new arm code, you are relying on pfmlib_getcpuinfo_attr().
>> I wonder if it would not be possible to add some cpuid()-style
>> calls  to get to the same information. Would you know about this?
>
> On further investigation it definitely is true that obtaining the ARM
> implementer/part information is not possible from userspace.
>
> The relevant register "c0 Main ID register" is privledged access only.
> As far as I can tell there's no way of obtaining the information without
> going through the operating system.  Accessing the register from
> user space gives an illegal instruction exception.
>
Thanks for checking on this. I think that is pretty sad that they don't
support this.  I have made the changes for x86. the code is now using
cpuid() (not in git yet). It removes the dependency on the OS. It looks
like for ARM we may need to keep this OS dependency. I think we can
copy what is in pfmlib_os_linux.c into pfmlib_arm.c for now.

> I think PowerPC has a similar restriction, but the Linux kernel traps on
> the illegal instruction and emulates it so that user space can access the
> data.  As far as I know ARM does not do this.
>
Yes, that's another way of doing it.

------------------------------------------------------------------------------
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