MCPcopy Create free account
hub / github.com/F-Stack/f-stack / db_ps

Function db_ps

freebsd/ddb/db_ps.c:106–136  ·  view source on GitHub ↗

* 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 *

Source from the content-addressed store, hash-verified

104 * characters.
105 */
106void
107db_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
138static void
139db_ps_proc(struct proc *p)

Callers 1

db_ps.cFile · 0.85

Calls 2

db_printfFunction · 0.85
db_ps_procFunction · 0.85

Tested by

no test coverage detected