提交 a930850b 编写于 作者: T Thiébaud Weksteen 提交者: Linus Torvalds

scripts/gdb: add ps command

Signed-off-by: NThiébaud Weksteen <thiebaud@weksteen.fr>
Signed-off-by: NJan Kiszka <jan.kiszka@siemens.com>
Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
上级 6ad18b73
...@@ -67,6 +67,22 @@ return that task_struct variable which PID matches.""" ...@@ -67,6 +67,22 @@ return that task_struct variable which PID matches."""
LxTaskByPidFunc() LxTaskByPidFunc()
class LxPs(gdb.Command):
"""Dump Linux tasks."""
def __init__(self):
super(LxPs, self).__init__("lx-ps", gdb.COMMAND_DATA)
def invoke(self, arg, from_tty):
for task in task_lists():
gdb.write("{address} {pid} {comm}\n".format(
address=task,
pid=task["pid"],
comm=task["comm"].string()))
LxPs()
thread_info_type = utils.CachedType("struct thread_info") thread_info_type = utils.CachedType("struct thread_info")
ia64_task_size = None ia64_task_size = None
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册