diff options
author | Dave Jones <davej@redhat.com> | 2009-12-11 00:32:31 -0500 |
---|---|---|
committer | Dave Jones <davej@redhat.com> | 2009-12-11 00:32:31 -0500 |
commit | 99c162a97904043844131092b13d2007bcffa14e (patch) | |
tree | 70afb54c18f17ce0bee5f3f8d549fba065429a6e /bench | |
parent | 7102fe88a1c35a20328d953155c8188e98b8d372 (diff) |
Only calculate MHz on the first cpu, unless --all-cpus is passed.
Diffstat (limited to 'bench')
-rw-r--r-- | bench/MHz.c | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/bench/MHz.c b/bench/MHz.c index baf5215..53c11f1 100644 --- a/bench/MHz.c +++ b/bench/MHz.c @@ -28,6 +28,13 @@ void estimate_MHz(struct cpudata *cpu) unsigned int eax, ebx, ecx, edx; unsigned long r; + if (cpu->number != 0) { + if (all_cpus == 0) { + cpu->MHz = firstcpu->MHz; + return; + } + } + /* Make sure we have a TSC (and hence RDTSC) */ cpuid(cpu->number, 1, &eax, &ebx, &ecx, &edx); if ((edx & (1<<4)) == 0) { |