Jamie-Landeg-Jones / byte-unixbench

Automatically exported from code.google.com/p/byte-unixbench
0 stars 0 forks source link

Invalid CPU count with offline CPUs #16

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. Put some "middle" CPUs offline (example: cpus 1 and 2 on a 4 cpus system). 
This can be done using "echo 0 > /sys/devices/system/cpu/cpuX/online".
2. Run test

What is the expected output? What do you see instead?

Unixbench should count 2 CPUs but counts 4, this is due to getCpuInfo routine 
which uses CPU ID as array index.

What version of the product are you using? On what operating system?

UnixBench 5.1.3, will behave like this on all systems

Please provide any additional information below.

The routine is also not written properly, the "processor : 0" line is not 
parsed because of the "next if (!$prop || !$val);" line. Thankfully the $cpu is 
initialized to 0 so there is no functionnal issue there.

I ran into this issue by trying to run the test with less cores than the system 
really has, due to hyperthreading I had to disable core 4-7 and 12-15 (as 
opposed to disabling core 8-15)

Original issue reported on code.google.com by it...@itooo.com on 9 Feb 2015 at 1:27