]> git.baikalelectronics.ru Git - kernel.git/commit
scripts/gdb/linux/tasks.py: fix get_thread_info
authorXi Kangjie <imxikangjie@gmail.com>
Fri, 19 Jan 2018 00:34:00 +0000 (16:34 -0800)
committerLinus Torvalds <torvalds@linux-foundation.org>
Fri, 19 Jan 2018 18:09:41 +0000 (10:09 -0800)
commit37481f867e744c7c9fbbf239d61ef98f34405804
tree02e9e827233616e37837735b7a61b62c77d97f55
parent7f2677f2a3ad09af3fd3b7d1f03d1f4d80dd1d71
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 924ba63e0ea7 ("sched/core: Allow putting thread_info into
task_struct") and ecfce4ba4618 ("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: ecfce4ba4618 ("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>
scripts/gdb/linux/tasks.py