summaryrefslogtreecommitdiffstats
path: root/arch/s390/lib
diff options
context:
space:
mode:
authorVasily Gorbik <gor@linux.ibm.com>2019-11-22 18:52:40 +0100
committerVasily Gorbik <gor@linux.ibm.com>2019-11-30 10:52:48 +0100
commit0610154650f161d56a0bef0d9678ae1de7360019 (patch)
tree79b1b8933d8bc5ac07c50c2961afb0a17a82a05e /arch/s390/lib
parents390/test_unwind: add CALL_ON_STACK tests (diff)
downloadlinux-0610154650f161d56a0bef0d9678ae1de7360019.tar.xz
linux-0610154650f161d56a0bef0d9678ae1de7360019.zip
s390/test_unwind: print verbose unwinding results
Add stack name, sp and reliable information into test unwinding results. Also consider ip outside of kernel text as failure if the state is reported reliable. Acked-by: Heiko Carstens <heiko.carstens@de.ibm.com> Signed-off-by: Vasily Gorbik <gor@linux.ibm.com>
Diffstat (limited to 'arch/s390/lib')
-rw-r--r--arch/s390/lib/test_unwind.c12
1 files changed, 10 insertions, 2 deletions
diff --git a/arch/s390/lib/test_unwind.c b/arch/s390/lib/test_unwind.c
index 687a6922beda..db94e657c056 100644
--- a/arch/s390/lib/test_unwind.c
+++ b/arch/s390/lib/test_unwind.c
@@ -56,11 +56,19 @@ static noinline int test_unwind(struct task_struct *task, struct pt_regs *regs,
unsigned long addr = unwind_get_return_address(&state);
char sym[KSYM_SYMBOL_LEN];
- if (!addr || frame_count == max_frames)
+ if (frame_count++ == max_frames)
break;
+ if (state.reliable && !addr) {
+ pr_err("unwind state reliable but addr is 0\n");
+ return -EINVAL;
+ }
sprint_symbol(sym, addr);
if (bt_pos < BT_BUF_SIZE) {
- bt_pos += snprintf(bt + bt_pos, BT_BUF_SIZE - bt_pos, "%s\n", sym);
+ bt_pos += snprintf(bt + bt_pos, BT_BUF_SIZE - bt_pos,
+ state.reliable ? " [%-7s%px] %pSR\n" :
+ "([%-7s%px] %pSR)\n",
+ stack_type_name(state.stack_info.type),
+ (void *)state.sp, (void *)state.ip);
if (bt_pos >= BT_BUF_SIZE)
pr_err("backtrace buffer is too small\n");
}