Changeset View
Changeset View
Standalone View
Standalone View
sys/ddb/db_ps.c
Show First 20 Lines • Show All 101 Lines • ▼ Show 20 Lines | |||||
* | * | ||||
* For machines with 64-bit pointers, we expand the wchan field 8 more | * For machines with 64-bit pointers, we expand the wchan field 8 more | ||||
* characters. | * characters. | ||||
*/ | */ | ||||
void | void | ||||
db_ps(db_expr_t addr, bool hasaddr, db_expr_t count, char *modif) | db_ps(db_expr_t addr, bool hasaddr, db_expr_t count, char *modif) | ||||
{ | { | ||||
struct proc *p; | struct proc *p; | ||||
int i, j; | int i; | ||||
ps_mode = modif[0] == 'a' ? PRINT_ARGS : PRINT_NONE; | ps_mode = modif[0] == 'a' ? PRINT_ARGS : PRINT_NONE; | ||||
#ifdef __LP64__ | #ifdef __LP64__ | ||||
db_printf(" pid ppid pgrp uid state wmesg wchan cmd\n"); | db_printf(" pid ppid pgrp uid state wmesg wchan cmd\n"); | ||||
#else | #else | ||||
db_printf(" pid ppid pgrp uid state wmesg wchan cmd\n"); | db_printf(" pid ppid pgrp uid state wmesg wchan cmd\n"); | ||||
#endif | #endif | ||||
if (!LIST_EMPTY(&allproc)) | for (i = 0; i <= pidhash && !db_pager_quit; i++) { | ||||
p = LIST_FIRST(&allproc); | LIST_FOREACH(p, &pidhashtbl[i], p_hash) { | ||||
else | |||||
p = &proc0; | |||||
for (; p != NULL && !db_pager_quit; p = LIST_NEXT(p, p_list)) | |||||
db_ps_proc(p); | db_ps_proc(p); | ||||
/* | |||||
* Do zombies. | |||||
*/ | |||||
for (i = 0; i < pidhashlock + 1 && !db_pager_quit; i++) { | |||||
for (j = i; j <= pidhash && !db_pager_quit; j += pidhashlock + 1) { | |||||
LIST_FOREACH(p, &pidhashtbl[j], p_hash) { | |||||
if (p->p_state == PRS_ZOMBIE) | |||||
db_ps_proc(p); | |||||
} | |||||
} | } | ||||
} | } | ||||
} | } | ||||
static void | static void | ||||
db_ps_proc(struct proc *p) | db_ps_proc(struct proc *p) | ||||
{ | { | ||||
volatile struct proc *pp; | volatile struct proc *pp; | ||||
▲ Show 20 Lines • Show All 393 Lines • Show Last 20 Lines |