Skip to content

Commit a930850

Browse files
tweksteentorvalds
authored andcommitted
scripts/gdb: add ps command
Signed-off-by: Thiébaud Weksteen <[email protected]> Signed-off-by: Jan Kiszka <[email protected]> Signed-off-by: Andrew Morton <[email protected]> Signed-off-by: Linus Torvalds <[email protected]>
1 parent 6ad18b7 commit a930850

1 file changed

Lines changed: 16 additions & 0 deletions

File tree

scripts/gdb/linux/tasks.py

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,22 @@ def invoke(self, pid):
6767
LxTaskByPidFunc()
6868

6969

70+
class LxPs(gdb.Command):
71+
"""Dump Linux tasks."""
72+
73+
def __init__(self):
74+
super(LxPs, self).__init__("lx-ps", gdb.COMMAND_DATA)
75+
76+
def invoke(self, arg, from_tty):
77+
for task in task_lists():
78+
gdb.write("{address} {pid} {comm}\n".format(
79+
address=task,
80+
pid=task["pid"],
81+
comm=task["comm"].string()))
82+
83+
LxPs()
84+
85+
7086
thread_info_type = utils.CachedType("struct thread_info")
7187

7288
ia64_task_size = None

0 commit comments

Comments
 (0)