summaryrefslogtreecommitdiffstats
path: root/usr.bin/systat
diff options
context:
space:
mode:
authormckusick <mckusick@FreeBSD.org>2000-12-12 07:25:57 +0000
committermckusick <mckusick@FreeBSD.org>2000-12-12 07:25:57 +0000
commitcba301121bc106aaff382428a55f31fef30844e6 (patch)
tree910e5652e5d16d5d0d4e8480f7e386aaf0ca310e /usr.bin/systat
parentd577ae457b219ac16b4e152a40ae4d7474c4622f (diff)
downloadFreeBSD-src-cba301121bc106aaff382428a55f31fef30844e6.zip
FreeBSD-src-cba301121bc106aaff382428a55f31fef30844e6.tar.gz
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.
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 3443ede..1086920 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));
}
/*
OpenPOWER on IntegriCloud