summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel Díaz <daniel.diaz@linaro.org>2018-04-12 18:12:28 +0300
committerShuah Khan (Samsung OSG) <shuah@kernel.org>2018-05-31 00:29:07 +0300
commit7b04d1e9c6d08b9f033f16ccc0394f86f00f33ef (patch)
treebdb24f63aad034702c5754150510d0728725e4ae
parente9d33f149f52981fd856a0b16aa8ebda89b02e34 (diff)
downloadlinux-7b04d1e9c6d08b9f033f16ccc0394f86f00f33ef.tar.xz
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>
-rwxr-xr-xtools/testing/selftests/intel_pstate/run.sh16
1 files changed, 13 insertions, 3 deletions
diff --git a/tools/testing/selftests/intel_pstate/run.sh b/tools/testing/selftests/intel_pstate/run.sh
index 928978804342..8576f6564307 100755
--- a/tools/testing/selftests/intel_pstate/run.sh
+++ b/tools/testing/selftests/intel_pstate/run.sh
@@ -95,18 +95,28 @@ done
[ $EVALUATE_ONLY -eq 0 ] && cpupower frequency-set -g powersave --max=${max_freq}MHz >& /dev/null
-echo "=============================================================================="
+echo "========================================================================"
echo "The marketing frequency of the cpu is $mkt_freq MHz"
echo "The maximum frequency of the cpu is $max_freq MHz"
echo "The minimum frequency of the cpu is $min_freq MHz"
# make a pretty table
-echo "Target Actual Difference MSR(0x199) max_perf_pct"
+echo "Target Actual Difference MSR(0x199) max_perf_pct" | tr " " "\n" > /tmp/result.tab
for freq in `seq $max_freq -100 $min_freq`
do
result_freq=$(cat /tmp/result.${freq} | grep "cpu MHz" | awk ' { print $4 } ' | awk -F "." ' { print $1 } ')
msr=$(cat /tmp/result.${freq} | grep "msr" | awk ' { print $3 } ')
max_perf_pct=$(cat /tmp/result.${freq} | grep "max_perf_pct" | awk ' { print $2 } ' )
- echo " $freq $result_freq $(($result_freq-$freq)) $msr $(($max_perf_pct*$max_freq))"
+ cat >> /tmp/result.tab << EOF
+$freq
+$result_freq
+$((result_freq - freq))
+$msr
+$((max_perf_pct * max_freq))
+EOF
done
+
+# print the table
+pr -aTt -5 < /tmp/result.tab
+
exit 0