Module Name:    src
Committed By:   jmcneill
Date:           Sat Jun 30 17:15:01 UTC 2018

Modified Files:
        src/sys/kern: subr_prf.c

Log Message:
When cold, manually update timecounters before calling getnanouptime. Now
kernel printf timestamps are updated properly before interrupts are
enabled.


To generate a diff of this commit:
cvs rdiff -u -r1.171 -r1.172 src/sys/kern/subr_prf.c

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

Modified files:

Index: src/sys/kern/subr_prf.c
diff -u src/sys/kern/subr_prf.c:1.171 src/sys/kern/subr_prf.c:1.172
--- src/sys/kern/subr_prf.c:1.171	Sun Jun  3 15:26:03 2018
+++ src/sys/kern/subr_prf.c	Sat Jun 30 17:15:01 2018
@@ -1,4 +1,4 @@
-/*	$NetBSD: subr_prf.c,v 1.171 2018/06/03 15:26:03 jakllsch Exp $	*/
+/*	$NetBSD: subr_prf.c,v 1.172 2018/06/30 17:15:01 jmcneill Exp $	*/
 
 /*-
  * Copyright (c) 1986, 1988, 1991, 1993
@@ -37,7 +37,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: subr_prf.c,v 1.171 2018/06/03 15:26:03 jakllsch Exp $");
+__KERNEL_RCSID(0, "$NetBSD: subr_prf.c,v 1.172 2018/06/30 17:15:01 jmcneill Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_ddb.h"
@@ -68,6 +68,7 @@ __KERNEL_RCSID(0, "$NetBSD: subr_prf.c,v
 #include <sys/cpu.h>
 #include <sys/sha2.h>
 #include <sys/rndsource.h>
+#include <sys/timetc.h>
 
 #include <dev/cons.h>
 
@@ -503,6 +504,9 @@ addtstamp(int flags, struct tty *tp)
 		log_ts_prec = prec;
 	}
 
+	if (cold)
+		tc_ticktock();
+
 	getnanouptime(&ts);
 
 	for (n = prec, fsec = ts.tv_nsec; n < 8; n++)

Reply via email to