s390/stacktrace: fix save_stack_trace_tsk() for current task
authorHeiko Carstens <heiko.carstens@de.ibm.com>
Sun, 31 Jan 2016 13:23:30 +0000 (14:23 +0100)
committerMartin Schwidefsky <schwidefsky@de.ibm.com>
Wed, 10 Feb 2016 08:25:20 +0000 (09:25 +0100)
commit665ca9187c4087736fa57b0e00bcf33ea601fb6f
treef88c4d75b615a3749a9ab2ac82dcce6ef66e83e2
parent2178cbc68f3602dc0b5949b9be2c8383ad3d93ef
s390/stacktrace: fix save_stack_trace_tsk() for current task

The function save_stack_trace_tsk() did not consider that it can be
used for tsk == current, for which the current stack pointer obviously
cannot be found in the thread structure.

Fix this and get the stack pointer with an inline assembly.

This fixes e.g. the output of "cat /proc/self/stack".

Before:
[<0000000000000000>]           (null)
[<ffffffffffffffff>] 0xffffffffffffffff

After:
[<000000000011b3ee>] save_stack_trace_tsk+0x56/0x98
[<0000000000366cde>] proc_pid_stack+0xae/0x108
[<00000000003636f0>] proc_single_show+0x70/0xc0
[<0000000000311fbc>] seq_read+0xcc/0x448
[<00000000002e7716>] __vfs_read+0x36/0x100
[<00000000002e872e>] vfs_read+0x76/0x130
[<00000000002e975e>] SyS_read+0x66/0xd8
[<000000000089490e>] system_call+0xd6/0x264
[<ffffffffffffffff>] 0xffffffffffffffff

Signed-off-by: Heiko Carstens <heiko.carstens@de.ibm.com>
Tested-by: Peter Oberparleiter <oberpar@linux.vnet.ibm.com>
Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
arch/s390/kernel/stacktrace.c