On Fri, 20 Aug 2010, stephane eranian wrote:
> 
> However I have one comment:
> 
>    The event table has the encoding that is specific to perf_events. This 
> means
>    the table can only be used with perf_events. That is not the approach taken
>    by libpfm4. I am trying hard to make the core of the library OS-agnostic. 
> That
>    means the table should have the official encodings of the event. If you 
> need
>    an OS specific encoding, then you need to add a shim layer specific to the 
> OS
>    to make the conversion.

at least for the Cortex A8 (the machine I have) the perf events match the
actual value you set to hardware (with the difference that it's only a 
32-bit hardware register).

For example, in the Cortex-A8 Technical Reference manual, section 3.2.50 
it shows that the EVTSEL (EVent SELection) register is just 
a 32-bit value with the lowest 8-bits being the "EVTSEL" bits (and the 
other bits are reserverd).  The event values in table 3-98 correspond 
exactly to the 8-bit value used by perf events.

There are a few possible corner cases; most notably I think perf-events
might play some tricks to get the cycle count (which is provided by a 
separate register, I'll have to check on that).

Now the other ARM chips might be different, I have to admit that I haven't 
tracked down the documentation for them yet.  But at least for the chip I 
have the perf events values match the actual hardware register values.

Vince

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

Make an app they can't live without
Enter the BlackBerry Developer Challenge
http://p.sf.net/sfu/RIM-dev2dev 
_______________________________________________
perfmon2-devel mailing list
perfmon2-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/perfmon2-devel

Reply via email to