aboutsummaryrefslogtreecommitdiffstats
path: root/scripts/gdb/linux/tasks.py
diff options
context:
space:
mode:
authorDaniel Vetter <daniel.vetter@ffwll.ch>2016-06-02 09:54:12 +0200
committerDaniel Vetter <daniel.vetter@ffwll.ch>2016-06-02 09:54:12 +0200
commit5599617ec0719dba3b1f85a4abca2a6c93368ae3 (patch)
tree7d2f9bb6a538ee8ed5cfa391f2cfa72a3e2daa9f /scripts/gdb/linux/tasks.py
parentdrm/i915/skl+: Use scaling amount for plane data rate calculation (v4) (diff)
parentMerge branch 'drm-intel-next' of git://anongit.freedesktop.org/drm-intel into drm-next (diff)
downloadlinux-dev-5599617ec0719dba3b1f85a4abca2a6c93368ae3.tar.xz
linux-dev-5599617ec0719dba3b1f85a4abca2a6c93368ae3.zip
Merge remote-tracking branch 'airlied/drm-next' into drm-intel-next-queued
Git got absolutely destroyed with all our cherry-picking from drm-intel-next-queued to various branches. It ended up inserting intel_crtc_page_flip 2x even in intel_display.c. Backmerge to get back to sanity. Signed-off-by: Daniel Vetter <daniel.vetter@intel.com>
Diffstat (limited to 'scripts/gdb/linux/tasks.py')
-rw-r--r--scripts/gdb/linux/tasks.py19
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()