Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/usr.bin/vmstat Now that ports that use legacy intrcnt interr...



details:   https://anonhg.NetBSD.org/src/rev/d30aebbf4293
branches:  trunk
changeset: 960876:d30aebbf4293
user:      simonb <simonb%NetBSD.org@localhost>
date:      Thu Apr 01 05:33:50 2021 +0000

description:
Now that ports that use legacy intrcnt interrupt accounting have event
counters to show that data, for the live kernel case just show INTR
events for "vmstat -i".

diffstat:

 usr.bin/vmstat/vmstat.c |  9 +++++++--
 1 files changed, 7 insertions(+), 2 deletions(-)

diffs (30 lines):

diff -r 89d1ac97eeb8 -r d30aebbf4293 usr.bin/vmstat/vmstat.c
--- a/usr.bin/vmstat/vmstat.c   Thu Apr 01 04:42:59 2021 +0000
+++ b/usr.bin/vmstat/vmstat.c   Thu Apr 01 05:33:50 2021 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: vmstat.c,v 1.243 2021/03/03 08:25:16 simonb Exp $ */
+/* $NetBSD: vmstat.c,v 1.244 2021/04/01 05:33:50 simonb Exp $ */
 
 /*-
  * Copyright (c) 1998, 2000, 2001, 2007, 2019, 2020
@@ -71,7 +71,7 @@
 #if 0
 static char sccsid[] = "@(#)vmstat.c   8.2 (Berkeley) 3/1/95";
 #else
-__RCSID("$NetBSD: vmstat.c,v 1.243 2021/03/03 08:25:16 simonb Exp $");
+__RCSID("$NetBSD: vmstat.c,v 1.244 2021/04/01 05:33:50 simonb Exp $");
 #endif
 #endif /* not lint */
 
@@ -1259,6 +1259,11 @@
        int nintr, inamlen;
        char *intrname, *ointrname;
 
+       if (memf == NULL) {
+               doevcnt(verbose, EVCNT_TYPE_INTR);
+               return;
+       }
+
        inttotal = 0;
        uptime = getuptime();
        nintr = intrnl[X_EINTRCNT].n_value - intrnl[X_INTRCNT].n_value;



Home | Main Index | Thread Index | Old Index