Sun Jun 3 15:26:04 2018 UTC ()
Make identification of accounted aprint_error()s possible by putting a
big ugly "autoconfiguration error: " in the log when they occur.


(jakllsch)
diff -r1.170 -r1.171 src/sys/kern/subr_prf.c

cvs diff -r1.170 -r1.171 src/sys/kern/subr_prf.c (expand / switch to unified diff)

--- src/sys/kern/subr_prf.c 2018/04/14 01:53:38 1.170
+++ src/sys/kern/subr_prf.c 2018/06/03 15:26:03 1.171
@@ -1,14 +1,14 @@ @@ -1,14 +1,14 @@
1/* $NetBSD: subr_prf.c,v 1.170 2018/04/14 01:53:38 kre Exp $ */ 1/* $NetBSD: subr_prf.c,v 1.171 2018/06/03 15:26:03 jakllsch Exp $ */
2 2
3/*- 3/*-
4 * Copyright (c) 1986, 1988, 1991, 1993 4 * Copyright (c) 1986, 1988, 1991, 1993
5 * The Regents of the University of California. All rights reserved. 5 * The Regents of the University of California. All rights reserved.
6 * (c) UNIX System Laboratories, Inc. 6 * (c) UNIX System Laboratories, Inc.
7 * All or some portions of this file are derived from material licensed 7 * All or some portions of this file are derived from material licensed
8 * to the University of California by American Telephone and Telegraph 8 * to the University of California by American Telephone and Telegraph
9 * Co. or Unix System Laboratories, Inc. and are reproduced herein with 9 * Co. or Unix System Laboratories, Inc. and are reproduced herein with
10 * the permission of UNIX System Laboratories, Inc. 10 * the permission of UNIX System Laboratories, Inc.
11 * 11 *
12 * Redistribution and use in source and binary forms, with or without 12 * Redistribution and use in source and binary forms, with or without
13 * modification, are permitted provided that the following conditions 13 * modification, are permitted provided that the following conditions
14 * are met: 14 * are met:
@@ -27,27 +27,27 @@ @@ -27,27 +27,27 @@
27 * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE 27 * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
28 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 28 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
29 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 29 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
30 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 30 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
31 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 31 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
32 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 32 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
33 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 33 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
34 * SUCH DAMAGE. 34 * SUCH DAMAGE.
35 * 35 *
36 * @(#)subr_prf.c 8.4 (Berkeley) 5/4/95 36 * @(#)subr_prf.c 8.4 (Berkeley) 5/4/95
37 */ 37 */
38 38
39#include <sys/cdefs.h> 39#include <sys/cdefs.h>
40__KERNEL_RCSID(0, "$NetBSD: subr_prf.c,v 1.170 2018/04/14 01:53:38 kre Exp $"); 40__KERNEL_RCSID(0, "$NetBSD: subr_prf.c,v 1.171 2018/06/03 15:26:03 jakllsch Exp $");
41 41
42#ifdef _KERNEL_OPT 42#ifdef _KERNEL_OPT
43#include "opt_ddb.h" 43#include "opt_ddb.h"
44#include "opt_ipkdb.h" 44#include "opt_ipkdb.h"
45#include "opt_kgdb.h" 45#include "opt_kgdb.h"
46#include "opt_dump.h" 46#include "opt_dump.h"
47#include "opt_rnd_printf.h" 47#include "opt_rnd_printf.h"
48#endif 48#endif
49 49
50#include <sys/param.h> 50#include <sys/param.h>
51#include <sys/stdint.h> 51#include <sys/stdint.h>
52#include <sys/systm.h> 52#include <sys/systm.h>
53#include <sys/buf.h> 53#include <sys/buf.h>
@@ -859,26 +859,27 @@ aprint_error_internal(const char *prefix @@ -859,26 +859,27 @@ aprint_error_internal(const char *prefix
859{ 859{
860 int flags = TOLOG; 860 int flags = TOLOG;
861 861
862 if ((boothowto & (AB_SILENT|AB_QUIET)) == 0 || 862 if ((boothowto & (AB_SILENT|AB_QUIET)) == 0 ||
863 (boothowto & AB_VERBOSE) != 0) 863 (boothowto & AB_VERBOSE) != 0)
864 flags |= TOCONS; 864 flags |= TOCONS;
865 865
866 kprintf_lock(); 866 kprintf_lock();
867 867
868 aprint_error_count++; 868 aprint_error_count++;
869 869
870 if (prefix) 870 if (prefix)
871 kprintf_internal("%s: ", flags, NULL, NULL, prefix); 871 kprintf_internal("%s: ", flags, NULL, NULL, prefix);
 872 kprintf_internal("autoconfiguration error: ", TOLOG, NULL, NULL);
872 kprintf(fmt, flags, NULL, NULL, ap); 873 kprintf(fmt, flags, NULL, NULL, ap);
873 874
874 kprintf_unlock(); 875 kprintf_unlock();
875 876
876 if (!panicstr) 877 if (!panicstr)
877 logwakeup(); 878 logwakeup();
878} 879}
879 880
880void 881void
881aprint_error(const char *fmt, ...) 882aprint_error(const char *fmt, ...)
882{ 883{
883 va_list ap; 884 va_list ap;
884 885