diff options
author | julian <julian@FreeBSD.org> | 2002-06-29 17:26:22 +0000 |
---|---|---|
committer | julian <julian@FreeBSD.org> | 2002-06-29 17:26:22 +0000 |
commit | aa2dc0a5d9e7a19420c153cd414fefa8498eab71 (patch) | |
tree | 0a0483a267784fa8e2bf86857d8727edb5b122e9 /lib | |
parent | 6dbff7f2c1f8150887038aed666e11675adf0b4e (diff) | |
download | FreeBSD-src-aa2dc0a5d9e7a19420c153cd414fefa8498eab71.zip FreeBSD-src-aa2dc0a5d9e7a19420c153cd414fefa8498eab71.tar.gz |
Part 1 of KSE-III
The ability to schedule multiple threads per process
(one one cpu) by making ALL system calls optionally asynchronous.
to come: ia64 and power-pc patches, patches for gdb, test program (in tools)
Reviewed by: Almost everyone who counts
(at various times, peter, jhb, matt, alfred, mini, bernd,
and a cast of thousands)
NOTE: this is still Beta code, and contains lots of debugging stuff.
expect slight instability in signals..
Diffstat (limited to 'lib')
-rw-r--r-- | lib/libkvm/kvm_proc.c | 21 |
1 files changed, 19 insertions, 2 deletions
diff --git a/lib/libkvm/kvm_proc.c b/lib/libkvm/kvm_proc.c index 865377c..547792e 100644 --- a/lib/libkvm/kvm_proc.c +++ b/lib/libkvm/kvm_proc.c @@ -325,11 +325,28 @@ nopgrp: kp->ki_estcpu = proc.p_ksegrp.kg_estcpu; /* XXXKSE */ kp->ki_slptime = proc.p_kse.ke_slptime; /* XXXKSE */ kp->ki_swtime = proc.p_swtime; - kp->ki_flag = proc.p_flag; + kp->ki_flag = proc.p_flag; /* WILDLY INNACURATE XXXKSE */ kp->ki_sflag = proc.p_sflag; kp->ki_wchan = mainthread.td_wchan; /* XXXKSE */ kp->ki_traceflag = proc.p_traceflag; - kp->ki_stat = proc.p_stat; + if (proc.p_state == PRS_NORMAL) { /* XXXKSE very aproximate */ + if ((mainthread.td_state == TDS_RUNQ) || + (mainthread.td_state == TDS_RUNNING)) { + kp->ki_stat = SRUN; + } else if (mainthread.td_state == TDS_SLP) { + kp->ki_stat = SSLEEP; + } else if (P_SHOULDSTOP(&proc)) { + kp->ki_stat = SSTOP; + } else if (mainthread.td_state == TDS_MTX) { + kp->ki_stat = SMTX; + } else { + kp->ki_stat = SWAIT; + } + } else if (proc.p_state == PRS_ZOMBIE) { + kp->ki_stat = SZOMB; + } else { + kp->ki_stat = SIDL; + } kp->ki_pri.pri_class = proc.p_ksegrp.kg_pri_class; /* XXXKSE */ kp->ki_pri.pri_user = proc.p_ksegrp.kg_user_pri; /* XXXKSE */ kp->ki_pri.pri_level = mainthread.td_priority; /* XXXKSE */ |