diff options
author | Sanjay Singh Rawat <sanjay.rawat@linaro.org> | 2014-05-24 18:36:03 +0530 |
---|---|---|
committer | Lisa Nguyen <lisa.nguyen@linaro.org> | 2016-08-08 11:14:40 -0700 |
commit | e277219caf0dd46e9220964a0b37c984e975818d (patch) | |
tree | d93246fbf4003cceadba8a82f37637320bc0f9ff | |
parent | 1bfd95884978e9476ae392003040dceab65dc9ad (diff) | |
download | powertop-2.0-e277219caf0dd46e9220964a0b37c984e975818d.tar.gz |
enumerate cpu based on parsing different string pattern
in current arm kernel cpuinfo bogomips number is not calculated,
using an alternative sting which is used to enumerate the cpu.
Signed-off-by: Sanjay Singh Rawat <sanjay.rawat@linaro.org>
-rw-r--r-- | src/cpu/cpu.cpp | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/src/cpu/cpu.cpp b/src/cpu/cpu.cpp index 64e1d3d..fb61504 100644 --- a/src/cpu/cpu.cpp +++ b/src/cpu/cpu.cpp @@ -302,6 +302,18 @@ void enumerate_cpus(void) number = -2; } } + /* In the current ARM kernel we don't have bogomips number, using CPU revision */ + if (strncasecmp(line, "CPU revision\t", 13) == 0) { + if (number == -1) { + /* Not all /proc/cpuinfo include "processor\t". */ + number = 0; + } + if (number >= 0) { + handle_one_cpu(number, vendor, family, model); + set_max_cpu(number); + number = -2; + } + } } |