summaryrefslogtreecommitdiff
path: root/bench
diff options
context:
space:
mode:
authorDave Jones <davej@redhat.com>2009-12-11 00:32:31 -0500
committerDave Jones <davej@redhat.com>2009-12-11 00:32:31 -0500
commit99c162a97904043844131092b13d2007bcffa14e (patch)
tree70afb54c18f17ce0bee5f3f8d549fba065429a6e /bench
parent7102fe88a1c35a20328d953155c8188e98b8d372 (diff)
Only calculate MHz on the first cpu, unless --all-cpus is passed.
Diffstat (limited to 'bench')
-rw-r--r--bench/MHz.c7
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) {