Date: Wed, 29 May 2002 12:51:47 -0700 (PDT) From: Julian Elischer <julian@FreeBSD.org> To: Perforce Change Reviews <perforce@freebsd.org> Subject: PERFORCE change 12095 for review Message-ID: <200205291951.g4TJplr81442@freefall.freebsd.org>
next in thread | raw e-mail | index | archive | help
http://people.freebsd.org/~peter/p4db/chv.cgi?CH=12095 Change 12095 by julian@julian_ref on 2002/05/29 12:51:08 Report process status as if we were an old-type process (no threads) Need a new API/ABI for threaded processes. Affected files ... ... //depot/projects/kse/sys/kern/kern_proc.c#61 edit ... //depot/projects/kse/sys/sys/proc.h#103 edit Differences ... ==== //depot/projects/kse/sys/kern/kern_proc.c#61 (text+ko) ==== @@ -726,7 +726,26 @@ sizeof(kp->ki_mtxname) - 1); } } - kp->ki_stat = p->p_state; /* XXXKSE Doesn't MAP */ + + if (p->p_state == PRS_NORMAL) { /* XXXKSE very aproximate */ + if ((td->td_state == TDS_RUN) || + (td->td_state == TDS_RUNNING) { + kp->ki_stat = SRUN; + } else if (td->td_state == TDS_SLEEP) { + kp->ki_stat = SSLEEP; + } else if (P_SHOULDSTOP(p)) { + kp->ki_stat = SSTOP; + } else if (td->td_state == TDS_MTX) { + kp->ki_stat = SMTX; + } else { + kp->ki_stat = SWAIT; + } + } else (p->p_state == PRS_ZOMBIE) { + kp->ki_stat = SZOMB; + } else { + kp->ki_stat = SIDL; + } + kp->ki_sflag = p->p_sflag; kp->ki_swtime = p->p_swtime; kp->ki_traceflag = p->p_traceflag; ==== //depot/projects/kse/sys/sys/proc.h#103 (text+ko) ==== @@ -563,6 +563,8 @@ #define SSLEEP 3 /* Sleeping on an address. */ #define SSTOP 4 /* Process debugging or suspension. */ #define SZOMB 5 /* Awaiting collection by parent. */ +#define SWAIT 6 /* Waiting for interrupt. */ +#define SMTX 7 /* Blocked on a mutex. */ #endif #define P_MAGIC 0xbeefface To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe p4-projects" in the body of the message
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200205291951.g4TJplr81442>