[PATCH v3 0/2] PM: refactor pm_pr_dbg() to support dynamic debug

David Cohen posted 2 patches 4 years, 2 months ago
include/linux/suspend.h | 44 ++++++++++++++++++++++++++++++++++++-----
kernel/power/Makefile   |  6 +++++-
kernel/power/main.c     | 29 ---------------------------
kernel/power/process.c  |  3 ---
4 files changed, 44 insertions(+), 38 deletions(-)
[PATCH v3 0/2] PM: refactor pm_pr_dbg() to support dynamic debug
Posted by David Cohen 4 years, 2 months ago
Hi,

I am currently debugging an issue with s2idle on my laptop where in a
rare occasion instead of sleeping, it gets stuck in an infinite loop.
The pm_pr_dbg() is placed on very useful functions and it helps me to
debug it, but the current all or nothing enabling mechanism with
pm_debug_messages_on flag is causing the suspending mechanism to be
disturbed with so many debug messages to the point it becomes extremely
difficult to reproduce the issue I'm debugging. More granularity when
enabling pm_pr_dbg() in this case is very welcome.

These patches I'm sending introduce dynamic debug support to pm_pr_dbg()
while still maintaining the pm_debug_messages_on flag behavior if
dynamic debug is not used.

Regards, David

---
David Cohen (2):
  PM: narrow down -DDEBUG on kernel/power/ files
  PM: enable dynamic debug support within pm_pr_dbg()

 include/linux/suspend.h | 44 ++++++++++++++++++++++++++++++++++++-----
 kernel/power/Makefile   |  6 +++++-
 kernel/power/main.c     | 29 ---------------------------
 kernel/power/process.c  |  3 ---
 4 files changed, 44 insertions(+), 38 deletions(-)

--
2.35.1
Re: [PATCH v3 0/2] PM: refactor pm_pr_dbg() to support dynamic debug
Posted by Rafael J. Wysocki 4 years, 2 months ago
On Thu, Mar 24, 2022 at 9:07 AM David Cohen <dacohen@pm.me> wrote:
>
> Hi,
>
> I am currently debugging an issue with s2idle on my laptop where in a
> rare occasion instead of sleeping, it gets stuck in an infinite loop.
> The pm_pr_dbg() is placed on very useful functions and it helps me to
> debug it, but the current all or nothing enabling mechanism with
> pm_debug_messages_on flag is causing the suspending mechanism to be
> disturbed with so many debug messages to the point it becomes extremely
> difficult to reproduce the issue I'm debugging. More granularity when
> enabling pm_pr_dbg() in this case is very welcome.
>
> These patches I'm sending introduce dynamic debug support to pm_pr_dbg()
> while still maintaining the pm_debug_messages_on flag behavior if
> dynamic debug is not used.
>
> Regards, David
>
> ---
> David Cohen (2):
>   PM: narrow down -DDEBUG on kernel/power/ files
>   PM: enable dynamic debug support within pm_pr_dbg()

Both patches applied as 5.19 material, thanks!