diff options
author | Kristen Carlson Accardi <kristen@linux.intel.com> | 2011-04-21 13:33:42 -0700 |
---|---|---|
committer | Kristen Carlson Accardi <kristen@linux.intel.com> | 2011-04-21 14:48:58 -0700 |
commit | 00215302bfe36b7d12d90a0dbcb9f1c78fec0861 (patch) | |
tree | 9a87554916fcbe76e5da06fe6baec043e37f2226 | |
parent | b7ce5316d6a8264aba3cbadee8e6b99a2925688b (diff) | |
download | powertop-00215302bfe36b7d12d90a0dbcb9f1c78fec0861.tar.gz |
Powertop looks for "model" field in /proc/cpuinfo. This field is not populated on ARM platforms. ?Key off "bogomips" instead since it is present on both x86 and ARM platforms.
In addition, /sys/devices/system/cpu/cpu*/topology/physical_package_id
is un-initialized (set to -1) on ARM platforms. ?Added safety valve to
deal with this.
Signed-off-by: Sameer Nanda <snanda at chromium.org>
Signed-off-by: Kristen Carlson Accardi <kristen@linux.intel.com>
-rw-r--r-- | cpu/cpu.cpp | 4 | ||||
-rw-r--r-- | po/powertop.pot | 2 |
2 files changed, 5 insertions, 1 deletions
diff --git a/cpu/cpu.cpp b/cpu/cpu.cpp index 39f00e7..2fcced8 100644 --- a/cpu/cpu.cpp +++ b/cpu/cpu.cpp @@ -168,6 +168,8 @@ static void handle_one_cpu(unsigned int number, char *vendor, int family, int mo file.open(filename, ios::in); if (file) { file >> package_number; + if (package_number == (unsigned int) -1) + package_number = 0; file.close(); } @@ -260,6 +262,8 @@ void enumerate_cpus(void) c++; model = strtoull(c, NULL, 10); } + } + if (strncasecmp(line, "bogomips\t", 9) == 0) { handle_one_cpu(number, vendor, family, model); set_max_cpu(number); } diff --git a/po/powertop.pot b/po/powertop.pot index 1342857..0d2ef97 100644 --- a/po/powertop.pot +++ b/po/powertop.pot @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2011-04-21 13:20-0700\n" +"POT-Creation-Date: 2011-04-21 13:32-0700\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n" "Language-Team: LANGUAGE <LL@li.org>\n" |