On Mon, Feb 2, 2015 at 7:34 AM, Lisa Nguyen <lisa.ngu...@linaro.org> wrote: > Set the sampling_rate to zero if the sampling_rate attribute cannot > be found in either directories listed in the if condition. This will > also resolve minor bugs where the sampling_rate is missing. > > Signed-off-by: Lisa Nguyen <lisa.ngu...@linaro.org> > --- > include/functions.sh | 4 +++- > 1 file changed, 3 insertions(+), 1 deletion(-) > > diff --git a/include/functions.sh b/include/functions.sh > index e3eb140..4486da8 100644 > --- a/include/functions.sh > +++ b/include/functions.sh > @@ -164,8 +164,10 @@ wait_latency() { > # consider per-policy governor case > if [ -e $CPU_PATH/$wait_latency_cpu/cpufreq/$gov ]; then > sampling_rate=$(cat > $CPU_PATH/$wait_latency_cpu/cpufreq/$gov/sampling_rate) > - else > + elif [ -e $CPU_PATH/cpufreq/$gov/sampling_rate ]; then > sampling_rate=$(cat $CPU_PATH/cpufreq/$gov/sampling_rate) > + else > + sampling_rate=0 > fi > sampling_rate=$((sampling_rate * 1000)) # unit nsec >
Hmm, let us think about this a bit. In what situation will be not find a sampling rate for the governor? In the case where we are NOT using ondemand governor. This is expected on Android which uses the interactive governor. So the entire wait_latency() function is going to return somewhat incorrect values when run on Android. I suggest the following removing this patch from the series and properly fixing this problem by doing tests on ubuntu and android with ondemand and interactive respectively to figure out what variables should be read to get the sampling rate. _______________________________________________ linaro-dev mailing list linaro-dev@lists.linaro.org http://lists.linaro.org/mailman/listinfo/linaro-dev