hc
2024-10-09 05e59e5fb0064c97a1c10921ecd549f2d4a58565
kernel/scripts/gdb/linux/tasks.py
....@@ -73,11 +73,13 @@
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()))
82
+
8183
8284 LxPs()
8385
....@@ -134,4 +136,5 @@
134136 else:
135137 raise gdb.GdbError("No task of PID " + str(pid))
136138
139
+
137140 LxThreadInfoByPidFunc()