Skip to content

Commit

Permalink
s390/test_unwind: add "backtrace" module parameter
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Vasily Gorbik committed Mar 1, 2022
1 parent 93bd323 commit 8a0c970
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion arch/s390/lib/test_unwind.c
Original file line number Diff line number Diff line change
Expand Up @@ -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
*/
Expand Down Expand Up @@ -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;
Expand Down

0 comments on commit 8a0c970

Please sign in to comment.