Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

selftests/intel_pstate: Enhance table printing

Using coreutils' pr, a nicer table is printed out with the
results.

Signed-off-by: Daniel Díaz <daniel.diaz@linaro.org>
Signed-off-by: Shuah Khan (Samsung OSG) <shuah@kernel.org>

authored by

Daniel Díaz and committed by
Shuah Khan (Samsung OSG)
7b04d1e9 e9d33f14

+13 -3
+13 -3
tools/testing/selftests/intel_pstate/run.sh
··· 95 95 96 96 [ $EVALUATE_ONLY -eq 0 ] && cpupower frequency-set -g powersave --max=${max_freq}MHz >& /dev/null 97 97 98 - echo "==============================================================================" 98 + echo "========================================================================" 99 99 echo "The marketing frequency of the cpu is $mkt_freq MHz" 100 100 echo "The maximum frequency of the cpu is $max_freq MHz" 101 101 echo "The minimum frequency of the cpu is $min_freq MHz" 102 102 103 103 # make a pretty table 104 - echo "Target Actual Difference MSR(0x199) max_perf_pct" 104 + echo "Target Actual Difference MSR(0x199) max_perf_pct" | tr " " "\n" > /tmp/result.tab 105 105 for freq in `seq $max_freq -100 $min_freq` 106 106 do 107 107 result_freq=$(cat /tmp/result.${freq} | grep "cpu MHz" | awk ' { print $4 } ' | awk -F "." ' { print $1 } ') 108 108 msr=$(cat /tmp/result.${freq} | grep "msr" | awk ' { print $3 } ') 109 109 max_perf_pct=$(cat /tmp/result.${freq} | grep "max_perf_pct" | awk ' { print $2 } ' ) 110 - echo " $freq $result_freq $(($result_freq-$freq)) $msr $(($max_perf_pct*$max_freq))" 110 + cat >> /tmp/result.tab << EOF 111 + $freq 112 + $result_freq 113 + $((result_freq - freq)) 114 + $msr 115 + $((max_perf_pct * max_freq)) 116 + EOF 111 117 done 118 + 119 + # print the table 120 + pr -aTt -5 < /tmp/result.tab 121 + 112 122 exit 0