Hi Tony/Amit, anybody has tried to use powertop from linaro on a single core ARM SoC? What i am using is git://android.git.linaro.org/platform/external/powertop.git. I got two questions: 1. powertop will crash in handle_one_cpu() due to it gets wrong cpu number(-1), then i made the following change to make it work:
powertop: fix segment fault for single cpu env
Signed-off-by: Barry Song baohua.song@csr.com
diff --git a/cpu/cpu.cpp b/cpu/cpu.cpp index 29fc72c..c56c746 100644 --- a/cpu/cpu.cpp +++ b/cpu/cpu.cpp @@ -302,6 +302,9 @@ void enumerate_cpus(void) model = strtoull(c, NULL, 10); } } + + if (number == -1) + number = 0; if (strncasecmp(line, "bogomips\t", 9) == 0) { handle_one_cpu(number, vendor, family, model); set_max_cpu(number);
2. after fixing problem1, powertop can run on PrimaII, but i always get 0.0% for every p states as you can see from attached pic. but if we check cpufreq stats in /sys/devices/system/cpu/cpu0/cpufreq/stats, my system does change freq based on ondemand.
# cat time_in_state 800000 2064 600000 181 400000 341 200000 60381
# cat trans_table From : To : 800000 600000 400000 200000 800000: 0 13 13 14 600000: 5 0 3 5 400000: 5 0 0 11 200000: 29 0 0 0
# cat total_trans 98
does anyone have experiences about it?
Thanks barry
Hi Barry,
You fix for invalid cpu id looks fine. As for the P states this new powertop combines with the cpuidle numbers. so if the system is highly idle it means processor is idle and hence P states is shown as 0.
Thanks, Amit Daniel
On 12 December 2011 15:55, Barry Song 21cnbao@gmail.com wrote:
Hi Tony/Amit, anybody has tried to use powertop from linaro on a single core ARM SoC? What i am using is git://android.git.linaro.org/platform/external/powertop.git. I got two questions:
- powertop will crash in handle_one_cpu() due to it gets wrong cpu
number(-1), then i made the following change to make it work:
powertop: fix segment fault for single cpu env
Signed-off-by: Barry Song baohua.song@csr.com
diff --git a/cpu/cpu.cpp b/cpu/cpu.cpp index 29fc72c..c56c746 100644 --- a/cpu/cpu.cpp +++ b/cpu/cpu.cpp @@ -302,6 +302,9 @@ void enumerate_cpus(void) model = strtoull(c, NULL, 10); } }
- if (number == -1)
- number = 0;
if (strncasecmp(line, "bogomips\t", 9) == 0) { handle_one_cpu(number, vendor, family, model); set_max_cpu(number);
- after fixing problem1, powertop can run on PrimaII, but i always
get 0.0% for every p states as you can see from attached pic. but if we check cpufreq stats in /sys/devices/system/cpu/cpu0/cpufreq/stats, my system does change freq based on ondemand.
# cat time_in_state 800000 2064 600000 181 400000 341 200000 60381
# cat trans_table From : To : 800000 600000 400000 200000 800000: 0 13 13 14 600000: 5 0 3 5 400000: 5 0 0 11 200000: 29 0 0 0
# cat total_trans 98
does anyone have experiences about it?
Thanks barry
Hi Amit,
Thanks!
2011/12/12 Amit Kachhap amit.kachhap@linaro.org:
Hi Barry,
You fix for invalid cpu id looks fine.
so will you merge some fixes into linaro tree?
As for the P states this new powertop combines with the cpuidle numbers. so if the system is highly idle it means processor is idle and hence P states is shown as 0.
i did have a highly idle in my last test as you can see from attached picture. my C state "WFI" holds 98%.
but i wrote a program: main() { while(1); } and run it, then it makes C state to 0%.
but i still got all p state with 0%.
anything have i missed?
Thanks, Amit Daniel
On 12 December 2011 15:55, Barry Song 21cnbao@gmail.com wrote:
Hi Tony/Amit, anybody has tried to use powertop from linaro on a single core ARM SoC? What i am using is git://android.git.linaro.org/platform/external/powertop.git. I got two questions:
- powertop will crash in handle_one_cpu() due to it gets wrong cpu
number(-1), then i made the following change to make it work:
powertop: fix segment fault for single cpu env
Signed-off-by: Barry Song baohua.song@csr.com
diff --git a/cpu/cpu.cpp b/cpu/cpu.cpp index 29fc72c..c56c746 100644 --- a/cpu/cpu.cpp +++ b/cpu/cpu.cpp @@ -302,6 +302,9 @@ void enumerate_cpus(void) model = strtoull(c, NULL, 10); } }
- if (number == -1)
- number = 0;
if (strncasecmp(line, "bogomips\t", 9) == 0) { handle_one_cpu(number, vendor, family, model); set_max_cpu(number);
- after fixing problem1, powertop can run on PrimaII, but i always
get 0.0% for every p states as you can see from attached pic. but if we check cpufreq stats in /sys/devices/system/cpu/cpu0/cpufreq/stats, my system does change freq based on ondemand.
# cat time_in_state 800000 2064 600000 181 400000 341 200000 60381
# cat trans_table From : To : 800000 600000 400000 200000 800000: 0 13 13 14 600000: 5 0 3 5 400000: 5 0 0 11 200000: 29 0 0 0
# cat total_trans 98
does anyone have experiences about it?
Thanks barry
Thanks barry
ok now. the reason is the powertop depends on CONFIG_EVENT_POWER_TRACING_DEPRECATED, after selecting it, powertop gets to work on SiRFprimaII. Thanks barry 2011/12/14 Barry Song 21cnbao@gmail.com:
Hi Amit,
Thanks!
2011/12/12 Amit Kachhap amit.kachhap@linaro.org:
Hi Barry,
You fix for invalid cpu id looks fine.
so will you merge some fixes into linaro tree?
As for the P states this new powertop combines with the cpuidle numbers. so if the system is highly idle it means processor is idle and hence P states is shown as 0.
i did have a highly idle in my last test as you can see from attached picture. my C state "WFI" holds 98%.
but i wrote a program: main() { while(1); } and run it, then it makes C state to 0%.
but i still got all p state with 0%.
anything have i missed?
Thanks, Amit Daniel
On 12 December 2011 15:55, Barry Song 21cnbao@gmail.com wrote:
Hi Tony/Amit, anybody has tried to use powertop from linaro on a single core ARM SoC? What i am using is git://android.git.linaro.org/platform/external/powertop.git. I got two questions:
- powertop will crash in handle_one_cpu() due to it gets wrong cpu
number(-1), then i made the following change to make it work:
powertop: fix segment fault for single cpu env
Signed-off-by: Barry Song baohua.song@csr.com
diff --git a/cpu/cpu.cpp b/cpu/cpu.cpp index 29fc72c..c56c746 100644 --- a/cpu/cpu.cpp +++ b/cpu/cpu.cpp @@ -302,6 +302,9 @@ void enumerate_cpus(void) model = strtoull(c, NULL, 10); } }
- if (number == -1)
- number = 0;
if (strncasecmp(line, "bogomips\t", 9) == 0) { handle_one_cpu(number, vendor, family, model); set_max_cpu(number);
- after fixing problem1, powertop can run on PrimaII, but i always
get 0.0% for every p states as you can see from attached pic. but if we check cpufreq stats in /sys/devices/system/cpu/cpu0/cpufreq/stats, my system does change freq based on ondemand.
# cat time_in_state 800000 2064 600000 181 400000 341 200000 60381
# cat trans_table From : To : 800000 600000 400000 200000 800000: 0 13 13 14 600000: 5 0 3 5 400000: 5 0 0 11 200000: 29 0 0 0
# cat total_trans 98
does anyone have experiences about it?
Thanks barry
Thanks barry