diff --git a/BM/isst/intel_sst.sh b/BM/isst/intel_sst.sh index 6f901a9..d515c42 100755 --- a/BM/isst/intel_sst.sh +++ b/BM/isst/intel_sst.sh @@ -216,6 +216,62 @@ isst_pp_level_change() { do_cmd "intel-speed-select -o pp.out perf-profile set-config-level -l 0 -o" } +# Function to do different supported perf profile levels change by cgroup v2 solution +# Input: +# $1: select different perf profile level +isst_pp_level_change_cgroup() { + local level_id=$1 + do_cmd "intel-speed-select -o pp.out perf-profile get-config-current-level" + test_print_trc "The system perf profile config current level info:" + do_cmd "cat pp.out" + + cur_level=$(grep get-config-current_level pp.out | awk -F ":" '{print $2}') + cur_level_num=$(grep get-config-current_level pp.out | awk -F ":" '{print $2}' | wc -l) + + test_print_trc "Will change the config level from $cur_level to $level_id:" + do_cmd "intel-speed-select -o pp.out -g perf-profile set-config-level -l $level_id" + test_print_trc "The system perf profile config level change log:" + do_cmd "cat pp.out" + + set_tdp_level_status=$(grep set_tdp_level pp.out | awk -F ":" '{print $2}') + set_tdp_level_status_num=$(grep set_tdp_level pp.out | awk -F ":" '{print $2}' | wc -l) + + for ((i = 1; i <= set_tdp_level_status_num; i++)); do + j=$(("$i" - 1)) + set_tdp_level_status_by_num=$(echo "$set_tdp_level_status" | sed -n "$i, 1p") + if [ "$set_tdp_level_status_by_num" = success ]; then + test_print_trc "The system package $j set tdp level status is $set_tdp_level_status_by_num" + test_print_trc "The system package $j set tdp level success." + else + test_print_trc "The system package $j set tdp level status is $set_tdp_level_status_by_num" + die "The system package $j set tdp level fails" + fi + done + + test_print_trc "Confirm the changed config current level:" + do_cmd "intel-speed-select -o pp.out perf-profile get-config-current-level" + test_print_trc "The system perf profile config current level info:" + do_cmd "cat pp.out" + + cur_level=$(grep get-config-current_level pp.out | awk -F ":" '{print $2}') + cur_level_num=$(grep get-config-current_level pp.out | awk -F ":" '{print $2}' | wc -l) + + for ((i = 1; i <= cur_level_num; i++)); do + j=$(("$i" - 1)) + cur_level_by_num=$(echo "$cur_level" | sed -n "$i, 1p") + if [ "$cur_level_by_num" -eq "$level_id" ]; then + test_print_trc "The system package $j config current level: $cur_level_by_num" + test_print_trc "The system package $j config current level is $level_id after successfully setting" + else + test_print_trc "The system package $j config current level: $cur_level_by_num" + die "The system package $j set tdp level fails" + fi + done + + test_print_trc "Recover the config level to the default setting: 0" + do_cmd "intel-speed-select -o pp.out -g perf-profile set-config-level -l 0" +} + # Function to check the base frequency alignment between sysfs and isst tool for each profile level # Input: # $1: select different perf profile level @@ -837,6 +893,18 @@ isst_test() { isst_pp_config_level4_config) isst_pp_level_change 4 ;; + isst_pp_config_level1_config_cgroup) + isst_pp_level_change_cgroup 1 + ;; + isst_pp_config_level2_config_cgroup) + isst_pp_level_change_cgroup 2 + ;; + isst_pp_config_level3_config_cgroup) + isst_pp_level_change_cgroup 3 + ;; + isst_pp_config_level4_config_cgroup) + isst_pp_level_change_cgroup 4 + ;; isst_base_freq_pp_level1_change) isst_base_freq_pp_level_change 1 ;; diff --git a/BM/isst/tests b/BM/isst/tests index 3df7035..2171942 100755 --- a/BM/isst/tests +++ b/BM/isst/tests @@ -1,6 +1,6 @@ -# This file collects the isst cases for IntelĀ® server platforms +# This file collects the isst cases for IntelĀ® server platforms # here assume the platform supports SST perf profile level 0,3,4 -# user can adjust the case lists based on the actual SUT SST +# user can adjust the case lists based on the actual SUT SST # perf profile level support status # @hw_dep: # @other_dep: @@ -12,8 +12,14 @@ intel_sst.sh -t isst_pp_config_enable_status intel_sst.sh -t isst_legacy_driver_sysfs intel_sst.sh -t isst_cap intel_sst.sh -t isst_unlock_status +intel_sst.sh -t isst_pp_config_level1_config +intel_sst.sh -t isst_pp_config_level2_config intel_sst.sh -t isst_pp_config_level3_config intel_sst.sh -t isst_pp_config_level4_config +intel_sst.sh -t isst_pp_config_level1_config_cgroup +intel_sst.sh -t isst_pp_config_level2_config_cgroup +intel_sst.sh -t isst_pp_config_level3_config_cgroup +intel_sst.sh -t isst_pp_config_level4_config_cgroup intel_sst.sh -t isst_base_freq_pp_level3_change intel_sst.sh -t isst_base_freq_pp_level4_change intel_sst.sh -t isst_cp_enable_prop_type