Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F137476069
D27824.id81439.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Flag For Later
Award Token
Size
1 KB
Referenced Files
None
Subscribers
None
D27824.id81439.diff
View Options
Index: sys/ddb/db_ps.c
===================================================================
--- sys/ddb/db_ps.c
+++ sys/ddb/db_ps.c
@@ -107,7 +107,7 @@
db_ps(db_expr_t addr, bool hasaddr, db_expr_t count, char *modif)
{
struct proc *p;
- int i, j;
+ int i;
ps_mode = modif[0] == 'a' ? PRINT_ARGS : PRINT_NONE;
@@ -125,14 +125,12 @@
db_ps_proc(p);
/*
- * Do zombies.
+ * Processes such as zombies not in allproc.
*/
- 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);
- }
+ for (i = 0; i <= pidhash && !db_pager_quit; i++) {
+ LIST_FOREACH(p, &pidhashtbl[i], p_hash) {
+ if ((p->p_flag2 & P2_ALLPROC_REMOVED) != 0)
+ db_ps_proc(p);
}
}
}
Index: sys/kern/kern_exit.c
===================================================================
--- sys/kern/kern_exit.c
+++ sys/kern/kern_exit.c
@@ -440,6 +440,7 @@
sx_xlock(&proctree_lock);
PROC_LOCK(p);
+ p->p_flag2 |= P2_ALLPROC_REMOVED;
p->p_flag &= ~(P_TRACED | P_PPWAIT | P_PPTRACE);
PROC_UNLOCK(p);
Index: sys/sys/proc.h
===================================================================
--- sys/sys/proc.h
+++ sys/sys/proc.h
@@ -811,6 +811,7 @@
MAP_STACK */
#define P2_STKGAP_DISABLE_EXEC 0x00001000 /* Stack gap disabled
after exec */
+#define P2_ALLPROC_REMOVED 0x00002000 /* Removed from allproc list. */
/* Flags protected by proctree_lock, kept in p_treeflags. */
#define P_TREE_ORPHANED 0x00000001 /* Reparented, on orphan list */
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Mon, Nov 24, 7:50 PM (14 m, 29 s)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
26072812
Default Alt Text
D27824.id81439.diff (1 KB)
Attached To
Mode
D27824: ddb ps: Use the pidhash to enumerate processes not in allproc.
Attached
Detach File
Event Timeline
Log In to Comment