X86 performance monitoring

William Cohen wcohen at redhat.com
Sat Nov 7 01:30:19 UTC 2009


Frank Cox wrote:
> My brother just sent me this inquiry and I thought I would ask here to see if
> any of you lot know anything about this before I send him a reply.
> 
> Just checking whether you know anything about the various packages
> I could use to monitor performance of code running on X86 processors.
> I want to measure things like:
>    - instructions executed, in a block of code (ie., from here to there)
>    - cache misses (i-cache, d-cache, L1, L2, etc)
>    - processor cycles
>    - SSE4 instructions executed
>    - ... and so on.
> 
> There appear to be at least a few packages which expose the
> MSR functionality in varioius ways (e.g., the perfctr package).
> I wondered if you knew which package would be considered
> the 'best'.
> 
> One unpleasant aspect of the perfctr package is that it appears
> that I need to apply patches to the kernel, then rebuild;
> this would appear to increase the complexity of system maintenance
> (can't just update and have everything up).
> 

The 2.6.31 and newer kernels have support to access the performance monitoring
hardware on some models of x86 processors (NetBurst/P4 is NOT supports). You can
access the performance counter in Fedora 12 from the command line using the perf
package (a kernel sub-package). You could also write your own tools using the
same systemcalls as perf. You can browse the perf code at:

http://lxr.linux.no/#linux+v2.6.31/tools/perf/

-Will




More information about the users mailing list