Skip to contentSkip to conversation

vsp-tests: Fix suspend/resume test

PATCH New Laurent Pinchart 1 participant 3 messages May 21, 2018

lore
Share & tools
lore
#0 lore raw

v2 cover vsp-tests: Fix suspend/resume test

Hello,

This small series fixes the VSP suspend/resume test to ensure that the VSP is running when suspending. The first patch isn't strictly required, but was helpful when debugging the second patch, so I've included it in the series.

Laurent Pinchart (2):
vsp-lib: Capture the kernel log messages in test log files
tests: suspend/resume: Increase number of processed frames

 scripts/vsp-lib.sh          |  6 ++++++
 tests/vsp-unit-test-0020.sh | 15 ++++++++-------
 2 files changed, 14 insertions(+), 7 deletions(-)
Signature · 3 lines
Regards,

Laurent Pinchart
#1 lore raw

PATCH v2 1/2 vsp-lib: Capture the kernel log messages in test log files

It can be useful to capture kernel log messages in test log files for diagnostic purpose. Add a simple mechanism to do so by capturing the full kernel log at the end of the test. The kernel log is cleared first before starting the test to avoid capturing unrelated messages.

---
Changes since v1:

- Don't clear the kernel log

---
 scripts/vsp-lib.sh | 6 ++++++
 1 file changed, 6 insertions(+)
scripts/vsp-lib.sh +6 -0
index 0f3992a7827e..0ecdf9acb152 100755
@@ -1080,12 +1080,18 @@ test_init() {
 test_start() {
 	echo "Testing $1" | ./logger.sh >> $logfile
 	echo -n "Testing $1: " >&2
+
+	# Store the marker for the last line of the kernel log.
+	marker=$(dmesg | tail -n 1 | sed 's/^\[\([^]]*\)\].*/\1/g')
 }
 
 test_complete() {
 	echo "Done: $1" | ./logger.sh >> $logfile
 	echo $1 >&2
 
+	# Capture the part of the kernel log relative to the test.
+	dmesg | sed "1,/$marker/d" | ./logger.sh kernel >> $logfile
+
 	rm -f ${frames_dir}frame-*.bin
 	rm -f ${frames_dir}histo-*.bin
 	rm -f ${frames_dir}rpf.*.bin
Signature · 3 lines
Regards,

Laurent Pinchart
#2 lore raw

PATCH v2 2/2 tests: suspend/resume: Increase number of processed frames

In reply to Laurent Pinchart

The suspend/resume test starts a run of 300 frames and suspends the system one second later. On some SoCs (namely H3 ES2.0) the VSP bandwidth is high enough to complete processing of 300 frames in less than a second. The test thus suspends and resumes the system with the VSP idle instead of running, defeating the purpose of the test.

Fix this by increasing the number of frames to process to 1000. The frame count is now passed as an argument to the test_extended_wpf_packing function to ease future changes.

---
Changes since v1:

- Don't explicitly state at which frame suspend/resume is expected to occur as that's device-dependent

- Compare the last three frames instead of just one

---
 tests/vsp-unit-test-0020.sh | 15 ++++++++-------
 1 file changed, 8 insertions(+), 7 deletions(-)
tests/vsp-unit-test-0020.sh +8 -7
index 91f6b167f22e..c662466b76de 100755
@@ -15,25 +15,26 @@ features="rpf.0 wpf.0"
 # These can be extracted from /sys/power/pm_test
 suspend_modes="freezer devices platform processors core"
 
-# This extended function performs the same
-# as it's non-extended name-sake - but runs the pipeline
-# for 300 frames. The suspend action occurs between frame #150~#200
-
+# This extended function performs the same as it's non-extended name-sake, but
+# runs the pipeline for a configurable number of frames.
 test_extended_wpf_packing() {
 	local format=$1
+	local num_frames=$2
 
 	pipe_configure rpf-wpf 0 0
 	format_configure rpf-wpf 0 0 ARGB32 1024x768 $format
 
-	vsp_runner rpf.0 --count=300 &
-	vsp_runner wpf.0 --count=300 --skip=297
+	vsp_runner rpf.0 --count=$num_frames &
+	vsp_runner wpf.0 --count=$num_frames --skip=$((num_frames-3))
 
 	local result=$(compare_frames)
 	[ x$result == xpass ] && return 0 || return 1
 }
 
 test_hw_pipe() {
-	test_extended_wpf_packing RGB24
+	# Run the pipeline for 1000 frames. The suspend action should occur in
+	# the middle.
+	test_extended_wpf_packing RGB24 1000
 }
 
 test_suspend_resume() {
Signature · 3 lines
Regards,

Laurent Pinchart