Skip to content

Commit bb588b2

Browse files
committed
fix: residency-time-test: Check number of pc10 state entries
Check how many times PC10 states was achieved and pass/fail test accordingly. Signed-off-by: Emilia Kurdybelska <emiliax.kurdybelska@intel.com>
1 parent 6cbcd70 commit bb588b2

File tree

1 file changed

+12
-3
lines changed

1 file changed

+12
-3
lines changed

test-case/residency-time-test.sh

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -56,10 +56,12 @@ check_socwatch_module_loaded()
5656
check_for_PC10_state()
5757
{
5858
pc10_count=$(awk '/Package C-State Summary: Entry Counts/{f=1; next} f && /PC10/{print $3; exit}' "$socwatch_output".csv)
59-
if [ -z "$pc10_count" ]; then
60-
die "PC10 State not achieved"
59+
if [ -z "$pc10_count" ] || [ "$pc10_count" -eq 0 ]; then
60+
dlogw "PC10 State not achieved"
61+
else
62+
dlogi "Entered into PC10 State $pc10_count times"
63+
pc10_achieved=true # PC10 state needs to be entered at least once to pass the test
6164
fi
62-
dlogi "Entered into PC10 State $pc10_count times"
6365

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

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

163166
# unload socwatch module
164167
sudo bash "$SOCWATCH_PATH"/drivers/rmmod-socwatch
168+
169+
if "$pc10_achieved"; then
170+
dlogi "PASS: PC10 state entered at least once"
171+
else
172+
die "FAIL: PC10 state NOT ENTERED"
173+
fi
165174
}
166175

167176
main()

0 commit comments

Comments
 (0)