Use the vm.uvmexp2 sysctl.
This commit is contained in:
parent
5deecf29d2
commit
ba632e7078
|
@ -1,4 +1,4 @@
|
|||
/* $NetBSD: rstat_proc.c,v 1.35 2000/06/29 06:26:33 mrg Exp $ */
|
||||
/* $NetBSD: rstat_proc.c,v 1.36 2000/11/29 11:18:34 simonb Exp $ */
|
||||
|
||||
/*
|
||||
* Sun RPC is a product of Sun Microsystems, Inc. and is provided for
|
||||
|
@ -35,7 +35,7 @@
|
|||
static char sccsid[] = "from: @(#)rpc.rstatd.c 1.1 86/09/25 Copyr 1984 Sun Micro";
|
||||
static char sccsid[] = "from: @(#)rstat_proc.c 2.2 88/08/01 4.0 RPCSRC";
|
||||
#else
|
||||
__RCSID("$NetBSD: rstat_proc.c,v 1.35 2000/06/29 06:26:33 mrg Exp $");
|
||||
__RCSID("$NetBSD: rstat_proc.c,v 1.36 2000/11/29 11:18:34 simonb Exp $");
|
||||
#endif
|
||||
#endif
|
||||
|
||||
|
@ -206,7 +206,7 @@ updatestat(int dummy)
|
|||
int i;
|
||||
size_t len;
|
||||
int mib[2];
|
||||
struct uvmexp uvmexp;
|
||||
struct uvmexp_sysctl uvmexp;
|
||||
struct ifnet ifnet;
|
||||
double avrun[3];
|
||||
struct timeval tm, btm;
|
||||
|
@ -272,10 +272,10 @@ updatestat(int dummy)
|
|||
#endif
|
||||
|
||||
mib[0] = CTL_VM;
|
||||
mib[1] = VM_UVMEXP;
|
||||
mib[1] = VM_UVMEXP2;
|
||||
len = sizeof(uvmexp);
|
||||
if (sysctl(mib, 2, &uvmexp, &len, NULL, 0) < 0) {
|
||||
syslog(LOG_ERR, "can't sysctl vm.uvmexp");
|
||||
syslog(LOG_ERR, "can't sysctl vm.uvmexp2");
|
||||
exit(1);
|
||||
}
|
||||
stats_all.s3.v_pgpgin = uvmexp.fltanget;
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
/* $NetBSD: vmstat.c,v 1.33 2000/07/05 11:03:23 ad Exp $ */
|
||||
/* $NetBSD: vmstat.c,v 1.34 2000/11/29 11:18:33 simonb Exp $ */
|
||||
|
||||
/*-
|
||||
* Copyright (c) 1983, 1989, 1992, 1993
|
||||
|
@ -38,7 +38,7 @@
|
|||
#if 0
|
||||
static char sccsid[] = "@(#)vmstat.c 8.2 (Berkeley) 1/12/94";
|
||||
#endif
|
||||
__RCSID("$NetBSD: vmstat.c,v 1.33 2000/07/05 11:03:23 ad Exp $");
|
||||
__RCSID("$NetBSD: vmstat.c,v 1.34 2000/11/29 11:18:33 simonb Exp $");
|
||||
#endif /* not lint */
|
||||
|
||||
/*
|
||||
|
@ -73,7 +73,7 @@ __RCSID("$NetBSD: vmstat.c,v 1.33 2000/07/05 11:03:23 ad Exp $");
|
|||
|
||||
static struct Info {
|
||||
u_int64_t time[CPUSTATES];
|
||||
struct uvmexp uvmexp;
|
||||
struct uvmexp_sysctl uvmexp;
|
||||
struct vmtotal Total;
|
||||
struct nchstats nchstats;
|
||||
long nchcount;
|
||||
|
@ -594,7 +594,7 @@ getinfo(struct Info *s, enum state st)
|
|||
NREAD(X_INTRCNT, s->intrcnt, nintr * LONG);
|
||||
size = sizeof(s->uvmexp);
|
||||
mib[0] = CTL_VM;
|
||||
mib[1] = VM_UVMEXP;
|
||||
mib[1] = VM_UVMEXP2;
|
||||
if (sysctl(mib, 2, &s->uvmexp, &size, NULL, 0) < 0) {
|
||||
error("can't get uvmexp: %s\n", strerror(errno));
|
||||
memset(&s->uvmexp, 0, sizeof(s->uvmexp));
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
/* $NetBSD: m_netbsd15.c,v 1.10 2000/11/19 01:49:29 sommerfeld Exp $ */
|
||||
/* $NetBSD: m_netbsd15.c,v 1.11 2000/11/29 11:18:33 simonb Exp $ */
|
||||
|
||||
/*
|
||||
* top - a top users display for Unix
|
||||
|
@ -34,7 +34,7 @@
|
|||
* Simon Burge <simonb@netbsd.org>
|
||||
*
|
||||
*
|
||||
* $Id: m_netbsd15.c,v 1.10 2000/11/19 01:49:29 sommerfeld Exp $
|
||||
* $Id: m_netbsd15.c,v 1.11 2000/11/29 11:18:33 simonb Exp $
|
||||
*/
|
||||
|
||||
#include <sys/param.h>
|
||||
|
@ -266,7 +266,7 @@ get_system_info(si)
|
|||
{
|
||||
size_t ssize;
|
||||
int mib[2];
|
||||
struct uvmexp uvmexp;
|
||||
struct uvmexp_sysctl uvmexp;
|
||||
struct swapent *sep, *seporig;
|
||||
u_int64_t totalsize, totalinuse;
|
||||
int size, inuse, ncounted;
|
||||
|
@ -293,10 +293,10 @@ get_system_info(si)
|
|||
percentages64(CPUSTATES, cpu_states, cp_time, cp_old, cp_diff);
|
||||
|
||||
mib[0] = CTL_VM;
|
||||
mib[1] = VM_UVMEXP;
|
||||
mib[1] = VM_UVMEXP2;
|
||||
ssize = sizeof(uvmexp);
|
||||
if (sysctl(mib, 2, &uvmexp, &ssize, NULL, 0) < 0) {
|
||||
fprintf(stderr, "top: sysctl vm.uvmexp failed: %s\n",
|
||||
fprintf(stderr, "top: sysctl vm.uvmexp2 failed: %s\n",
|
||||
strerror(errno));
|
||||
quit(23);
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue