tech-kern archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: printing aprint_error_count



On 2016/07/15 16:45, Masanobu SAITOH wrote:
Hi.

 aprint_error*() increments aprint_error_count.
At the end of config_finalize():

    KERNEL_UNLOCK_ONE(NULL);

    errcnt = aprint_get_error_count();
    if ((boothowto & (AB_QUIET|AB_SILENT)) != 0 &&
        (boothowto & AB_VERBOSE) == 0) {
        mutex_enter(&config_misc_lock);
        if (config_do_twiddle) {
            config_do_twiddle = 0;
            printf_nolog(" done.\n");
        }
        mutex_exit(&config_misc_lock);
        if (errcnt != 0) {
            printf("WARNING: %d error%s while detecting hardware; "
                "check system log.\n", errcnt,
                errcnt == 1 ? "" : "s");
        }
    }
}

I think it's worth to print this message even if AB_QUIET
and AB_SILENT are not set.

Index: subr_autoconf.c
===================================================================
RCS file: /cvsroot/src/sys/kern/subr_autoconf.c,v
retrieving revision 1.243
diff -u -p -r1.243 subr_autoconf.c
--- subr_autoconf.c    11 Jul 2016 07:42:13 -0000    1.243
+++ subr_autoconf.c    15 Jul 2016 06:43:39 -0000
@@ -2182,11 +2182,11 @@ config_finalize(void)
             printf_nolog(" done.\n");
         }
         mutex_exit(&config_misc_lock);
-        if (errcnt != 0) {
-            printf("WARNING: %d error%s while detecting hardware; "
-                "check system log.\n", errcnt,
-                errcnt == 1 ? "" : "s");
-        }
+    }
+    if (errcnt != 0) {
+        printf("WARNING: %d error%s while detecting hardware; "
+            "check system log.\n", errcnt,
+            errcnt == 1 ? "" : "s");
     }
 }

I think it's not required to check AB_VERBOSE

 Or enclose with #ifdef DIAGNOSTIC?

because
not so many people set this flag and it makes difficult
to notice problem(s). Is it OK to commit?

 On my machines ichpcib's TCO timer and acpiec count error.

acpiec0 at acpi0 (H_EC, PNP0C09-1)
acpiec0: unable to evaluate _GPE: AE_NOT_FOUND
(snip)
tco0 at ichlpcib0: TCO (watchdog) timer configured.
tco0: TCO timer reboot disabled by hardware; hope SMBIOS properly handles it.




--
-----------------------------------------------
                SAITOH Masanobu (msaitoh%execsw.org@localhost
                                 msaitoh%netbsd.org@localhost)



Home | Main Index | Thread Index | Old Index