From owner-cvs-all Sat Jan 11 12: 5:52 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 55A6A37B40B; Sat, 11 Jan 2003 12:05:23 -0800 (PST) Received: from apollo.backplane.com (apollo.backplane.com [216.240.41.2]) by mx1.FreeBSD.org (Postfix) with ESMTP id 9494C4408C; Sat, 11 Jan 2003 11:42:07 -0800 (PST) (envelope-from dillon@apollo.backplane.com) Received: from apollo.backplane.com (localhost [127.0.0.1]) by apollo.backplane.com (8.12.6/8.12.6) with ESMTP id h0BJg7Yp041425; Sat, 11 Jan 2003 11:42:07 -0800 (PST) (envelope-from dillon@apollo.backplane.com) Received: (from dillon@localhost) by apollo.backplane.com (8.12.6/8.12.6/Submit) id h0BJg6ED041424; Sat, 11 Jan 2003 11:42:06 -0800 (PST) Date: Sat, 11 Jan 2003 11:42:06 -0800 (PST) From: Matthew Dillon Message-Id: <200301111942.h0BJg6ED041424@apollo.backplane.com> To: Bruce Evans Cc: Maxime Henrion , , 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 References: <20030112023654.C3194-100000@gamplex.bde.org> 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 :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). sysctl.c has a mechanism to print out normally opaque sysctl structures. Either we support it or we don't. I'll apply your patches (thanks!) but I strongly disagree with backing things out. Just because the information is available in systat doesn't mean it shouldn't be available in sysctl. It is, after all, a sysctl. -Matt Matthew Dillon :%%% :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