From c77580f3566e63e588ba736f3781c337a3d77355 Mon Sep 17 00:00:00 2001 From: Laurent Pinchart Date: Sat, 19 May 2018 22:54:31 +0300 Subject: 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. Signed-off-by: Laurent Pinchart --- Changes since v1: - Don't clear the kernel log --- scripts/vsp-lib.sh | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/scripts/vsp-lib.sh b/scripts/vsp-lib.sh index 0f3992a..0ecdf9a 100755 --- a/scripts/vsp-lib.sh +++ b/scripts/vsp-lib.sh @@ -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 -- cgit v1.2.3