Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 20 Nov 2003 15:19:03 +0200
From:      Peter Pentchev <roam@ringlet.net>
To:        Mike Tancsa <mike@sentex.net>
Cc:        hackers@freebsd.org
Subject:   Re: interrupt statistics
Message-ID:  <20031120131903.GG300@straylight.m.ringlet.net>
In-Reply-To: <20031120044945.GA44933@falcon.midgard.homeip.net>
References:  <xzpy8ucpwz9.fsf@dwp.des.no> <jfforv4me3snqshljprg8jejht7ias0oih@4ax.com> <20031120044945.GA44933@falcon.midgard.homeip.net>

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

--VrqPEDrXMn8OVzN4
Content-Type: multipart/mixed; boundary="AqsLC8rIMeq19msA"
Content-Disposition: inline


--AqsLC8rIMeq19msA
Content-Type: text/plain; charset=windows-1251
Content-Disposition: inline
Content-Transfer-Encoding: quoted-printable

On Thu, Nov 20, 2003 at 05:49:45AM +0100, Erik Trulsson wrote:
> On Wed, Nov 19, 2003 at 11:13:03PM -0500, Mike Tancsa wrote:
> > Speaking of which, why is it some devices are not always present
> > (same with systat -vmstat)
> >=20
> > eg on one machine
> > v2% vmstat -i
> > interrupt                   total       rate
> > stray irq7                      2          0
> > hifn0 irq10                 15680          0
> > fxp0 irq11                 259067          2
> > mux irq15                  378597          3
> > atkbd0 irq1                     1          0
> > sio0 irq4                     178          0
> > clk irq0                 11466632         99
> > rtc irq8                 14677398        127
> > Total                    26797555        233
> >=20
> > yet on another,
> > offsite# vmstat -i
> > interrupt                   total       rate
> > fxp0 irq11               29547828         61
> > mux irq15                  453753          0
> > sio0 irq4                     177          0
> > clk irq0                 48204090         99
> > rtc irq8                 61701185        127
> > Total                   139907033        290
> > offsite#=20
> > offsite# dmesg | grep hifn
> > hifn0 mem 0xe9802000-0xe9802fff,0xe9801000-0xe9801fff irq 10 at device
> > 0.0 on pci1
> > hifn0: Hifn 7951, rev 0, 128KB sram, 193 sessions
> > offsite#=20
> >=20
> > How come the hifn does not show up ?  I have noticed this with other
> > devices as well
>=20
> vmstat -i only displays those devices that have generated interrupts.
> I.e. if some device would have the total number of interrupts as 0, it
> will not be show by vmstat -i
> You will note that in your listings above, all the devices displayed
> have generated at least one interrupt.

