Commit 8a0c9705 authored by Vasily Gorbik's avatar Vasily Gorbik

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: default avatarVasily Gorbik <gor@linux.ibm.com>
parent 93bd3232
...@@ -20,6 +20,10 @@ static struct kunit *current_test; ...@@ -20,6 +20,10 @@ static struct kunit *current_test;
#define BT_BUF_SIZE (PAGE_SIZE * 4) #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 * 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, ...@@ -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"); kunit_err(current_test, "Maximum number of frames exceeded\n");
ret = -EINVAL; ret = -EINVAL;
} }
if (ret) if (ret || force_bt)
print_backtrace(bt); print_backtrace(bt);
kfree(bt); kfree(bt);
return ret; return ret;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment