scripts/gdb/linux/tasks.py: fix get_thread_info
authorXi Kangjie <[email protected]>
Fri, 19 Jan 2018 00:34:00 +0000 (16:34 -0800)
committerLinus Torvalds <[email protected]>
Fri, 19 Jan 2018 18:09:41 +0000 (10:09 -0800)
commit883d50f56d263f70fd73c0d96b09eb36c34e9305
tree02e9e827233616e37837735b7a61b62c77d97f55
parentbe9fa663d325a102de53c9ab6d00a31dcb36bb73
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/[email protected]
Fixes: 15f4eae70d36 ("x86: Move thread_info into task_struct")
Signed-off-by: Xi Kangjie <[email protected]>
Acked-by: Jan Kiszka <[email protected]>
Acked-by: Kieran Bingham <[email protected]>
Cc: <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>
scripts/gdb/linux/tasks.py