mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Joe Perches <joe@perches.com>
To: Doug Smythies <dsmythies@telus.net>,
	"'Srinivas Pandruvada'" <srinivas.pandruvada@linux.intel.com>,
	"'Len Brown'" <lenb@kernel.org>,
	"'Rafael J. Wysocki'" <rjw@rjwysocki.net>,
	"'Viresh Kumar'" <viresh.kumar@linaro.org>
Cc: linux-pm@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH 1/3] intel_pstate: Use pr_fmt
Date: Wed, 06 Apr 2016 08:12:55 -0700	[thread overview]
Message-ID: <1459955575.6715.46.camel@perches.com> (raw)
In-Reply-To: <002601d19013$c129de60$437d9b20$@net>

On Wed, 2016-04-06 at 07:51 -0700, Doug Smythies wrote:
> On 2016.04.05 02:44 Srinivas Pandruvada wrote:
> > 
> > On Tue, 2016-04-05 at 13:28 -0700, Joe Perches wrote:
> > > 
> > > Prefix the output using the more common kernel style.
> > > 
> > > Signed-off-by: Joe Perches <joe@perches.com>
> > Acked-by: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com>
> > > 
> > > ---
> > >  drivers/cpufreq/intel_pstate.c | 18 ++++++++++--------
> > >  1 file changed, 10 insertions(+), 8 deletions(-)
> ...[cut, example left]...
> 
> > 
> > -		pr_warn("intel_pstate: Turbo disabled by BIOS or
> > unavailable on processor\n");
> > +		pr_warn("Turbo disabled by BIOS or unavailable on
> > processor\n");
> I do  not understand.
> The common and unique string "intel_pstate" was added on purpose
> so as to provide a way to easily extract the related message from
> an otherwise huge log file.
> 

The more common kernel mechanism to prefix messages
is using a pr_fmt define like:

#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt

This style is used ~1000 times in the kernel tree.

All of the pr_<level> macros are defined like:

#define pr_info(fmt, ...) \
	printk(KERN_INFO pr_fmt(fmt), ##__VA_ARGS__)

so this prefixes all messages and means that any
new message added later will also be prefixed without
copy/paste defects or omission.

  parent reply	other threads:[~2016-04-06 15:13 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-04-05 20:28 [PATCH 0/3] cpufreq: logging consistency changes Joe Perches
2016-04-05 20:28 ` [PATCH 1/3] intel_pstate: Use pr_fmt Joe Perches
2016-04-05 21:43   ` Srinivas Pandruvada
2016-04-06 14:51     ` Doug Smythies
2016-04-06 15:01       ` Viresh Kumar
2016-04-06 15:12       ` Joe Perches [this message]
2016-04-06 15:47         ` Doug Smythies
2016-04-06  6:14   ` Viresh Kumar
2016-04-05 20:28 ` [PATCH 2/3] cpufreq: Convert printk(KERN_<LEVEL> to pr_<level> Joe Perches
2016-04-06  6:20   ` Viresh Kumar
2016-04-05 20:28 ` [PATCH 3/3] cpufreq: Use consistent prefixing via pr_fmt Joe Perches
2016-04-06  6:23   ` Viresh Kumar
2016-04-22  0:40 ` [PATCH 0/3] cpufreq: logging consistency changes 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=1459955575.6715.46.camel@perches.com \
    --to=joe@perches.com \
    --cc=dsmythies@telus.net \
    --cc=lenb@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-pm@vger.kernel.org \
    --cc=rjw@rjwysocki.net \
    --cc=srinivas.pandruvada@linux.intel.com \
    --cc=viresh.kumar@linaro.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

Powered by JetHome