aboutsummaryrefslogtreecommitdiffstats
path: root/scripts/gdb/linux/tasks.py
diff options
context:
space:
mode:
authorXi Kangjie <imxikangjie@gmail.com>2018-01-18 19:34:00 -0500
committerLinus Torvalds <torvalds@linux-foundation.org>2018-01-19 13:09:41 -0500
commit883d50f56d263f70fd73c0d96b09eb36c34e9305 (patch)
tree02e9e827233616e37837735b7a61b62c77d97f55 /scripts/gdb/linux/tasks.py
parentbe9fa663d325a102de53c9ab6d00a31dcb36bb73 (diff)
scripts/gdb/linux/tasks.py: fix get_thread_info
Since kernel 4.9, the thread_info has been moved into task_struct, no longer locates at the bottom of kernel stack. See commits c65eacbe290b ("sched/core: Allow putting thread_info into task_struct") and 15f4eae70d36 ("x86: Move thread_info into task_struct"). Before fix: (gdb) set $current = $lx_current() (gdb) p $lx_thread_info($current) $1 = {flags = 1470918301} (gdb) p $current.thread_info $2 = {flags = 2147483648} After fix: (gdb) p $lx_thread_info($current) $1 = {flags = 2147483648} (gdb) p $current.thread_info $2 = {flags = 2147483648} Link: http://lkml.kernel.org/r/20180118210159.17223-1-imxikangjie@gmail.com Fixes: 15f4eae70d36 ("x86: Move thread_info into task_struct") Signed-off-by: Xi Kangjie <imxikangjie@gmail.com> Acked-by: Jan Kiszka <jan.kiszka@siemens.com> Acked-by: Kieran Bingham <kbingham@kernel.org> Cc: <stable@vger.kernel.org> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'scripts/gdb/linux/tasks.py')
-rw-r--r--scripts/gdb/linux/tasks.py2
1 files changed, 2 insertions, 0 deletions
diff --git a/scripts/gdb/linux/tasks.py b/scripts/gdb/linux/tasks.py
index 1bf949c43b76..f6ab3ccf698f 100644
--- a/scripts/gdb/linux/tasks.py
+++ b/scripts/gdb/linux/tasks.py
@@ -96,6 +96,8 @@ def get_thread_info(task):
96 thread_info_addr = task.address + ia64_task_size 96 thread_info_addr = task.address + ia64_task_size
97 thread_info = thread_info_addr.cast(thread_info_ptr_type) 97 thread_info = thread_info_addr.cast(thread_info_ptr_type)
98 else: 98 else:
99 if task.type.fields()[0].type == thread_info_type.get_type():
100 return task['thread_info']
99 thread_info = task['stack'].cast(thread_info_ptr_type) 101 thread_info = task['stack'].cast(thread_info_ptr_type)
100 return thread_info.dereference() 102 return thread_info.dereference()
101 103