The following set of patches modify the powertop version 2.0 to work for ARM platform. The C states and P states was measured after doing these changes in powertop.
Amit Daniel Kachhap (2): Modified Powertop to support ARM processor Added an arm compiler flag
cpu/cpu.cpp | 8 +++++++- 1 files changed, 7 insertions(+), 1 deletions(-)
[PATCH 1/2] Modified Powertop to support ARM processor [PATCH 2/2] Added an arm compiler flag
From: Amit Daniel Kachhap amit.kachhap@linaro.org
Added a compulsory field bogomips for each processor in case other fields like model is missing. Error handling code added in case of package id remains uninitialised.
Signed-off-by: Amit Daniel Kachhap amit.kachhap@linaro.org --- cpu/cpu.cpp | 6 ++++++ 1 files changed, 6 insertions(+), 0 deletions(-)
diff --git a/cpu/cpu.cpp b/cpu/cpu.cpp index 39f00e7..451c120 100644 --- a/cpu/cpu.cpp +++ b/cpu/cpu.cpp @@ -171,6 +171,8 @@ static void handle_one_cpu(unsigned int number, char *vendor, int family, int mo file.close(); }
+ if (package_number == (unsigned int)-1) + package_number = 0;
if (system_level.children.size() <= package_number) system_level.children.resize(package_number + 1, NULL); @@ -263,6 +265,10 @@ void enumerate_cpus(void) handle_one_cpu(number, vendor, family, model); set_max_cpu(number); } + if (strncasecmp(line, "bogomips\t",9) == 0) { + handle_one_cpu(number, vendor, family, model); + set_max_cpu(number); + } }
From: Amit Daniel Kachhap amit.kachhap@linaro.org
Modified to extract correct elements of power_entry structure.
Signed-off-by: Amit Daniel Kachhap amit.kachhap@linaro.org --- cpu/cpu.cpp | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/cpu/cpu.cpp b/cpu/cpu.cpp index 451c120..f9995be 100644 --- a/cpu/cpu.cpp +++ b/cpu/cpu.cpp @@ -747,7 +747,7 @@ void w_display_cpu_pstates(void)
struct power_entry { -#ifdef __x86_64__ +#if defined(__x86_64__) || defined(__arm__) int dummy; #endif int64_t type;