From: David Cohen <dacohen@pm.me>
To: "Rafael J. Wysocki" <rafael@kernel.org>
Cc: Pavel Machek <pavel@ucw.cz>, Len Brown <len.brown@intel.com>,
Linux PM <linux-pm@vger.kernel.org>,
Linux Kernel Mailing List <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH v2] PM: fix dynamic debug within pm_pr_debug()
Date: Mon, 21 Mar 2022 14:51:36 +0000 [thread overview]
Message-ID: <YjiQ8EbhBQzDOHjV@jiban> (raw)
In-Reply-To: <CAJZ5v0j61EMFXpONqPBpQjzm3T3nFeHjfp2YdV3oXW8KnQJ2tw@mail.gmail.com>
On Mon, Mar 21, 2022 at 03:20:20PM +0100, Rafael J. Wysocki wrote:
> On Sat, Mar 19, 2022 at 2:54 AM David Cohen <dacohen@pm.me> wrote:
> >
> > On Thu, Mar 17, 2022 at 02:45:11PM +0100, Rafael J. Wysocki wrote:
> > > On Sat, Mar 12, 2022 at 5:37 AM David Cohen <dacohen@pm.me> wrote:
> > > >
> > > > Currently, pm_pr_debug() and pm_deferred_pr_debug() use __pm_pr_debug()
> > > > to filter pm debug messages based on pm_debug_messages_on flag.
> > > > According to __pm_pr_debug() implementation, pm_deferred_pr_debug()
> > > > indirectly calls printk_deferred() within __pm_pr_debug() which doesn't
> > > > support dynamic debug, but pm_pr_debug() indirectly calls pr_debug()
> > >
> > > I'm not sure what you mean by pm_pr_debug(). There's no such thing in
> > > the kernel tree.
> > >
> > > Assuming that it means pm_pr_dbg(), it doesn't call pr_debug():
> >
> > Yeah, I apologize for the typo. I meant pm_pr_dbg(). I can fix that if
> > you're ok with the patch as per comments below.
> >
> > >
> > > #define pm_pr_dbg(fmt, ...) __pm_pr_dbg(false, fmt, ##__VA_ARGS__)
> > >
> > > and
> > >
> > > void __pm_pr_dbg(bool defer, const char *fmt, ...)
> > > {
> > > ...
> > > if (defer)
> > > printk_deferred(KERN_DEBUG "PM: %pV", &vaf);
> > > else
> > > printk(KERN_DEBUG "PM: %pV", &vaf);
> > >
> > > And as I said printk(KERN_DEBUG ...) is not equivalent to
> > > pr_debug(...), because it is not dynamic printk().
> >
> > The problem is not about __pm_pr_dbg() calling printk(). The problem is
> > the pm files that used to call pr_debug() were modified to call
> > pm_pr_dbg() in order to be behing the pm_debug_messages_on flag, as per
> > this commit:
> > 8d8b2441db96 PM / sleep: Do not print debug messages by default
>
> So what's the problem with setting pm_debug_messages_on in addition to
> enabling dynamic debug for a given file?
Let me be a bit more detailed:
Before "8d8b2441db96 PM / sleep: Do not print debug messages by default":
- pr_debug() was used
- The kernel pm files had dynamic debug support
- All the instances using pr_debug() are visible on
/sys/kernel/debug/dynamic_debug/control
- pm_debug_messages_on flag was not supported
After "8d8b2441db96 PM / sleep: Do not print debug messages by default":
- pr_debug() was replaced with pm_pr_dbg()
- The kernel pm files where pm_pr_dbg() replaced pr_debug() *lost* dynamic
debug support and they are no longer visible on
/sys/kernel/debug/dynamic_debug/control
- pm_debug_messages_on flag was introduced
What my patch is doing:
- Reintroducing dynamic debug support to the same files who lost it
after the patch mentioned above
- The instances using pr_pm_dbg() (which originally came from pr_debug())
are reintroduced to /sys/kernel/debug/dynamic_debug/control
- pm_debug_messages_on flag is unaltered
Regards, David
next prev parent reply other threads:[~2022-03-21 14:51 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-03-12 4:36 [PATCH v2] PM: fix dynamic debug within pm_pr_debug() David Cohen
2022-03-17 13:45 ` Rafael J. Wysocki
2022-03-19 1:54 ` David Cohen
2022-03-21 14:20 ` Rafael J. Wysocki
2022-03-21 14:51 ` David Cohen [this message]
2022-03-21 15:12 ` Rafael J. Wysocki
2022-03-21 15:57 ` David Cohen
2022-03-21 17:09 ` Rafael J. Wysocki
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=YjiQ8EbhBQzDOHjV@jiban \
--to=dacohen@pm.me \
--cc=len.brown@intel.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-pm@vger.kernel.org \
--cc=pavel@ucw.cz \
--cc=rafael@kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox