OSDN Git Service

selftests: Print the test we're running to /dev/kmsg
authorMichael Ellerman <mpe@ellerman.id.au>
Fri, 23 Mar 2018 09:44:27 +0000 (20:44 +1100)
committerShuah Khan <shuahkh@osg.samsung.com>
Mon, 26 Mar 2018 20:54:19 +0000 (14:54 -0600)
Some tests cause the kernel to print things to the kernel log
buffer (ie. printk), in particular oops and warnings etc. However when
running all the tests in succession it's not always obvious which
test(s) caused the kernel to print something.

We can narrow it down by printing which test directory we're running
in to /dev/kmsg, if it's writable.

Example output:

  [  170.149149] kselftest: Running tests in powerpc
  [  305.300132] kworker/dying (71) used greatest stack depth: 7776 bytes
                 left
  [  808.915456] kselftest: Running tests in pstore

Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
Signed-off-by: Shuah Khan <shuahkh@osg.samsung.com>
tools/testing/selftests/Makefile

index a41b4be..f4dfee6 100644 (file)
@@ -138,6 +138,7 @@ ifdef INSTALL_PATH
                echo "echo ; echo TAP version 13" >> $(ALL_SCRIPT);     \
                echo "echo Running tests in $$TARGET" >> $(ALL_SCRIPT); \
                echo "echo ========================================" >> $(ALL_SCRIPT); \
+               echo "[ -w /dev/kmsg ] && echo \"kselftest: Running tests in $$TARGET\" >> /dev/kmsg" >> $(ALL_SCRIPT); \
                echo "cd $$TARGET" >> $(ALL_SCRIPT); \
                make -s --no-print-directory OUTPUT=$$BUILD_TARGET -C $$TARGET emit_tests >> $(ALL_SCRIPT); \
                echo "cd \$$ROOT" >> $(ALL_SCRIPT); \