summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLaurent Pinchart <laurent.pinchart@ideasonboard.com>2018-05-19 22:54:31 +0300
committerLaurent Pinchart <laurent.pinchart@ideasonboard.com>2018-05-21 12:01:33 +0300
commitc77580f3566e63e588ba736f3781c337a3d77355 (patch)
treea58df336ccc0163000bd372c98f6862b363633e6
parentf347373bfe8857b880f10c8a04a3f5fdd88d0fde (diff)
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 <laurent.pinchart@ideasonboard.com> --- Changes since v1: - Don't clear the kernel log
-rwxr-xr-xscripts/vsp-lib.sh6
1 files changed, 6 insertions, 0 deletions
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