Date: Tue, 20 Mar 2001 10:31:14 +0100 From: Andrea Campi <andrea@webcom.it> To: Robert Watson <rwatson@FreeBSD.org> Cc: cvs-committers@FreeBSD.org, cvs-all@FreeBSD.org Subject: Re: cvs commit: src/usr.bin/top machine.c Message-ID: <20010320103113.A1065@webcom.it> In-Reply-To: <200102231852.f1NIqcs45296@freefall.freebsd.org>; from rwatson@FreeBSD.org on Fri, Feb 23, 2001 at 10:52:38AM -0800 References: <200102231852.f1NIqcs45296@freefall.freebsd.org>
next in thread | previous in thread | raw e-mail | index | archive | help
> Modified files:
> usr.bin/top machine.c
> Log:
> Adapt the top utility to not use kmem_read to retrieve variables now
> available via sysctl(). As a result, top should now be able to run without
> setgid kmem.
>
> Submitted by: Thomas Moestl <tmoestl@gmx.net>
> Reviewed by: freebsd-audit
>
> Revision Changes Path
> 1.37 +44 -167 src/usr.bin/top/machine.c
This commit breaks correct display of memory stats in top. Please try the
enclosed patch; I tested this with tonight's -current.
--- machine.c.orig Tue Mar 20 10:26:56 2001
+++ machine.c Tue Mar 20 10:27:35 2001
@@ -332,7 +332,12 @@
GETSYSCTL("vm.stats.vm.v_swappgsin", nspgsin);
GETSYSCTL("vm.stats.vm.v_swappgsout", nspgsout);
/* convert memory stats to Kbytes */
+ memory_stats[0] = pagetok(memory_stats[0]);
+ memory_stats[1] = pagetok(memory_stats[1]);
+ memory_stats[2] = pagetok(memory_stats[2]);
+ memory_stats[3] = pagetok(memory_stats[3]);
memory_stats[4] = bufspace / 1024;
+ memory_stats[5] = pagetok(memory_stats[5]);
memory_stats[6] = -1;
/* first interval */
--
Tagline generated by 'gensig' mail-client-independent .signature generator.
Get your copy at http://www.geeks.com/~robf/gensig/
To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe cvs-all" in the body of the message
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20010320103113.A1065>
