Lines Matching +full:test +full:- +full:cpu

2 # SPDX-License-Identifier: GPL-2.0
4 # This test runs on Intel x86 based hardware which support the intel_pstate
5 # driver. The test checks the frequency settings from the maximum turbo
7 # test runs the aperf.c program to put load on each processor.
13 # pstate the cpu is in, and the value of
14 # /sys/devices/system/cpu/intel_pstate/max_perf_pct X maximum turbo state
22 #/tmp/result.3100:1:cpu MHz : 2899.980
23 #/tmp/result.3100:2:cpu MHz : 2900.000
27 # and the test will error out in those cases. The result.X file can be checked
29 # files can be re-evaluated by setting EVALUATE_ONLY to 1 below.
33 # Kselftest framework requirement - SKIP code is 4.
36 if ! uname -m | sed -e s/i.86/x86/ -e s/x86_64/x86/ | grep -q x86; then
37 echo "$0 # Skipped: Test can only run on x86 architectures."
47 if ! command -v cpupower &> /dev/null; then
52 max_cpus=$(($(nproc)-1))
57 for cpu in `seq 0 $max_cpus`
59 echo "launching aperf load on $cpu"
60 ./aperf $cpu &
65 grep MHz /proc/cpuinfo | sort -u > /tmp/result.freqs
66 num_freqs=$(wc -l /tmp/result.freqs | awk ' { print $1 } ')
67 if [ $num_freqs -ge 2 ]; then
68 tail -n 1 /tmp/result.freqs > /tmp/result.$1
74 max_perf_pct=$(cat /sys/devices/system/cpu/intel_pstate/max_perf_pct)
77 for job in `jobs -p`
89 _mkt_freq=$(cat /proc/cpuinfo | grep -m 1 "model name" | awk '{print $NF}')
90 _mkt_freq=$(echo $_mkt_freq | tr -d [:alpha:][:punct:])
94 _min_freq=$(cpupower frequency-info -l | tail -1 | awk ' { print $1 } ')
96 _max_freq=$(cpupower frequency-info -l | tail -1 | awk ' { print $2 } ')
100 [ $EVALUATE_ONLY -eq 0 ] && for freq in `seq $max_freq -100 $min_freq`
103 cpupower frequency-set -g powersave --max=${freq}MHz >& /dev/null
107 [ $EVALUATE_ONLY -eq 0 ] && cpupower frequency-set -g powersave --max=${max_freq}MHz >& /dev/null
110 echo "The marketing frequency of the cpu is $mkt_freq MHz"
111 echo "The maximum frequency of the cpu is $max_freq MHz"
112 echo "The minimum frequency of the cpu is $min_freq MHz"
116 for freq in `seq $max_freq -100 $min_freq`
118 …result_freq=$(cat /tmp/result.${freq} | grep "cpu MHz" | awk ' { print $4 } ' | awk -F "." ' { pri…
124 $((result_freq - freq))
131 pr -aTt -5 < /tmp/result.tab