Skip to content
Open
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
15 changes: 12 additions & 3 deletions test-case/residency-time-test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -56,10 +56,12 @@ check_socwatch_module_loaded()
check_for_PC10_state()
{
pc10_count=$(awk '/Package C-State Summary: Entry Counts/{f=1; next} f && /PC10/{print $3; exit}' "$socwatch_output".csv)
if [ -z "$pc10_count" ]; then
die "PC10 State not achieved"
if [ -z "$pc10_count" ] || [ "$pc10_count" -eq 0 ]; then
dlogw "PC10 State not achieved"
else
dlogi "Entered into PC10 State $pc10_count times"
pc10_achieved=true # PC10 state needs to be entered at least once to pass the test
fi
dlogi "Entered into PC10 State $pc10_count times"

pc10_per=$(awk '/Package C-State Summary: Residency/{f=1; next} f && /PC10/{print $3; exit}' "$socwatch_output".csv)
pc10_time=$(awk '/Package C-State Summary: Residency/{f=1; next} f && /PC10/{print $5; exit}' "$socwatch_output".csv)
Expand Down Expand Up @@ -145,6 +147,7 @@ run_socwatch_tests()
mkdir "$LOG_ROOT/socwatch-results"
pc10_results_file="$LOG_ROOT/socwatch-results/pc10_results.json"
touch "$pc10_results_file"
pc10_achieved=false

for i in $(seq 1 "$loop_count")
do
Expand All @@ -162,6 +165,12 @@ run_socwatch_tests()

# unload socwatch module
sudo bash "$SOCWATCH_PATH"/drivers/rmmod-socwatch

if "$pc10_achieved"; then
dlogi "PASS: PC10 state entered at least once"
else
die "FAIL: PC10 state NOT ENTERED"
fi
}

main()
Expand Down
Loading