diff options
author | Jaswinder Singh Rajput <jaswinderrajput@gmail.com> | 2009-02-27 20:15:14 +0530 |
---|---|---|
committer | Ingo Molnar <mingo@elte.hu> | 2009-02-28 10:38:32 +0100 |
commit | f87ad35d37fa543925210550f7db20a54c83ed70 (patch) | |
tree | 97ceff0080ac183f9416176b558d46271a044bdc /arch/x86/kernel/cpu/amd.c | |
parent | b56a3802dc6df29aa27d2c12edf420258091ad66 (diff) | |
download | talos-obmc-linux-f87ad35d37fa543925210550f7db20a54c83ed70.tar.gz talos-obmc-linux-f87ad35d37fa543925210550f7db20a54c83ed70.zip |
x86: AMD Support for perf_counter
Supported basic performance counter for AMD K7 and later:
$ perfstat -e 0,1,2,3,4,5,-1,-2,-3,-4,-5 ls > /dev/null
Performance counter stats for 'ls':
12.298610 task clock ticks (msecs)
3298477 CPU cycles (events)
1406354 instructions (events)
749035 cache references (events)
16939 cache misses (events)
100589 branches (events)
11159 branch misses (events)
7.627540 cpu clock ticks (msecs)
12.298610 task clock ticks (msecs)
500 pagefaults (events)
6 context switches (events)
3 CPU migrations (events)
Wall-clock time elapsed: 8.672290 msecs
Signed-off-by: Jaswinder Singh Rajput <jaswinderrajput@gmail.com>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
Diffstat (limited to 'arch/x86/kernel/cpu/amd.c')
-rw-r--r-- | arch/x86/kernel/cpu/amd.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/arch/x86/kernel/cpu/amd.c b/arch/x86/kernel/cpu/amd.c index 25423a5b80ed..edcde52bd170 100644 --- a/arch/x86/kernel/cpu/amd.c +++ b/arch/x86/kernel/cpu/amd.c @@ -368,6 +368,10 @@ static void __cpuinit init_amd(struct cpuinfo_x86 *c) if (c->x86 >= 6) set_cpu_cap(c, X86_FEATURE_FXSAVE_LEAK); + /* Enable Performance counter for K7 and later */ + if (c->x86 > 6 && c->x86 <= 0x11) + set_cpu_cap(c, X86_FEATURE_ARCH_PERFMON); + if (!c->x86_model_id[0]) { switch (c->x86) { case 0xf: |