[Crash-utility] [PATCH] s390x: Add support for CONFIG_THREAD_INFO_IN_TASK

Michael Holzheu holzheu at linux.vnet.ibm.com
Thu Nov 10 19:31:57 UTC 2016


For s390x we still use OFFSET(task_struct_thread_info) to find out
the stack base. Since crash commit c9f932440bd06f0 which added support
for the new CONFIG_THREAD_INFO_IN_TASK configuration (Linux 4.9-rc1)
this is no longer possible.

So fix this and use the generic task_to_stackbase() to find the stack
base instead.

Without the patch the stack backtrace for running tasks (bt -a) can be
incomplete.

Signed-off-by: Michael Holzheu <holzheu at linux.vnet.ibm.com>
---
 s390x.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/s390x.c b/s390x.c
index 8e9cafa..e13bd59 100644
--- a/s390x.c
+++ b/s390x.c
@@ -1304,8 +1304,7 @@ static void s390x_back_trace_cmd(struct bt_info *bt)
 	 * Print task stack
 	 */
 	if (THIS_KERNEL_VERSION >= LINUX(2, 6, 0)) {
-		readmem(bt->task + OFFSET(task_struct_thread_info), KVADDR,
-			&low, sizeof(long), "thread info", FAULT_ON_ERROR);
+		low = task_to_stackbase(bt->task);
 	} else {
 		low = bt->task;
 	}
-- 
2.8.4

-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0001-s390x-Add-support-for-CONFIG_THREAD_INFO_IN_TASK.patch
Type: text/x-patch
Size: 1205 bytes
Desc: not available
URL: <http://listman.redhat.com/archives/crash-utility/attachments/20161110/3aefb3a2/attachment.bin>


More information about the Crash-utility mailing list