Skip to content

Commit 4fbe310

Browse files
riteshharjanitorvalds
authored andcommitted
scripts/gdb/tasks: add headers and improve spacing format
With the patch. <e.g. o/p> TASK PID COMM 0xffffffff82c2b8c0 0 swapper/0 0xffff888a0ba20040 1 systemd 0xffff888a0ba24040 2 kthreadd 0xffff888a0ba28040 3 rcu_gp w/o 0xffffffff82c2b8c0 <init_task> 0 swapper/0 0xffff888a0ba20040 1 systemd 0xffff888a0ba24040 2 kthreadd 0xffff888a0ba28040 3 rcu_gp Signed-off-by: Ritesh Harjani <riteshh@linux.ibm.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Reviewed-by: Jan Kiszka <jan.kiszka@siemens.com> Cc: Kieran Bingham <kbingham@kernel.org> Link: http://lkml.kernel.org/r/54c868c79b5fc364a8be7799891934a6fe6d1464.1597742951.git.riteshh@linux.ibm.com Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
1 parent 998ec76 commit 4fbe310

1 file changed

Lines changed: 5 additions & 4 deletions

File tree

scripts/gdb/linux/tasks.py

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -73,11 +73,12 @@ def __init__(self):
7373
super(LxPs, self).__init__("lx-ps", gdb.COMMAND_DATA)
7474

7575
def invoke(self, arg, from_tty):
76+
gdb.write("{:>10} {:>12} {:>7}\n".format("TASK", "PID", "COMM"))
7677
for task in task_lists():
77-
gdb.write("{address} {pid} {comm}\n".format(
78-
address=task,
79-
pid=task["pid"],
80-
comm=task["comm"].string()))
78+
gdb.write("{} {:^5} {}\n".format(
79+
task.format_string().split()[0],
80+
task["pid"].format_string(),
81+
task["comm"].string()))
8182

8283

8384
LxPs()

0 commit comments

Comments
 (0)