Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add 4 isst perf profile level change case by cgroup v2 #328

Merged
merged 1 commit into from
Jul 22, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
68 changes: 68 additions & 0 deletions BM/isst/intel_sst.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
;;
Expand Down
10 changes: 8 additions & 2 deletions BM/isst/tests
Original file line number Diff line number Diff line change
@@ -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:
Expand All @@ -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
Expand Down
Loading