Module Name:    src
Committed By:   pgoyette
Date:           Thu Jan  5 03:42:27 UTC 2017

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

Log Message:
Adapt to use of bintime(9) for kernel history timestamps (7.99.55).


To generate a diff of this commit:
cvs rdiff -u -r1.214 -r1.215 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.214 src/usr.bin/vmstat/vmstat.c:1.215
--- src/usr.bin/vmstat/vmstat.c:1.214	Wed Jan  4 01:29:18 2017
+++ src/usr.bin/vmstat/vmstat.c	Thu Jan  5 03:42:27 2017
@@ -1,4 +1,4 @@
-/* $NetBSD: vmstat.c,v 1.214 2017/01/04 01:29:18 pgoyette Exp $ */
+/* $NetBSD: vmstat.c,v 1.215 2017/01/05 03:42:27 pgoyette Exp $ */
 
 /*-
  * Copyright (c) 1998, 2000, 2001, 2007 The NetBSD Foundation, Inc.
@@ -70,7 +70,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.214 2017/01/04 01:29:18 pgoyette Exp $");
+__RCSID("$NetBSD: vmstat.c,v 1.215 2017/01/05 03:42:27 pgoyette Exp $");
 #endif
 #endif /* not lint */
 
@@ -2069,6 +2069,7 @@ void
 hist_dodump(struct kern_history *histp)
 {
 	struct kern_history_ent *histents, *e;
+	struct timeval tv;
 	size_t histsize;
 	char *fmt = NULL, *fn = NULL;
 	size_t fmtlen = 0, fnlen = 0;
@@ -2110,8 +2111,9 @@ hist_dodump(struct kern_history *histp)
 			deref_kptr(e->fn, fn, fnlen, "function name");
 			fn[fnlen] = '\0';
 
-			(void)printf("%06ld.%06ld ", (long int)e->tv.tv_sec,
-			    (long int)e->tv.tv_usec);
+			bintime2timeval(&e->bt, &tv);
+			(void)printf("%06ld.%06ld ", (long int)tv.tv_sec,
+			    (long int)tv.tv_usec);
 			(void)printf("%s#%ld@%d: ", fn, e->call, e->cpunum);
 			(void)printf(fmt, e->v[0], e->v[1], e->v[2], e->v[3]);
 			(void)putchar('\n');
@@ -2198,6 +2200,7 @@ hist_traverse_sysctl(int todo, const cha
 hist_dodump_sysctl(int mib[], unsigned int miblen)
  {
 	struct sysctl_history *hist;
+	struct timeval tv;
 	struct sysctl_history_event *e;
  	size_t histsize;
 	char *strp;
@@ -2231,9 +2234,9 @@ hist_dodump_sysctl(int mib[], unsigned i
 		if (e->she_fmtoffset != 0) {
 			fmt = &strp[e->she_fmtoffset];
 			fn = &strp[e->she_funcoffset];
+			bintime2timeval(&e->she_bintime, &tv);
 			(void)printf("%06ld.%06ld %s#%"PRIu64"@%"PRIu32": ",
-			    (long int)e->she_time_sec,
-			    (long int)e->she_time_usec,
+			    (long int)tv.tv_sec, (long int)tv.tv_usec,
 			    fn, e->she_callnumber, e->she_cpunum);
 			(void)printf(fmt, e->she_values[0], e->she_values[1],
 			     e->she_values[2], e->she_values[3]);

Reply via email to