public inbox for linux-acpi@vger.kernel.org
 help / color / mirror / Atom feed
From: "장영진/TV S/W Lab(VD)/Staff Engineer/삼성전자" <yj84.jang@samsung.com>
To: "'Bjorn Helgaas'" <helgaas@kernel.org>,
	"'Greg Kroah-Hartman'" <gregkh@linuxfoundation.org>
Cc: "'Rafael J. Wysocki'" <rafael@kernel.org>,
	"'Pavel Machek'" <pavel@ucw.cz>,
	"'Len Brown'" <len.brown@intel.com>,
	"'Bjorn Helgaas'" <bhelgaas@google.com>,
	<linux-pm@vger.kernel.org>, <linux-kernel@vger.kernel.org>,
	<linux-pci@vger.kernel.org>, <linux-acpi@vger.kernel.org>,
	<linux-usb@vger.kernel.org>, <js07.lee@samsung.com>
Subject: RE: [PATCH] PM: Add device name to suspend_report_result()
Date: Thu, 3 Mar 2022 07:56:37 +0900	[thread overview]
Message-ID: <044701d82e88$c5edb6f0$51c924d0$@samsung.com> (raw)
In-Reply-To: <20220302201600.GA746065@bhelgaas>

> -----Original Message-----
> From: Bjorn Helgaas <helgaas@kernel.org>
> Sent: Thursday, March 3, 2022 5:16 AM
> To: 'Greg Kroah-Hartman' <gregkh@linuxfoundation.org>
> Cc: �念��/TV S/W Lab(VD)/Staff Engineer/�Z���� <yj84.jang@samsung.com>;
> 'Rafael J. Wysocki' <rafael@kernel.org>; 'Pavel Machek' <pavel@ucw.cz>;
> 'Len Brown' <len.brown@intel.com>; 'Bjorn Helgaas' <bhelgaas@google.com>;
> linux-pm@vger.kernel.org; linux-kernel@vger.kernel.org; linux-
> pci@vger.kernel.org; linux-acpi@vger.kernel.org; linux-usb@vger.kernel.org;
> js07.lee@samsung.com
> Subject: Re: [PATCH] PM: Add device name to suspend_report_result()
> 
> On Wed, Mar 02, 2022 at 03:52:51PM +0100, 'Greg Kroah-Hartman' wrote:
> > On Wed, Mar 02, 2022 at 08:00:14PM +0900,  念  /TV S/W Lab(VD)/Staff
> Engineer/ Z     wrote:
> > > > -----Original Message-----
> > > > From: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
> > > > Sent: Wednesday, March 2, 2022 4:58 PM
> > > > To: Youngjin Jang <yj84.jang@samsung.com>
> > > > Cc: Rafael J. Wysocki <rafael@kernel.org>; Pavel Machek
> > > > <pavel@ucw.cz>; Len Brown <len.brown@intel.com>; Bjorn Helgaas
> > > > <bhelgaas@google.com>; linux-pm@vger.kernel.org;
> > > > linux-kernel@vger.kernel.org; linux- pci@vger.kernel.org;
> > > > linux-acpi@vger.kernel.org; linux-
> > > usb@vger.kernel.org;
> > > > js07.lee@samsung.com
> > > > Subject: Re: [PATCH] PM: Add device name to
> > > > suspend_report_result()
> > > >
> > > > On Wed, Mar 02, 2022 at 03:49:17PM +0900, Youngjin Jang wrote:
> > > > > From: "yj84.jang" <yj84.jang@samsung.com>
> > > > >
> > > > > currently, suspend_report_result() prints only function
> information.
> > > > > If any driver uses common pm function, nobody knows who called
> > > > > failed function exactly.
> > > > >
> > > > > So, device information is needed to recognize specific wrong
> driver.
> > > > >
> > > > > e.g.)
> > > > > PM: dpm_run_callback(): pm_generic_suspend+0x0/0x48 returns 0
> > > > > PM: dpm_run_callback(): platform_pm_suspend+0x0/0x68 returns 0
> > > > > after patch,
> > > > > PM: dpm_run_callback(): pm_generic_suspend+0x0/0x48 (amba)
> > > > > returns 0
> > > > > PM: dpm_run_callback(): platform_pm_suspend+0x0/0x68 (armv7-pmu)
> > > > > returns 0
> 
> > > > > -		pr_err("%s(): %pS returns %d\n", function, fn, ret);
> > > > > +		pr_err("%s(): %pS (%s) returns %d\n", function, fn,
> > > > > +dev_driver_string(dev), ret);
> > > >
> > > > If you have a struct device, please use dev_err().
> > >
> > > I think dev_err() is nice option, but we can see a minor issue.
> > > Prefix log "PM: " would be lost, If I use dev_err() in this context.
> > > As you know, all logs in power management include "PM :" prefix.
> >
> > Why does that matter?  Fix them all to use the struct device pointer
> > and then they will be properly unified with the rest of the kernel log
> > infrastructure.
> 
> You can #define dev_fmt if you need a prefix.

I tested dev_fmt before, but I feel that not a good solution.
Because the readability is not so great than I expected.
I didn't want to break the PM logging rules.

Anyway, I got you guys opinion.
Let me try second patch with dev_err().



  reply	other threads:[~2022-03-03  0:15 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <CGME20220302064921epcas1p19fbe8c017d776657caa696a3cef10093@epcas1p1.samsung.com>
2022-03-02  6:49 ` [PATCH] PM: Add device name to suspend_report_result() Youngjin Jang
2022-03-02  7:56   ` Greg Kroah-Hartman
2022-03-02  7:57   ` Greg Kroah-Hartman
2022-03-02 11:00     ` 장영진/TV S/W Lab(VD)/Staff Engineer/삼성전자
2022-03-02 14:52       ` 'Greg Kroah-Hartman'
2022-03-02 20:16         ` Bjorn Helgaas
2022-03-02 22:56           ` 장영진/TV S/W Lab(VD)/Staff Engineer/삼성전자 [this message]
2022-03-03 17:57             ` Bjorn Helgaas

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='044701d82e88$c5edb6f0$51c924d0$@samsung.com' \
    --to=yj84.jang@samsung.com \
    --cc=bhelgaas@google.com \
    --cc=gregkh@linuxfoundation.org \
    --cc=helgaas@kernel.org \
    --cc=js07.lee@samsung.com \
    --cc=len.brown@intel.com \
    --cc=linux-acpi@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-pci@vger.kernel.org \
    --cc=linux-pm@vger.kernel.org \
    --cc=linux-usb@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