Re: [git-pull -tip] x86: Basic AMD Support for performance counters

Ingo Molnar
2009-02-28T09:40:48Z

* Jaswinder Singh Rajput <jaswinder@kernel.org> wrote:

> Hello Ingo,
>
> These patches added basic AMD (K7 and later) support for performance counters:
>
> [jaswinder@hpdv5 linux-2.6-tip]$ perfstat -e 0,1,2,3,4,5,-1,-2,-3,-4,-5 ls -lR > /dev/null
>
> Performance counter stats for 'ls':
>
> 2723.203821 task clock ticks (msecs)
>
> 1812527794 CPU cycles (events)
> 1121688997 instructions (events)
> 569836744 cache references (events)
> 15934598 cache misses (events)
> 57313261 branches (events)
> 4243201 branch misses (events)
> 2639.682866 cpu clock ticks (msecs)
> 2723.203821 task clock ticks (msecs)
> 647 pagefaults (events)
> 2401 context switches (events)
> 3 CPU migrations (events)
>
> Wall-clock time elapsed: 6813.030975 msecs

Very nice feature!

The AMD patches look much cleaner than i feared they would be.
It seems you were able to keep pretty generic x86 code in
arch/x86/kernel/cpu/perf_counters.c, sharing most of the logic
between Intel and AMD perfcounters.

> The following changes since commit f39e09b3b2c11ad1b008518a05bc2b7c25eabc7d:
> Ingo Molnar (1):
> Merge branch 'tracing/ftrace'
>
> are available in the git repository at:
>
> git://git.kernel.org/pub/scm/linux/kernel/git/jaswinder/linux-2.6-tip.git master
>
> Jaswinder Singh Rajput (2):
> x86: prepare perf_counter to add more cpus
> x86: AMD Support for perf_counter
>
> arch/x86/kernel/cpu/amd.c | 4 +
> arch/x86/kernel/cpu/perf_counter.c | 189 ++++++++++++++++++++++++++++++------
> 2 files changed, 163 insertions(+), 30 deletions(-)

Pulled into tip:perfcounters/core, thanks Jaswinder!

Ingo