aboutsummaryrefslogtreecommitdiff
path: root/usr.bin/systat
diff options
context:
space:
mode:
authorKirk McKusick <mckusick@FreeBSD.org>2000-12-12 07:25:57 +0000
committerKirk McKusick <mckusick@FreeBSD.org>2000-12-12 07:25:57 +0000
commit1f7d2501824fda6eed4bd2c81b4af3ee052c451a (patch)
tree9528cf76d335e8620128d2a3189901201cd0f526 /usr.bin/systat
parent522b7bcdf6043639be8497bc5ef732d769eff83a (diff)
downloadsrc-1f7d2501824fda6eed4bd2c81b4af3ee052c451a.tar.gz
src-1f7d2501824fda6eed4bd2c81b4af3ee052c451a.zip
Change the proc information returned from the kernel so that it
no longer contains kernel specific data structures, but rather only scalar values and structures that are already part of the kernel/user interface, specifically rusage and rtprio. It no longer contains proc, session, pcred, ucred, procsig, vmspace, pstats, mtx, sigiolst, klist, callout, pasleep, or mdproc. If any of these changed in size, ps, w, fstat, gcore, systat, and top would all stop working. The new structure has over 200 bytes of unassigned space for future values to be added, yet is nearly 100 bytes smaller per entry than the structure that it replaced.
Notes
Notes: svn path=/head/; revision=69896
Diffstat (limited to 'usr.bin/systat')
-rw-r--r--usr.bin/systat/pigs.c16
1 files changed, 6 insertions, 10 deletions
diff --git a/usr.bin/systat/pigs.c b/usr.bin/systat/pigs.c
index 3443ede94d11..1086920ae40a 100644
--- a/usr.bin/systat/pigs.c
+++ b/usr.bin/systat/pigs.c
@@ -44,7 +44,6 @@ static char sccsid[] = "@(#)pigs.c 8.2 (Berkeley) 9/23/93";
#include <sys/param.h>
#include <sys/dkstat.h>
#include <sys/time.h>
-#include <sys/proc.h>
#include <sys/user.h>
#include <sys/sysctl.h>
@@ -91,7 +90,6 @@ void
showpigs()
{
register int i, j, y, k;
- struct eproc *ep;
float total;
int factor;
char *uname, *pname, pidname[30];
@@ -120,9 +118,9 @@ showpigs()
pname = "<idle>";
}
else {
- ep = &pt[k].pt_kp->kp_eproc;
- uname = (char *)user_from_uid(ep->e_ucred.cr_uid, 0);
- pname = pt[k].pt_kp->kp_proc.p_comm;
+ uname = (char *)
+ user_from_uid(pt[k].pt_kp->ki_uid, 0);
+ pname = pt[k].pt_kp->ki_comm;
}
wmove(wnd, y, 0);
wclrtoeol(wnd);
@@ -174,7 +172,6 @@ fetchpigs()
{
register int i;
register float time;
- register struct proc *pp;
register float *pctp;
struct kinfo_proc *kpp;
long ctime[CPUSTATES];
@@ -203,13 +200,12 @@ fetchpigs()
*/
for (i = 0; i < nproc; i++) {
pt[i].pt_kp = &kpp[i];
- pp = &kpp[i].kp_proc;
pctp = &pt[i].pt_pctcpu;
- time = pp->p_swtime;
- if (time == 0 || (pp->p_flag & P_INMEM) == 0)
+ time = kpp[i].ki_swtime;
+ if (time == 0 || (kpp[i].ki_flag & P_INMEM) == 0)
*pctp = 0;
else
- *pctp = ((double) pp->p_pctcpu /
+ *pctp = ((double) kpp[i].ki_pctcpu /
fscale) / (1.0 - exp(time * lccpu));
}
/*