summaryrefslogtreecommitdiff
path: root/arch/s390/lib
diff options
context:
space:
mode:
authorVasily Gorbik <gor@linux.ibm.com>2022-02-01 21:04:16 +0100
committerVasily Gorbik <gor@linux.ibm.com>2022-03-01 21:05:09 +0100
commit8a0c9705502701cc6a5d87d70bc6b631ec939265 (patch)
tree5fccd4577fda22241da4e394f568f4c5f4a5321a /arch/s390/lib
parent93bd3232448f699f47d06590aeb56edfebab4495 (diff)
s390/test_unwind: add "backtrace" module parameter
By default no backtraces are printed when a test succeeds, but sometimes it is useful to spot issues automated test doesn't cover. Add "backtrace" module parameter to force it. Signed-off-by: Vasily Gorbik <gor@linux.ibm.com>
Diffstat (limited to 'arch/s390/lib')
-rw-r--r--arch/s390/lib/test_unwind.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/arch/s390/lib/test_unwind.c b/arch/s390/lib/test_unwind.c
index 744b47692399..8be9ca263127 100644
--- a/arch/s390/lib/test_unwind.c
+++ b/arch/s390/lib/test_unwind.c
@@ -20,6 +20,10 @@ static struct kunit *current_test;
#define BT_BUF_SIZE (PAGE_SIZE * 4)
+static bool force_bt;
+module_param_named(backtrace, force_bt, bool, 0444);
+MODULE_PARM_DESC(backtrace, "print backtraces for all tests");
+
/*
* To avoid printk line limit split backtrace by lines
*/
@@ -98,7 +102,7 @@ static noinline int test_unwind(struct task_struct *task, struct pt_regs *regs,
kunit_err(current_test, "Maximum number of frames exceeded\n");
ret = -EINVAL;
}
- if (ret)
+ if (ret || force_bt)
print_backtrace(bt);
kfree(bt);
return ret;