Module Name:    src
Committed By:   simonb
Date:           Thu Apr  1 05:33:51 UTC 2021

Modified Files:
        src/usr.bin/vmstat: vmstat.c

Log Message:
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".


To generate a diff of this commit:
cvs rdiff -u -r1.243 -r1.244 src/usr.bin/vmstat/vmstat.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/usr.bin/vmstat/vmstat.c
diff -u src/usr.bin/vmstat/vmstat.c:1.243 src/usr.bin/vmstat/vmstat.c:1.244
--- src/usr.bin/vmstat/vmstat.c:1.243	Wed Mar  3 08:25:16 2021
+++ src/usr.bin/vmstat/vmstat.c	Thu Apr  1 05:33:50 2021
@@ -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 @@ __COPYRIGHT("@(#) Copyright (c) 1980, 19
 #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 @@ dointr(int verbose)
 	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;

Reply via email to