aboutsummaryrefslogtreecommitdiff
path: root/release/picobsd/tinyware/vm/vm.c
diff options
context:
space:
mode:
authorAndrzej Bialecki <abial@FreeBSD.org>1998-10-29 12:38:06 +0000
committerAndrzej Bialecki <abial@FreeBSD.org>1998-10-29 12:38:06 +0000
commit9f444dbaf9a3498c28228a06692f12875d14c448 (patch)
tree1de43da4c663ad4dc693967652b96129b0ecdd1c /release/picobsd/tinyware/vm/vm.c
parentcbbbd4c330153e493275757fc621048a154f8947 (diff)
downloadsrc-9f444dbaf9a3498c28228a06692f12875d14c448.tar.gz
src-9f444dbaf9a3498c28228a06692f12875d14c448.zip
Fix conversion from pages to kB's.
Noticed by: luigi Obtained from: sources for vmstat(8)
Notes
Notes: svn path=/head/; revision=40729
Diffstat (limited to 'release/picobsd/tinyware/vm/vm.c')
-rw-r--r--release/picobsd/tinyware/vm/vm.c21
1 files changed, 13 insertions, 8 deletions
diff --git a/release/picobsd/tinyware/vm/vm.c b/release/picobsd/tinyware/vm/vm.c
index 710cfb971532..cd744952f76f 100644
--- a/release/picobsd/tinyware/vm/vm.c
+++ b/release/picobsd/tinyware/vm/vm.c
@@ -23,7 +23,7 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
- * $Id: vm.c,v 1.1.1.1 1998/07/14 07:30:54 abial Exp $
+ * $Id: vm.c,v 1.1.1.1 1998/08/27 17:38:45 abial Exp $
*/
#include <stdio.h>
@@ -32,6 +32,8 @@
#include <sys/vmmeter.h>
#include <vm/vm_param.h>
+#define pgtok(a) ((a) * (u_int) DEFAULT_PAGE_SIZE >> 10)
+
int
main(int argc, char *argv[])
{
@@ -44,14 +46,17 @@ main(int argc, char *argv[])
for(;;) {
sysctl(mib,2,&v,&len,NULL,0);
if(i==0) {
- printf(" procs kB virt mem real mem shared vm shared real free\n");
- printf(" r d p s tot act tot act tot act tot act\n");
+ printf(" procs kB virt mem real mem shared vm shared real free\n");
+ printf(" r w l s tot act tot act tot act tot act\n");
}
- printf("%2hu%2hu%2hu%2hu",v.t_rq,v.t_dw,v.t_pw,v.t_sl);
- printf("%7u%7u%7u%7u",
- v.t_vm<<2,v.t_avm<<2,v.t_rm<<2,v.t_arm<<2);
- printf("%7u%7u%7u%7u%7u\n",
- v.t_vmshr<<2,v.t_avmshr<<2,v.t_rmshr<<2,v.t_armshr<<2,v.t_free<<2);
+ printf("%2hu%2hu%2hu%2hu",v.t_rq-1,v.t_dw+v.t_pw,v.t_sl,v.t_sw);
+ printf("%7ld %7ld %7ld%7ld",
+ (long)pgtok(v.t_vm),(long)pgtok(v.t_avm),
+ (long)pgtok(v.t_rm),(long)pgtok(v.t_arm));
+ printf("%7ld%7ld%7ld%7ld%7ld\n",
+ (long)pgtok(v.t_vmshr),(long)pgtok(v.t_avmshr),
+ (long)pgtok(v.t_rmshr),(long)pgtok(v.t_armshr),
+ (long)pgtok(v.t_free));
sleep(5);
i++;
if(i>22) i=0;