* Layout: * - column counts * - header * - single-threaded process * - multi-threaded process * - thread in a MT process * * 1 2 3 4 5 6 7 * 1234567890123456789012345678901234567890123456789012345678901234567890 * pid ppid pgrp uid state wmesg wchan cmd *
| 104 | * characters. |
| 105 | */ |
| 106 | void |
| 107 | db_ps(db_expr_t addr, bool hasaddr, db_expr_t count, char *modif) |
| 108 | { |
| 109 | struct proc *p; |
| 110 | int i; |
| 111 | |
| 112 | ps_mode = modif[0] == 'a' ? PRINT_ARGS : PRINT_NONE; |
| 113 | |
| 114 | #ifdef __LP64__ |
| 115 | db_printf(" pid ppid pgrp uid state wmesg wchan cmd\n"); |
| 116 | #else |
| 117 | db_printf(" pid ppid pgrp uid state wmesg wchan cmd\n"); |
| 118 | #endif |
| 119 | |
| 120 | if (!LIST_EMPTY(&allproc)) |
| 121 | p = LIST_FIRST(&allproc); |
| 122 | else |
| 123 | p = &proc0; |
| 124 | for (; p != NULL && !db_pager_quit; p = LIST_NEXT(p, p_list)) |
| 125 | db_ps_proc(p); |
| 126 | |
| 127 | /* |
| 128 | * Processes such as zombies not in allproc. |
| 129 | */ |
| 130 | for (i = 0; i <= pidhash && !db_pager_quit; i++) { |
| 131 | LIST_FOREACH(p, &pidhashtbl[i], p_hash) { |
| 132 | if (p->p_list.le_prev == NULL) |
| 133 | db_ps_proc(p); |
| 134 | } |
| 135 | } |
| 136 | } |
| 137 | |
| 138 | static void |
| 139 | db_ps_proc(struct proc *p) |
no test coverage detected