Index: sys/systm.h =================================================================== RCS file: /cvsroot/src/sys/sys/systm.h,v retrieving revision 1.280 diff -u -u -r1.280 systm.h --- sys/systm.h 2 Dec 2018 21:00:13 -0000 1.280 +++ sys/systm.h 2 Jan 2019 16:29:17 -0000 @@ -240,6 +240,10 @@ int vsnprintf(char *, size_t, const char *, va_list) __printflike(3, 0); +void vprintf_flags(int, const char *, va_list) __printflike(2, 0); + +void printf_flags(int, const char *, ...) __printflike(2, 3); + int humanize_number(char *, size_t, uint64_t, const char *, int); void twiddle(void); Index: kern/subr_prf.c =================================================================== RCS file: /cvsroot/src/sys/kern/subr_prf.c,v retrieving revision 1.174 diff -u -u -r1.174 subr_prf.c --- kern/subr_prf.c 15 Jul 2018 07:24:11 -0000 1.174 +++ kern/subr_prf.c 2 Jan 2019 16:29:17 -0000 @@ -1052,17 +1052,31 @@ } void -printf_tolog(const char *fmt, ...) +vprintf_flags(int flags, const char *fmt, va_list ap) { - va_list ap; - kprintf_lock(); + kprintf(fmt, flags, NULL, NULL, ap); + kprintf_unlock(); +} + +void +printf_flags(int flags, const char *fmt, ...) +{ + va_list ap; va_start(ap, fmt); - kprintf(fmt, TOLOG, NULL, NULL, ap); + vprintf_flags(flags, fmt, ap); va_end(ap); +} - kprintf_unlock(); +void +printf_tolog(const char *fmt, ...) +{ + va_list ap; + + va_start(ap, fmt); + vprintf_flags(TOLOG, fmt, ap); + va_end(ap); } /* @@ -1074,13 +1088,9 @@ { va_list ap; - kprintf_lock(); - va_start(ap, fmt); - kprintf(fmt, TOCONS, NULL, NULL, ap); + vprintf_flags(TOCONS, fmt, ap); va_end(ap); - - kprintf_unlock(); } /* @@ -1095,16 +1105,9 @@ { va_list ap; - kprintf_lock(); - va_start(ap, fmt); - kprintf(fmt, TOCONS | TOLOG, NULL, NULL, ap); + vprintf_flags(TOCONS | TOLOG, fmt, ap); va_end(ap); - - kprintf_unlock(); - - if (!panicstr) - logwakeup(); } /* @@ -1115,11 +1118,7 @@ void vprintf(const char *fmt, va_list ap) { - kprintf_lock(); - - kprintf(fmt, TOCONS | TOLOG, NULL, NULL, ap); - - kprintf_unlock(); + vprintf_flags(TOCONS | TOLOG, fmt, ap); if (!panicstr) logwakeup();