Re: [PATCH] PM: fix dynamic debug within pm_pr_debug()

From: David Cohen
Date: Thu Mar 10 2022 - 23:25:53 EST


Hi,

On 3/10/22 12:48, Rafael J. Wysocki wrote:

> On Sun, Mar 6, 2022 at 6:52 AM David Cohen <dacohen@xxxxx> wrote:
>
> The patch has been sent as an attachment, so I cannot comment it inline.

Ouch. I used git send-email, but I'm using protonmail with
protonmail-bridge and it somehow mangled it. I'll fix it in
future.

>
> However, printk(KERN_DEBIG, ...) is not the same as pr_debig() AFAICS.
A bit of history I found on kernel git history:

kernel pm debug messages used to use pr_debug() until it was
changed by this commit to prevent printing pm debug messages
unless the sysfs debug flag was set:
8d8b2441db96 PM / sleep: Do not print debug messages by default

This commit implemented their own debugging print function. And
It was this commit that broke dynamic debug on kernel pm functions
when changed pr_debug() to printk(KERN_DEBUG, ...).

The patch I'm sending is keeping the same logic of checking the
sysfs flag, but instead of implementing its own debugging print function,
it will just use pr_debug again which is dynamic debug friendly.
As per my tests I'm able to individually control them again through
dynamic debug control interface.

FWIW I found a typo on my commit message, so I'll fix it and resend,
avoiding the protonmail-bridge (then inline comment will be possible).

Regards, David