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

From: Viresh Kumar
Date: Fri May 06 2022 - 00:06:23 EST


On 05-05-22, 17:54, Frank Wunderlich wrote:
> you mean something like this:
>
> https://www.kernel.org/doc/html/v5.17/admin-guide/dynamic-debug-howto.html#debug-messages-during-boot-process

Yes, though I haven't used it in a long time myself :)

> so enabling debug only with cmdline-param...

Yes and via debugfs file. You can basically control debug messages
based on subsystems, files, functions, etc.

> 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?

Nothing, just enable the config for 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.

You aren't required to change anything there.

--
viresh