From f5f9c84ed570ce62dbec22c6224d4c4a274d3a0f Mon Sep 17 00:00:00 2001 From: qwang59 Date: Fri, 19 Jul 2024 22:30:06 +0800 Subject: [PATCH] Add 4 isst perf profile level change case by cgroup v2 Signed-off-by: qwang59 --- BM/isst/intel_sst.sh | 68 ++++++++++++++++++++++++++++++++++++++++++++ BM/isst/tests | 10 +++++-- 2 files changed, 76 insertions(+), 2 deletions(-) diff --git a/BM/isst/intel_sst.sh b/BM/isst/intel_sst.sh index 6f901a97..d515c429 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 3df7035f..2171942b 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