On Tue, Aug 5, 2014 at 1:39 PM, Sanjay Singh Rawat
<sanjay.ra...@linaro.org> wrote:
> - add the governor sampling rate with the frequency transition latency to
> make sure tansition happens.
> - bug 77

Replace with complete URL: https://bugs.linaro.org/show_bug.cgi?id=77
to make git changelogs much more useful.

> Signed-off-by: Sanjay Singh Rawat <sanjay.ra...@linaro.org>

Looks good.

> ---
>  include/functions.sh | 16 +++++++++++++++-
>  1 file changed, 15 insertions(+), 1 deletion(-)
>
> diff --git a/include/functions.sh b/include/functions.sh
> index 417c725..5823a81 100644
> --- a/include/functions.sh
> +++ b/include/functions.sh
> @@ -123,6 +123,17 @@ wait_latency() {
>      local dirpath=$CPU_PATH/$cpu/cpufreq
>      local latency=
>      local nrfreq=
> +    local sampling_rate=
> +    local sleep_time=
> +    local gov=$(cat $dirpath/scaling_governor)
> +
> +    # consider per-policy governor case
> +    if [ -e $CPU_PATH/$cpu/cpufreq/$gov ]; then
> +       sampling_rate=$(cat $CPU_PATH/$cpu/cpufreq/$gov/sampling_rate)
> +    else
> +        sampling_rate=$(cat $CPU_PATH/cpufreq/$gov/sampling_rate)
> +    fi
> +    sampling_rate=$((sampling_rate * 1000)) # unit nsec
>
>      latency=$(cat $dirpath/cpuinfo_transition_latency)
>      if [ $? -ne 0 ]; then
> @@ -135,7 +146,10 @@ wait_latency() {
>      fi
>
>      nrfreq=$((nrfreq + 1))
> -    ../utils/nanosleep $(($nrfreq * $latency))
> +
> +    sleep_time=$(($latency + $sampling_rate))
> +
> +    ../utils/nanosleep $(($nrfreq * $sleep_time))
>  }
>
>  frequnit() {
> --
> 1.8.3.2
>
>
> _______________________________________________
> linaro-dev mailing list
> linaro-dev@lists.linaro.org
> http://lists.linaro.org/mailman/listinfo/linaro-dev

_______________________________________________
linaro-dev mailing list
linaro-dev@lists.linaro.org
http://lists.linaro.org/mailman/listinfo/linaro-dev

Reply via email to