[PATCH 4/4] log: Disable the syslog driver by default

Simon Glass sjg at chromium.org
Sun Sep 13 15:26:42 CEST 2020


Hi Heinrich,

On Sun, 13 Sep 2020 at 00:47, Heinrich Schuchardt <xypron.glpk at gmx.de> wrote:
>
> Am 13. September 2020 03:24:02 MESZ schrieb Simon Glass <sjg at chromium.org>:
> >Hi Heinrich,
> >
> >On Sat, 12 Sep 2020 at 14:34, Heinrich Schuchardt <xypron.glpk at gmx.de>
> >wrote:
> >>
> >> Am 12. September 2020 22:24:24 MESZ schrieb Simon Glass
> ><sjg at chromium.org>:
> >> >Hi Heinrich,
> >> >
> >> >On Sat, 12 Sep 2020 at 14:16, Heinrich Schuchardt
> ><xypron.glpk at gmx.de>
> >> >wrote:
> >> >>
> >> >> Am 12. September 2020 20:28:50 MESZ schrieb Simon Glass
> >> ><sjg at chromium.org>:
> >> >> >This driver interferes with other sandbox tests since it causes
> >log
> >> >> >output
> >> >> >to be interspersed with "No ethernet found." messages. Disable
> >this
> >> >> >driver
> >> >> >by default.
> >> >> >
> >> >> >Enable it for the syslog tests so that they still pass.
> >> >> >
> >> >> >Signed-off-by: Simon Glass <sjg at chromium.org>
> >> >> >---
> >> >> >
> >> >> > common/log_syslog.c           |  1 -
> >> >> > test/log/syslog_test.c        | 24 ++++++++++++++++++++++++
> >> >> > test/log/syslog_test.h        | 16 ++++++++++++++++
> >> >> > test/log/syslog_test_ndebug.c |  2 ++
> >> >> > 4 files changed, 42 insertions(+), 1 deletion(-)
> >> >> >
> >> >> >diff --git a/common/log_syslog.c b/common/log_syslog.c
> >> >> >index cf0dbba9bf5..149ff5af310 100644
> >> >> >--- a/common/log_syslog.c
> >> >> >+++ b/common/log_syslog.c
> >> >> >@@ -115,5 +115,4 @@ out:
> >> >> > LOG_DRIVER(syslog) = {
> >> >> >       .name   = "syslog",
> >> >> >       .emit   = log_syslog_emit,
> >> >> >-      .flags  = LOGDF_ENABLE,
> >> >>
> >> >> What does the flag removal change outside Python testing?
> >> >
> >> >If this driver is to be used on a board, you must call
> >> >log_device_set_enable().
> >>
> >> This would pervert the nice log driver system that you have provided.
> >I definitively want syslog with vanilla code just by customizing.
> >>
> >> If you want to mute the network stack, then move it to use log and
> >filter on the network uclass.
> >
> >Well sandbox has a network but it fails to send syslog messages, which
> >is probably a good thing, at least without someone saying they want it
> >to happen.
> >
> >>
> >> Or simply adjust the test that has hickups.
> >
> >I don't like that idea because any test can produce log output.
> >
> >Another option would be to only disable the device with sandbox, e.g.
> >
> >#ifndef CONFIG_SANDBOX
> >   .flags  = LOGDF_ENABLE,
> >#endif
>
> The decision to send syslog messages is not board specific but application specific. This is why I think it must be customizable. I would be fine if you would simply remove log_syslog from sandbox_defconfig.

But then we would lose test coverage for syslog. I agree that making
it customisable is a good thing. But what do you think is the solution
to the problem at hand? As above, the driver is disabled by default
only on sandbox, since it must be enabled for testing, but is
intrusive otherwise.

>
> What I am missing most in the log command is the possibility to set the verbosity per log area/uclass. This would allow to see debug messages only from the area of interest. Especially network does not work when debugging messages are shown per packet, while the user might be interested in debug messages from other areas e.g. EFI.
>
> Concerning your problem such a change would allow to selectively mute network messages.
>
> Would such a change make sense to you?

Yes, but I feel these are separate issues:
- add a command enabling / disabling a log driver
- add a command to add/remove log filters based on category/level/file

Regards,
Simon


More information about the U-Boot mailing list