All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] PM: Use pm_pr_dbg() instead of pr_debug().
@ 2021-04-23  8:12 zhaoxiao
  2021-04-23  9:09 ` Greg KH
  2021-04-23 12:16 ` Rafael J. Wysocki
  0 siblings, 2 replies; 3+ messages in thread
From: zhaoxiao @ 2021-04-23  8:12 UTC (permalink / raw)
  To: rjw, pavel, len.brown, gregkh; +Cc: linux-pm, linux-kernel, zhaoxiao

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@uniontech.com>
---
 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));
 	device_pm_check_callbacks(dev);
 	mutex_lock(&dpm_list_mtx);
@@ -154,7 +154,7 @@ void device_pm_remove(struct device *dev)
 	if (device_pm_not_required(dev))
 		return;
 
-	pr_debug("Removing info for %s:%s\n",
+	pm_pr_dbg("Removing info for %s:%s\n",
 		 dev->bus ? dev->bus->name : "No Bus", dev_name(dev));
 	complete_all(&dev->power.completion);
 	mutex_lock(&dpm_list_mtx);
@@ -173,7 +173,7 @@ void device_pm_remove(struct device *dev)
  */
 void device_pm_move_before(struct device *deva, struct device *devb)
 {
-	pr_debug("Moving %s:%s before %s:%s\n",
+	pm_pr_dbg("Moving %s:%s before %s:%s\n",
 		 deva->bus ? deva->bus->name : "No Bus", dev_name(deva),
 		 devb->bus ? devb->bus->name : "No Bus", dev_name(devb));
 	/* Delete deva from dpm_list and reinsert before devb. */
@@ -187,7 +187,7 @@ void device_pm_move_before(struct device *deva, struct device *devb)
  */
 void device_pm_move_after(struct device *deva, struct device *devb)
 {
-	pr_debug("Moving %s:%s after %s:%s\n",
+	pm_pr_dbg("Moving %s:%s after %s:%s\n",
 		 deva->bus ? deva->bus->name : "No Bus", dev_name(deva),
 		 devb->bus ? devb->bus->name : "No Bus", dev_name(devb));
 	/* Delete deva from dpm_list and reinsert after devb. */
@@ -200,7 +200,7 @@ void device_pm_move_after(struct device *deva, struct device *devb)
  */
 void device_pm_move_last(struct device *dev)
 {
-	pr_debug("Moving %s:%s to end of list\n",
+	pm_pr_dbg("Moving %s:%s to end of list\n",
 		 dev->bus ? dev->bus->name : "No Bus", dev_name(dev));
 	list_move_tail(&dev->power.entry, &dpm_list);
 }
-- 
2.20.1




^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH] PM: Use pm_pr_dbg() instead of pr_debug().
  2021-04-23  8:12 [PATCH] PM: Use pm_pr_dbg() instead of pr_debug() zhaoxiao
@ 2021-04-23  9:09 ` Greg KH
  2021-04-23 12:16 ` Rafael J. Wysocki
  1 sibling, 0 replies; 3+ messages in thread
From: Greg KH @ 2021-04-23  9:09 UTC (permalink / raw)
  To: zhaoxiao; +Cc: rjw, pavel, len.brown, linux-pm, linux-kernel

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@uniontech.com>

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

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] PM: Use pm_pr_dbg() instead of pr_debug().
  2021-04-23  8:12 [PATCH] PM: Use pm_pr_dbg() instead of pr_debug() zhaoxiao
  2021-04-23  9:09 ` Greg KH
@ 2021-04-23 12:16 ` Rafael J. Wysocki
  1 sibling, 0 replies; 3+ messages in thread
From: Rafael J. Wysocki @ 2021-04-23 12:16 UTC (permalink / raw)
  To: zhaoxiao
  Cc: Rafael J. Wysocki, Pavel Machek, Len Brown, Greg Kroah-Hartman,
	Linux PM, Linux Kernel Mailing List

On Fri, Apr 23, 2021 at 10:12 AM zhaoxiao <zhaoxiao@uniontech.com> 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.

I'm not quite sure what you wanted to say here.

What's wrong with dynamic debug in particular?

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

What wakeup information do you mean?

This is all about manipulating dpm_list and your change would cause
pm_debug_messages to generate quite a bit of noise if enabled early.

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2021-04-23 12:17 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-04-23  8:12 [PATCH] PM: Use pm_pr_dbg() instead of pr_debug() zhaoxiao
2021-04-23  9:09 ` Greg KH
2021-04-23 12:16 ` Rafael J. Wysocki

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.