summaryrefslogtreecommitdiffstats
path: root/sys/ddb/db_ps.c
diff options
context:
space:
mode:
authorjhb <jhb@FreeBSD.org>2009-10-01 19:12:14 +0000
committerjhb <jhb@FreeBSD.org>2009-10-01 19:12:14 +0000
commit81d3ae4acc9a2163ee2f7986b1e4b298bbc2d213 (patch)
treef989604c6e6e7da1869ac206ab654e6a1bdd5da3 /sys/ddb/db_ps.c
parent97f39d2a068ece2692dfbf7cccb93aa21af35266 (diff)
downloadFreeBSD-src-81d3ae4acc9a2163ee2f7986b1e4b298bbc2d213.zip
FreeBSD-src-81d3ae4acc9a2163ee2f7986b1e4b298bbc2d213.tar.gz
Put square backets ([]) around process names for system processes to patch
the behavior of ps(1).
Diffstat (limited to 'sys/ddb/db_ps.c')
-rw-r--r--sys/ddb/db_ps.c14
1 files changed, 10 insertions, 4 deletions
diff --git a/sys/ddb/db_ps.c b/sys/ddb/db_ps.c
index 3f77286..e233a26 100644
--- a/sys/ddb/db_ps.c
+++ b/sys/ddb/db_ps.c
@@ -189,13 +189,19 @@ db_ps(db_expr_t addr, boolean_t hasaddr, db_expr_t count, char *modif)
if (cred != NULL && jailed(cred))
strlcat(state, "J", sizeof(state));
db_printf(" %-6.6s ", state);
- if (p->p_flag & P_HADTHREADS)
+ if (p->p_flag & P_HADTHREADS) {
#ifdef __LP64__
- db_printf(" (threaded) %s\n",
- p->p_comm);
+ db_printf(" (threaded) ");
#else
- db_printf(" (threaded) %s\n", p->p_comm);
+ db_printf(" (threaded) ");
#endif
+ if (p->p_flag & P_SYSTEM)
+ db_printf("[");
+ db_printf("%s", p->p_comm);
+ if (p->p_flag & P_SYSTEM)
+ db_printf("]");
+ db_printf("\n");
+ }
FOREACH_THREAD_IN_PROC(p, td) {
dumpthread(p, td, p->p_flag & P_HADTHREADS);
if (db_pager_quit)
OpenPOWER on IntegriCloud