From 3ce6061907767f51b1f829b99e15f757e81ef614 Mon Sep 17 00:00:00 2001 From: Zach Brown Date: Fri, 13 Dec 2019 11:40:26 -0800 Subject: [PATCH] scoutfs-tests: offer ftrace printk and dump opts Signed-off-by: Zach Brown --- tests/run-tests.sh | 23 ++++++++++++++--------- 1 file changed, 14 insertions(+), 9 deletions(-) diff --git a/tests/run-tests.sh b/tests/run-tests.sh index 469e5889..1287ff66 100755 --- a/tests/run-tests.sh +++ b/tests/run-tests.sh @@ -38,6 +38,7 @@ $(basename $0) options: -a | Abort after the first test failure, leave fs mounted. -d | Specify the storage device path that contains the | file system to be tested. Will be clobbered by -m mkfs. + -D | Dump accumulated ftrace buffer to the console on oops. -E | Exclude tests whose file name matches the regular expression. | Can be provided multiple times -e | Specify an extra storage device for testing. Will be clobbered. @@ -52,12 +53,12 @@ $(basename $0) options: | tests. Implies unmounting existing mounts first. -n | The number of devices and mounts to test. -p | Exit script after preparing mounts only, don't run tests. + -P | Output trace events with printk as they're generated. -q | Specify the quorum count needed to mount. This is | used when running mkfs and is needed by a few tests. -r | Specify the directory in which to store results of | test runs. The directory will be created if it doesn't | exist. Previous results will be deleted as each test runs. - -T | Output trace events with printk. -t | Enabled trace events that match the given glob argument. -U | scouts-utils-dev git repo. Used to build kernel module. -u | Branch to checkout in scoutfs-utils-dev repo. @@ -71,6 +72,10 @@ for v in ${!T_*}; do eval unset $v done +# set some T_ defaults +T_TRACE_DUMP="0" +T_TRACE_PRINTK="0" + while true; do case $1 in -a) @@ -81,6 +86,9 @@ while true; do T_DEVICE="$2" shift ;; + -D) + T_TRACE_DUMP="1" + ;; -E) test -n "$2" || die "-E must have test exclusion regex argument" T_EXCLUDE+="-e '$2' " @@ -120,6 +128,9 @@ while true; do -p) T_PREPARE="1" ;; + -P) + T_TRACE_PRINTK="1" + ;; -q) test -n "$2" || die "-q must have quorum count argument" T_QUORUM="$2" @@ -130,9 +141,6 @@ while true; do T_RESULTS="$2" shift ;; - -T) - T_TRACE_PRINTK="1" - ;; -t) test -n "$2" || die "-t must have trace glob argument" T_TRACE_GLOB="$2" @@ -318,11 +326,8 @@ if [ -n "$T_TRACE_GLOB" ]; then done done - if [ -n "$T_TRACE_PRINTK" ]; then - echo 1 > /sys/kernel/debug/tracing/options/trace_printk - fi - - echo 1 > /proc/sys/kernel/ftrace_dump_on_oops + echo "$T_TRACE_DUMP" > /proc/sys/kernel/ftrace_dump_on_oops + echo "$T_TRACE_PRINTK" > /sys/kernel/debug/tracing/options/trace_printk cmd cat /sys/kernel/debug/tracing/set_event cmd grep . /sys/kernel/debug/tracing/options/trace_printk \