This is easily fixed, e.g. by the attached.  Note that I've only tested
the RELENG_4 patch, my 5.x machine is out of commission for the next few
days :(  (and no, I couldn't test it on ref5 for obvious reasons related
to /dev/mem ;)

G'luck,
Peter

--=20
Peter Pentchev	roam@ringlet.net    roam@sbnd.net    roam@FreeBSD.org
PGP key:	http://people.FreeBSD.org/~roam/roam.key.asc
Key fingerprint	FDBA FD79 C26F 3C51 C95E  DF9E ED18 B68D 1619 4553
because I didn't think of a good beginning of it.

--AqsLC8rIMeq19msA
Content-Type: text/plain; charset=windows-1251
Content-Disposition: attachment; filename="vmstat-a-HEAD.patch"
Content-Transfer-Encoding: quoted-printable

Index: src/usr.bin/vmstat/vmstat.8
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
RCS file: /home/ncvs/src/usr.bin/vmstat/vmstat.8,v
retrieving revision 1.25
diff -u -r1.25 vmstat.8
--- src/usr.bin/vmstat/vmstat.8	14 Apr 2003 07:22:25 -0000	1.25
+++ src/usr.bin/vmstat/vmstat.8	20 Nov 2003 12:23:59 -0000
@@ -41,7 +41,7 @@
 .Sh SYNOPSIS
 .Nm
 .\" .Op Fl fimst
-.Op Fl fimsz
+.Op Fl afimsz
 .Op Fl c Ar count
 .Op Fl M Ar core
 .Op Fl N Ar system
@@ -62,6 +62,10 @@
 .Pp
 The options are as follows:
 .Bl -tag -width indent
+.It Fl a
+When used with
+.Fl i ,
+include statistics about interrupts that have never been generated.
 .It Fl c
 Repeat the display
 .Ar count
Index: src/usr.bin/vmstat/vmstat.c
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
RCS file: /home/ncvs/src/usr.bin/vmstat/vmstat.c,v
retrieving revision 1.69
diff -u -r1.69 vmstat.c
--- src/usr.bin/vmstat/vmstat.c	9 Nov 2003 20:39:56 -0000	1.69
+++ src/usr.bin/vmstat/vmstat.c	20 Nov 2003 12:24:28 -0000
@@ -129,6 +129,7 @@
 struct	vmmeter sum, osum;
=20
 int	winlines =3D 20;
+int	aflag =3D 0;
 int	nflag =3D 0;
=20
 kvm_t *kd;
@@ -174,8 +175,11 @@
 	memf =3D nlistf =3D NULL;
 	interval =3D reps =3D todo =3D 0;
 	maxshowdevs =3D 2;
-	while ((c =3D getopt(argc, argv, "c:fiM:mN:n:p:stw:z")) !=3D -1) {
+	while ((c =3D getopt(argc, argv, "ac:fiM:mN:n:p:stw:z")) !=3D -1) {
 		switch (c) {
+		case 'a':
+			aflag++;
+			break;
 		case 'c':
 			reps =3D atoi(optarg);
 			break;
@@ -756,7 +760,7 @@
 	    "rate");
 	inttotal =3D 0;
 	while (--nintr >=3D 0) {
-		if (*intrcnt)
+		if (*intrcnt || (aflag && intrname[0]))
 			(void)printf("%-*s %20lu %10lu\n", istrnamlen, intrname,
 			    *intrcnt, *intrcnt / uptime);
 		intrname +=3D strlen(intrname) + 1;
@@ -829,7 +833,7 @@
 usage()
 {
 	(void)fprintf(stderr, "%s%s",
-		"usage: vmstat [-imsz] [-c count] [-M core] [-N system] [-w wait]\n",
+		"usage: vmstat [-aimsz] [-c count] [-M core] [-N system] [-w wait]\n",
 		"              [-n devs] [disks]\n");
 	exit(1);
 }

--AqsLC8rIMeq19msA
Content-Type: text/plain; charset=windows-1251
Content-Disposition: attachment; filename="vmstat-a-RELENG_4.patch"
Content-Transfer-Encoding: quoted-printable

Index: src/usr.bin/vmstat/vmstat.8
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
RCS file: /home/ncvs/src/usr.bin/vmstat/vmstat.8,v
retrieving revision 1.16.2.5
diff -u -r1.16.2.5 vmstat.8
--- src/usr.bin/vmstat/vmstat.8	16 Aug 2001 13:17:13 -0000	1.16.2.5
+++ src/usr.bin/vmstat/vmstat.8	20 Nov 2003 12:21:23 -0000
@@ -41,7 +41,7 @@
 .Sh SYNOPSIS
 .Nm
 .\" .Op Fl fimst
-.Op Fl imsz
+.Op Fl aimsz
 .Op Fl c Ar count
 .Op Fl M Ar core
 .Op Fl N Ar system
@@ -61,6 +61,10 @@
 .Pp
 The options are as follows:
 .Bl -tag -width indent
+.It Fl a
+When used with
+.Fl i ,
+include statistics about interrupts that have never been generated.
 .It Fl c
 Repeat the display
 .Ar count
Index: src/usr.bin/vmstat/vmstat.c
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
RCS file: /home/ncvs/src/usr.bin/vmstat/vmstat.c,v
retrieving revision 1.38.2.5
diff -u -r1.38.2.5 vmstat.c
--- src/usr.bin/vmstat/vmstat.c	20 Sep 2003 19:10:01 -0000	1.38.2.5
+++ src/usr.bin/vmstat/vmstat.c	20 Nov 2003 12:22:59 -0000
@@ -135,6 +135,7 @@
 struct	vmmeter sum, osum;
=20
 int	winlines =3D 20;
+int	aflag =3D 0;
 int	nflag =3D 0;
=20
 kvm_t *kd;
@@ -169,8 +170,11 @@
 	memf =3D nlistf =3D NULL;
 	interval =3D reps =3D todo =3D 0;
 	maxshowdevs =3D 2;
-	while ((c =3D getopt(argc, argv, "c:fiM:mN:n:p:stw:z")) !=3D -1) {
+	while ((c =3D getopt(argc, argv, "ac:fiM:mN:n:p:stw:z")) !=3D -1) {
 		switch (c) {
+		case 'a':
+			aflag++;
+			break;
 		case 'c':
 			reps =3D atoi(optarg);
 			break;
@@ -739,7 +743,7 @@
 	inttotal =3D 0;
 	nintr /=3D sizeof(long);
 	while (--nintr >=3D 0) {
-		if (*intrcnt)
+		if (*intrcnt || (aflag && intrname[0]))
 			(void)printf("%-12s %20lu %10lu\n", intrname,
 			    *intrcnt, *intrcnt / uptime);
 		intrname +=3D strlen(intrname) + 1;
@@ -917,7 +921,7 @@
 usage()
 {
 	(void)fprintf(stderr, "%s%s",
-		"usage: vmstat [-imsz] [-c count] [-M core] [-N system] [-w wait]\n",
+		"usage: vmstat [-aimsz] [-c count] [-M core] [-N system] [-w wait]\n",
 		"              [-n devs] [disks]\n");
 	exit(1);
 }

--AqsLC8rIMeq19msA--

--VrqPEDrXMn8OVzN4
Content-Type: application/pgp-signature
Content-Disposition: inline

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.3 (FreeBSD)

iD8DBQE/vL9H7Ri2jRYZRVMRAuCZAJkBbauemP3VdOGY+3v+kNMGUGRKsQCbBnBg
FZwH9QJfvWTR9GzrExSimKI=
=5yy0
-----END PGP SIGNATURE-----

--VrqPEDrXMn8OVzN4--



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