diff options
author | Ingo Molnar <mingo@kernel.org> | 2016-07-08 11:51:28 +0200 |
---|---|---|
committer | Ingo Molnar <mingo@kernel.org> | 2016-07-08 11:51:28 +0200 |
commit | 946e0f6ffcaa614012d646f4cf84efdd62628c8b (patch) | |
tree | 37d31fd748f98ec4fb7897997a2745228bf0c2da /scripts/gdb/linux/tasks.py | |
parent | 67d7a982bab6702d84415ea889996fae72a7d3b2 (diff) | |
parent | a99cde438de0c4c0cecc1d1af1a55a75b10bfdef (diff) |
Merge tag 'v4.7-rc6' into x86/mm, to merge fixes before applying new changes
Signed-off-by: Ingo Molnar <mingo@kernel.org>
Diffstat (limited to 'scripts/gdb/linux/tasks.py')
-rw-r--r-- | scripts/gdb/linux/tasks.py | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/scripts/gdb/linux/tasks.py b/scripts/gdb/linux/tasks.py index 862a4ae24d49..1bf949c43b76 100644 --- a/scripts/gdb/linux/tasks.py +++ b/scripts/gdb/linux/tasks.py @@ -114,3 +114,22 @@ variable.""" LxThreadInfoFunc() + + +class LxThreadInfoByPidFunc (gdb.Function): + """Calculate Linux thread_info from task variable found by pid + +$lx_thread_info_by_pid(PID): Given PID, return the corresponding thread_info +variable.""" + + def __init__(self): + super(LxThreadInfoByPidFunc, self).__init__("lx_thread_info_by_pid") + + def invoke(self, pid): + task = get_task_by_pid(pid) + if task: + return get_thread_info(task.dereference()) + else: + raise gdb.GdbError("No task of PID " + str(pid)) + +LxThreadInfoByPidFunc() |