Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F137474865
D27824.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.diff
View Options
diff --git a/sys/ddb/db_ps.c b/sys/ddb/db_ps.c
--- a/sys/ddb/db_ps.c
+++ b/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_list.le_prev == NULL)
+ db_ps_proc(p);
}
}
}
diff --git a/sys/kern/kern_exit.c b/sys/kern/kern_exit.c
--- a/sys/kern/kern_exit.c
+++ b/sys/kern/kern_exit.c
@@ -39,6 +39,7 @@
#include <sys/cdefs.h>
__FBSDID("$FreeBSD$");
+#include "opt_ddb.h"
#include "opt_ktrace.h"
#include <sys/param.h>
@@ -436,6 +437,14 @@
*/
sx_xlock(&allproc_lock);
LIST_REMOVE(p, p_list);
+
+#ifdef DDB
+ /*
+ * Used by ddb's 'ps' command to find this process via the
+ * pidhash.
+ */
+ p->p_list.le_prev = NULL;
+#endif
sx_xunlock(&allproc_lock);
sx_xlock(&proctree_lock);
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Mon, Nov 24, 7:37 PM (1 m, 2 s)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
26072267
Default Alt Text
D27824.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