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 intel_sdsi current_meter cases #228

Merged
merged 3 commits into from
May 27, 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
3 changes: 3 additions & 0 deletions BM/isst/tests
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@
# here assume the platform supports SST perf profile level 0,3,4
# user can adjust the case lists based on the actual SUT SST
# perf profile level support status
# @hw_dep:
# @other_dep:
# @other_warn:


intel_sst.sh -t isst_pp_config_enable_status
Expand Down
3 changes: 3 additions & 0 deletions BM/pt/tests
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
#This file collects the basic test cases for Intel® Processor Trace feature
# @hw_dep:
# @other_dep:
# @other_warn:

# Verify to filter MTC (Mini Time Counter) and TSC (Time-Stamp Counter) package
perf_tests.sh -t fp
Expand Down
70 changes: 70 additions & 0 deletions BM/sdsi/intel_sdsi.sh
Original file line number Diff line number Diff line change
Expand Up @@ -205,6 +205,49 @@ read_meter_tele() {
done
}

# Reading current meter by intel_sdsi tool
# The current_meter is the unattested snapshot of the current metering information
read_meter_current() {
local meter_current

for ((j = 1; j <= "$SOCKET_NUM"; j++)); do
id=$(ls /sys/bus/auxiliary/devices | grep sdsi | awk -F "/" '{print $NF}' | sed -n "$j,1p" | awk -F "." '{print $NF}' 2>&1)
[[ -n "$id" ]] || block_test "SDSI device $id is not available."
test_print_trc "Reading SDSi meter current for socket $id"
if ! meter_current=$(intel_sdsi -d "$id" -C); then
die "Failed to read SDSi meter current for socket $id: $meter_current"
else
test_print_trc "$meter_current"
fi
done
}

# Function to check if meter_current updates for any 2 times reading
meter_current_update() {
local sdsi_device
local meter_current_bf
local meter_current_af

for ((j = 1; j <= "$SOCKET_NUM"; j++)); do
sdsi_device=$(ls /sys/bus/auxiliary/devices | grep sdsi | sed -n "$j,1p")
[[ -n $sdsi_device ]] || block_test "SDSI device is not available."
test_print_trc "Dump meter_current_bf content:"
meter_current_bf=$(xxd /sys/bus/auxiliary/devices/"$sdsi_device"/meter_current)
test_print_trc "$meter_current_bf"
sleep 1
test_print_trc "Dump meter_current_af content:"
meter_current_af=$(xxd /sys/bus/auxiliary/devices/"$sdsi_device"/meter_current)
test_print_trc "$meter_current_af"
if [[ -z "$meter_current_bf" ]] && [[ -z "$meter_current_af" ]]; then
block_test "$sdsi_device meter_current content is empty"
elif [[ "$meter_current_bf" = "$meter_current_af" ]]; then
die "$sdsi_device meter_current content does not change in two times reading."
else
test_print_trc "$sdsi_device meter_current content changes in two times reading."
fi
done
}

stress_read_reg() {
local read_reg
test_print_trc "Repeat reading SDSi register for 30 cycles:"
Expand Down Expand Up @@ -254,6 +297,21 @@ stress_read_tele() {
test_print_trc "$read_tele"
}

stress_read_cur_meter() {
local read_cur
test_print_trc "Repeat reading SDSi current metering for 30 cycles:"
for ((j = 0; j < "$SOCKET_NUM"; j++)); do
for ((i = 1; i <= 30; i++)); do
if ! read_cur=$(intel_sdsi -d "$j" -C); then
die "Repeat reading SDSi current metering for socket $j cycle $i Fails"
else
test_print_trc "Repeat reading current metering for socket $j cycle $i PASS"
fi
done
done
test_print_trc "$read_cur"
}

intel_sdsi_test() {
case $TEST_SCENARIO in
driver_unbind_bind)
Expand All @@ -274,6 +332,9 @@ intel_sdsi_test() {
sysfs_telemetry_attri)
sdsi_sysfs_attribute meter_certificate
;;
sysfs_current_meter_attri)
sdsi_sysfs_attribute meter_current
;;
sdsi_devices)
available_sdsi_devices
;;
Expand All @@ -289,6 +350,12 @@ intel_sdsi_test() {
read_meter_telemetry)
read_meter_tele
;;
read_meter_current)
read_meter_current
;;
verify_meter_current_update)
meter_current_update
;;
stress_reading_reg)
stress_read_reg
;;
Expand All @@ -298,6 +365,9 @@ intel_sdsi_test() {
stress_reading_tele)
stress_read_tele
;;
stress_reading_cur_meter)
stress_read_cur_meter
;;
esac
return 0
}
Expand Down
3 changes: 3 additions & 0 deletions BM/sdsi/sdsi_fms_list
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# Family 06 CPUs from arch/x86/include/asm/intel-family.h
# SPR EMR GNR_X GNR_D
06:8f cf ad ae
7 changes: 7 additions & 0 deletions BM/sdsi/tests
Original file line number Diff line number Diff line change
@@ -1,17 +1,24 @@
# This file collects basic cases which can run against sdsi driver
# on Intel® Architecture-based server platforms.
# @hw_dep: general_test.sh -t fms -p "sdsi_fms_list" @ CPU Model doesn't support sdsi
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi @qwang59 , I don't think this is correct to call the script general_test.sh. The parameter '-p' likely can not accept a file. Could you please check it out? Or I missed something about it..

