Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 11 Jan 2003 11:42:06 -0800 (PST)
From:      Matthew Dillon <dillon@apollo.backplane.com>
To:        Bruce Evans <bde@zeta.org.au>
Cc:        Maxime Henrion <mux@FreeBSD.ORG>, <cvs-committers@FreeBSD.ORG>, <cvs-all@FreeBSD.ORG>
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
Message-ID:  <200301111942.h0BJg6ED041424@apollo.backplane.com>
References:   <20030112023654.C3194-100000@gamplex.bde.org>

next in thread | previous in thread | raw e-mail | index | archive | help

: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 
					<dillon@backplane.com>

:%%%
: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




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200301111942.h0BJg6ED041424>