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 <21cn...@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: > 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.s...@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 _______________________________________________ linaro-dev mailing list linaro-dev@lists.linaro.org http://lists.linaro.org/mailman/listinfo/linaro-dev