From owner-cvs-all Sat Jan 11 9: 0:27 2003 Delivered-To: cvs-all@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id C3AF737B401; Sat, 11 Jan 2003 09:00:23 -0800 (PST) Received: from mailman.zeta.org.au (mailman.zeta.org.au [203.26.10.16]) by mx1.FreeBSD.org (Postfix) with ESMTP id 7308C43ED8; Sat, 11 Jan 2003 09:00:21 -0800 (PST) (envelope-from bde@zeta.org.au) Received: from katana.zip.com.au (katana.zip.com.au [61.8.7.246]) by mailman.zeta.org.au (8.9.3/8.8.7) with ESMTP id EAA01359; Sun, 12 Jan 2003 04:00:12 +1100 Date: Sun, 12 Jan 2003 04:00:39 +1100 (EST) From: Bruce Evans X-X-Sender: bde@gamplex.bde.org To: Maxime Henrion Cc: Matt Dillon , , Subject: Re: cvs commit: src/sbin/sysctl sysctl.c src/sys/vm vm_meter.c vm_param.h src/usr.bin/systat vmstat.c src/usr.bin/vmstat vmstat.c In-Reply-To: <20030111115116.GA16775@elvis.mu.org> Message-ID: <20030112023654.C3194-100000@gamplex.bde.org> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: owner-cvs-all@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG On Sat, 11 Jan 2003, Maxime Henrion wrote: > Matt Dillon wrote: > > dillon 2003/01/10 23:29:47 PST > > > > Modified files: > > sbin/sysctl sysctl.c > > sys/vm vm_meter.c vm_param.h > > usr.bin/systat vmstat.c > > usr.bin/vmstat vmstat.c > > Log: > > Make 'sysctl vm.vmtotal' work properly using updated patch from Hiten. > > (the patch in the PR was stale). > > Was this commit tested ? It breaks the build of the kernel. Can you > please fix this ? I had not noticed this, but noticed many others (loss of compatibility by renaming old interfaces, printf format errors in sysctl.c including truncating all the int32_t fields mod 64K, and some bugs in the source and output formatting in sysctl.c). The following patch fixes most of the problems in sysctl.c (however, I would prefer to back out the changes there, since everything is or should be better thandled in vmstat or systat). %%% Index: sysctl.c =================================================================== RCS file: /home/ncvs/src/sbin/sysctl/sysctl.c,v retrieving revision 1.49 diff -u -2 -r1.49 sysctl.c --- sysctl.c 11 Jan 2003 07:29:46 -0000 1.49 +++ sysctl.c 11 Jan 2003 16:45:38 -0000 @@ -333,15 +333,19 @@ return (0); } - printf("\nSystem wide totals computed every five seconds:\n"); printf("===============================================\n"); - printf("Processes: (RUNQ:\t %hu Disk Wait: %hu Page Wait: %hu Sleep: %hu)\n", - v->t_rq, v->t_dw, v->t_pw, v->t_sl); - printf("Virtual Memory:\t\t (Total: %hu Active %hu)\n", v->t_vm, v->t_avm); - printf("Real Memory:\t\t (Total: %hu Active %hu)\n", v->t_rm, v->t_arm); - printf("Shared Virtual Memory:\t (Total: %hu Active: %hu)\n", v->t_vmshr, v->t_avmshr); - printf("Shared Real Memory:\t (Total: %hu Active: %hu)\n", v->t_rmshr, v->t_armshr); - printf("Free Memory Pages:\t %hu\n", v->t_free); - + printf( +"Processes:\t\t (RUNQ %d, Disk Wait %d, Page Wait %d, Sleep %d, Swap %d)\n", + v->t_rq, v->t_dw, v->t_pw, v->t_sl, v->t_sw); + printf( +"Virtual Memory:\t\t (Total %#lx (bytes; others: pages), Active %ld)\n", + (u_long)v->t_vm, (long)v->t_avm); + printf("Real Memory:\t\t (Total %ld, Active %ld)\n", + (long)v->t_rm, (long)v->t_arm); + printf("Shared Virtual Memory:\t (Total %ld, Active %ld)\n", + (long)v->t_vmshr, (long)v->t_avmshr); + printf("Shared Real Memory:\t (Total %ld, Active %ld)\n", + (long)v->t_rmshr, (long)v->t_armshr); + printf("Free Memory Pages:\t %ld", (long)v->t_free); return (0); } %%% This makes differences like the following in the output: %%% --- out.old Sun Jan 12 03:40:42 2003 +++ out.new Sun Jan 12 03:45:45 2003 @@ -2,9 +2,8 @@ System wide totals computed every five seconds: =============================================== -Processes: (RUNQ: 1 Disk Wait: 0 Page Wait: 0 Sleep: 32) -Virtual Memory: (Total: 21697 Active 6295) -Real Memory: (Total: 60670 Active 3718) -Shared Virtual Memory: (Total: 933 Active: 855) -Shared Real Memory: (Total: 513 Active: 503) -Free Memory Pages: 5544 - +Processes: (RUNQ 1, Disk Wait 0, Page Wait 0, Sleep 32, Swap 0) +Virtual Memory: (Total 0x800a5525 (bytes; others: pages), Active 6307) +Real Memory: (Total 126259, Active 3732) +Shared Virtual Memory: (Total 933, Active 855) +Shared Real Memory: (Total 513, Active 503) +Free Memory Pages: 5425 %%% Bruce To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe cvs-all" in the body of the message