Re: [PATCH] PM: Use pm_pr_dbg() instead of pr_debug().

From: Greg KH
Date: Fri Apr 23 2021 - 05:09:25 EST


On Fri, Apr 23, 2021 at 04:12:23PM +0800, zhaoxiao wrote:
> These prints are useful if we're doing PM suspend debugging. Having them
> at pr_debug() level means that we need to either enable DEBUG in this
> file, or compile the kernel with dynamic debug capabilities. Both of
> these options have drawbacks like custom compilation or opting into all
> debug statements being included into the kernel image. Given that we
> already have infrastructure to collect PM debugging information with
> CONFIG_PM_DEBUG and friends, let's change the pr_debug usage here to be
> pm_pr_dbg() instead so we can collect the wakeup information in the
> kernel logs.
>
> Signed-off-by: zhaoxiao <zhaoxiao@xxxxxxxxxxxxx>

Please use a "full" name. Unless one word really is how you sign legal
documents?

> ---
> drivers/base/power/main.c | 10 +++++-----
> 1 file changed, 5 insertions(+), 5 deletions(-)
>
> diff --git a/drivers/base/power/main.c b/drivers/base/power/main.c
> index f893c3c5af07..6e64e3fff84c 100644
> --- a/drivers/base/power/main.c
> +++ b/drivers/base/power/main.c
> @@ -133,7 +133,7 @@ void device_pm_add(struct device *dev)
> if (device_pm_not_required(dev))
> return;
>
> - pr_debug("Adding info for %s:%s\n",
> + pm_pr_dbg("Adding info for %s:%s\n",
> dev->bus ? dev->bus->name : "No Bus", dev_name(dev));

Why are these all just not normal dev_dbg() calls? That handles the "no
bus" stuff automatically.

thanks,

greg k-h