Page MenuHomeFreeBSD

Add kern.console_log_level for console log level
Needs ReviewPublic

Authored by mkfong8808_gmail.com on Nov 7 2023, 1:13 PM.
Tags
None
Referenced Files
Unknown Object (File)
Tue, May 7, 6:40 AM
Unknown Object (File)
Mon, May 6, 8:37 AM
Unknown Object (File)
Sat, May 4, 4:59 AM
Unknown Object (File)
Apr 12 2024, 11:55 AM
Unknown Object (File)
Mar 26 2024, 5:20 AM
Unknown Object (File)
Dec 25 2023, 4:24 AM
Unknown Object (File)
Dec 20 2023, 8:35 AM
Unknown Object (File)
Dec 15 2023, 8:03 AM

Details

Reviewers
bdrewery
ken
phk
Summary

Creates tunable flag for console log message control during boot-up.
During boot-up (or shutdown), when eventd/syslogd is not up, some
conditional messages are too expensive to send to console by default.
Making it tunable to display them only when needed. Default to LOG_ERR.

Obtained from: Juniper Networks, Inc.

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Skipped
Unit
Tests Skipped
Build Status
Buildable 54311
Build 51201: arc lint + arc unit

Event Timeline

During boot-up (or shutdown), when eventd/syslogd is not up, some conditional messages are too expensive to send to console by default

Do you have a measure how will this change improve?

We really do not have too much messages. So I bet only "some conditional messages" is not expensive, and dropping them do not help much.

Also unless you need bootstrap fast ( something like AWS Serverless Function ) then in most cases boot message are useful to help diagnosing / debugging .

sys/kern/subr_prf.c
301

Why the constty check here? That's to implement the redirect the console to a different tty... if there is one of those, we will always output to it?

In D42489#972634, @zlei wrote:

During boot-up (or shutdown), when eventd/syslogd is not up, some conditional messages are too expensive to send to console by default

Do you have a measure how will this change improve?

We really do not have too much messages. So I bet only "some conditional messages" is not expensive, and dropping them do not help much.

Also unless you need bootstrap fast ( something like AWS Serverless Function ) then in most cases boot message are useful to help diagnosing / debugging .

For Vendor deployment, it can have many kernel modules that there could be lot of logs output to syslogd.
Once the syslogd goes away, it can end up with lots of log pending for output to the console, system lagging could happen due to this, especially in cases when the terminal has to be set at 9600 (baud).
For our case, we have to turn off the console output redirect this way based on the SYSLOG settings, otherwise, the console screen will become unmanageable.
We proposed to have it default to LOG_ERR and making it tunable as we think other people/vendors could use logs the same way.

sys/kern/subr_prf.c
301

Thank you for pointing this out.
It is correct if redirect had been set (i.e. constty == something), the message will always be printed. The idea behind this conditional statement is to cut down INFO/DEBUG messages for slow console output like those under 9600 baud settings, for example. If it had been redirected, it will be out of the scope of this conditional statement.

Is there any additional input on this one?