Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

scripts/gdb: add ps command

Signed-off-by: Thiébaud Weksteen <thiebaud@weksteen.fr>
Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>

authored by

Thiébaud Weksteen and committed by
Linus Torvalds
a930850b 6ad18b73

+16
+16
scripts/gdb/linux/tasks.py
··· 67 67 LxTaskByPidFunc() 68 68 69 69 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 + 70 86 thread_info_type = utils.CachedType("struct thread_info") 71 87 72 88 ia64_task_size = None