Copy link
Contributor

@xupengfe xupengfe May 24, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi @ysun and @qwang59 ,
Parameter '-p' could accept a file, just this file has executable right. We don't really use the list file to execute and just detect the list file.
It could work as expected if sdsi_fms_list file has executable right.

Thanks!

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I get it. Thanks.

# @other_dep: general_test.sh -t kconfig -k "CONFIG_INTEL_SDSI=m"
# @other_warn:

intel_sdsi.sh -t driver_unbind_bind
intel_sdsi.sh -t sdsi_sysfs
intel_sdsi.sh -t sdsi_per_socket
intel_sdsi.sh -t sysfs_register_attri
intel_sdsi.sh -t sysfs_certificate_attri
intel_sdsi.sh -t sysfs_telemetry_attri
intel_sdsi.sh -t sysfs_current_meter_attri
intel_sdsi.sh -t sdsi_devices
intel_sdsi.sh -t sdsi_ppin
intel_sdsi.sh -t nvram_content_err_check
intel_sdsi.sh -t enable_status
intel_sdsi.sh -t read_meter_telemetry
intel_sdsi.sh -t verify_meter_current_update
intel_sdsi.sh -t read_meter_current
intel_sdsi.sh -t stress_reading_reg
intel_sdsi.sh -t stress_reading_lic
intel_sdsi.sh -t stress_reading_tele
intel_sdsi.sh -t stress_reading_cur_meter
3 changes: 3 additions & 0 deletions BM/tpmi/tests
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
# This file collects the test cases which can run against intel_tpmi driver
# on Intel® Architecture-based server platforms.
# @hw_dep: general_test.sh -t fms -p "tpmi_fms_list" @ CPU Model doesn't support tpmi
# @other_dep: general_test.sh -t kconfig -k "CONFIG_INTEL_TPMI=m"
# @other_warn:
# Encoding of TPMI_ID(hex):
# 0x0: RAPL - Socket RAPL, DRAM RAPL, Platform RAPL, etc.
# 0x1: PEM - Power and Performance Excursion Monitors
Expand Down
3 changes: 3 additions & 0 deletions BM/tpmi/tpmi_fms_list
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# Family 06 CPUs from arch/x86/include/asm/intel-family.h
# GNR_X GNR_D SRF
06:ad ae af
3 changes: 3 additions & 0 deletions BM/ufs/tests
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
# This file collects basic cases which can run against
# TPMI UFS (Uncore Frequency Scaling) driver
# on Intel® GRANITERAPIDS and further server platforms.
# @hw_dep: general_test.sh -t fms -p "ufs_fms_list" @ CPU Model doesn't support tpmi_ufs
# @other_dep: general_test.sh -t kconfig -k "CONFIG_INTEL_TPMI=m"
# @other_warn:

tpmi_ufs.sh -t check_ufs_unbind_bind
tpmi_ufs.sh -t check_ufs_device
Expand Down
3 changes: 3 additions & 0 deletions BM/ufs/ufs_fms_list
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# Family 06 CPUs from arch/x86/include/asm/intel-family.h
# GNR_X GNR_D SRF
06:ad ae af
Loading