Aw: Re: [RFC v1] opp: add config option for debug

From: Frank Wunderlich
Date: Thu May 05 2022 - 11:54:38 EST


Hi,

> Gesendet: Donnerstag, 05. Mai 2022 um 07:58 Uhr
> Von: "Viresh Kumar" <viresh.kumar@xxxxxxxxxx>
> An: "Frank Wunderlich" <linux@xxxxxxxxx>
> Cc: linux-pm@xxxxxxxxxxxxxxx, "Frank Wunderlich" <frank-w@xxxxxxxxxxxxxxx>, "Greg Kroah-Hartman" <gregkh@xxxxxxxxxxxxxxxxxxx>, "Rafael J. Wysocki" <rafael@xxxxxxxxxx>, "Viresh Kumar" <vireshk@xxxxxxxxxx>, "Nishanth Menon" <nm@xxxxxx>, "Stephen Boyd" <sboyd@xxxxxxxxxx>, linux-kernel@xxxxxxxxxxxxxxx
> Betreff: Re: [RFC v1] opp: add config option for debug
>
> On 04-05-22, 19:48, Frank Wunderlich wrote:
> > From: Frank Wunderlich <frank-w@xxxxxxxxxxxxxxx>
> >
> > Currently OPP debug is enabled by DEBUG_DRIVER option. This is generic
> > driver debug and opp floods serial console. This is annoying if opp is
> > not needed so give it an additional config-key.
> >
> > Signed-off-by: Frank Wunderlich <frank-w@xxxxxxxxxxxxxxx>
> > ---
> > drivers/base/Kconfig | 1 +
> > drivers/opp/Kconfig | 7 +++++++
> > drivers/opp/Makefile | 2 +-
> > 3 files changed, 9 insertions(+), 1 deletion(-)
>
> Isn't something like Dynamic Debug helpful here ?

you mean something like this:

https://www.kernel.org/doc/html/v5.17/admin-guide/dynamic-debug-howto.html#debug-messages-during-boot-process

so enabling debug only with cmdline-param...

have you a simple example how to implement it? have not done anything with dynamic-debug yet...seems mighty but not trivial to implement.

currently dev_dbg() is used for the messages that i try to disable...but show others from driver_debug at debug level.

What needs to be changed to filter it via DYNAMIC_DEBUG?

found this, but i'm not sure if i interpret it the right way...

https://elixir.bootlin.com/linux/v5.18-rc5/source/drivers/acpi/utils.c#L495
defines __acpi_handle_debug
called via acpi_handle_debug macro
https://elixir.bootlin.com/linux/v5.18-rc5/source/include/linux/acpi.h#L1136

so basicly convert dev_dbg to __dynamic_pr_debug

at least much more changed code because all dev_*/pr_* needs to be changed to own handler which does the switch based on CONFIG_DYNAMIC_DEBUG set or not.

regards Frank