Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1371919 > unrolled thread
| Started by | Joe Perches <joe@perches.com> |
|---|---|
| First post | 2016-04-05 22:30 +0200 |
| Last post | 2016-04-06 08:30 +0200 |
| Articles | 9 — 4 participants |
Back to article view | Back to linux.kernel
[PATCH 0/3] cpufreq: logging consistency changes Joe Perches <joe@perches.com> - 2016-04-05 22:30 +0200
[PATCH 1/3] intel_pstate: Use pr_fmt Joe Perches <joe@perches.com> - 2016-04-05 22:30 +0200
Re: [PATCH 1/3] intel_pstate: Use pr_fmt Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com> - 2016-04-06 00:00 +0200
RE: [PATCH 1/3] intel_pstate: Use pr_fmt "Doug Smythies" <dsmythies@telus.net> - 2016-04-06 17:00 +0200
Re: [PATCH 1/3] intel_pstate: Use pr_fmt Viresh Kumar <viresh.kumar@linaro.org> - 2016-04-06 17:10 +0200
Re: [PATCH 1/3] intel_pstate: Use pr_fmt Joe Perches <joe@perches.com> - 2016-04-06 17:20 +0200
RE: [PATCH 1/3] intel_pstate: Use pr_fmt "Doug Smythies" <dsmythies@telus.net> - 2016-04-06 17:50 +0200
Re: [PATCH 1/3] intel_pstate: Use pr_fmt Viresh Kumar <viresh.kumar@linaro.org> - 2016-04-06 08:20 +0200
Re: [PATCH 3/3] cpufreq: Use consistent prefixing via pr_fmt Viresh Kumar <viresh.kumar@linaro.org> - 2016-04-06 08:30 +0200
| From | Joe Perches <joe@perches.com> |
|---|---|
| Date | 2016-04-05 22:30 +0200 |
| Subject | [PATCH 0/3] cpufreq: logging consistency changes |
| Message-ID | <rkFLQ-172-3@gated-at.bofh.it> |
Trivial consistency changes. Joe Perches (3): intel_pstate: Use pr_fmt cpufreq: Convert printk(KERN_<LEVEL> to pr_<level> cpufreq: Use consistent prefixing via pr_fmt drivers/cpufreq/acpi-cpufreq.c | 16 +++--- drivers/cpufreq/cpufreq-nforce2.c | 28 +++++------ drivers/cpufreq/e_powersaver.c | 62 ++++++++++------------- drivers/cpufreq/elanfreq.c | 4 +- drivers/cpufreq/ia64-acpi-cpufreq.c | 10 ++-- drivers/cpufreq/intel_pstate.c | 18 ++++--- drivers/cpufreq/longhaul.c | 84 +++++++++++++------------------ drivers/cpufreq/loongson2_cpufreq.c | 7 ++- drivers/cpufreq/maple-cpufreq.c | 11 ++-- drivers/cpufreq/omap-cpufreq.c | 7 ++- drivers/cpufreq/p4-clockmod.c | 19 ++----- drivers/cpufreq/pmac32-cpufreq.c | 14 +++--- drivers/cpufreq/pmac64-cpufreq.c | 47 +++++++++-------- drivers/cpufreq/powernow-k6.c | 16 +++--- drivers/cpufreq/powernow-k7.c | 70 +++++++++++--------------- drivers/cpufreq/pxa2xx-cpufreq.c | 18 +++---- drivers/cpufreq/s3c2412-cpufreq.c | 15 +++--- drivers/cpufreq/s3c2440-cpufreq.c | 6 ++- drivers/cpufreq/s3c24xx-cpufreq-debugfs.c | 4 +- drivers/cpufreq/s3c24xx-cpufreq.c | 59 +++++++++++----------- drivers/cpufreq/s5pv210-cpufreq.c | 10 ++-- drivers/cpufreq/sc520_freq.c | 10 ++-- drivers/cpufreq/speedstep-centrino.c | 6 +-- drivers/cpufreq/speedstep-ich.c | 8 +-- drivers/cpufreq/speedstep-lib.c | 11 ++-- drivers/cpufreq/speedstep-smi.c | 7 +-- 26 files changed, 269 insertions(+), 298 deletions(-) -- 2.8.0.rc4.16.g56331f8
[toc] | [next] | [standalone]
| From | Joe Perches <joe@perches.com> |
|---|---|
| Date | 2016-04-05 22:30 +0200 |
| Subject | [PATCH 1/3] intel_pstate: Use pr_fmt |
| Message-ID | <rkFLQ-172-9@gated-at.bofh.it> |
| In reply to | #1371919 |
Prefix the output using the more common kernel style.
Signed-off-by: Joe Perches <joe@perches.com>
---
drivers/cpufreq/intel_pstate.c | 18 ++++++++++--------
1 file changed, 10 insertions(+), 8 deletions(-)
diff --git a/drivers/cpufreq/intel_pstate.c b/drivers/cpufreq/intel_pstate.c
index a382195..e674db8 100644
--- a/drivers/cpufreq/intel_pstate.c
+++ b/drivers/cpufreq/intel_pstate.c
@@ -10,6 +10,8 @@
* of the License.
*/
+#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
+
#include <linux/kernel.h>
#include <linux/kernel_stat.h>
#include <linux/module.h>
@@ -436,7 +438,7 @@ static ssize_t store_no_turbo(struct kobject *a, struct attribute *b,
update_turbo_state();
if (limits->turbo_disabled) {
- pr_warn("intel_pstate: Turbo disabled by BIOS or unavailable on processor\n");
+ pr_warn("Turbo disabled by BIOS or unavailable on processor\n");
return -EPERM;
}
@@ -1107,7 +1109,7 @@ static int intel_pstate_init_cpu(unsigned int cpunum)
intel_pstate_busy_pid_reset(cpu);
- pr_debug("intel_pstate: controlling: cpu %d\n", cpunum);
+ pr_debug("controlling: cpu %d\n", cpunum);
return 0;
}
@@ -1149,12 +1151,12 @@ static int intel_pstate_set_policy(struct cpufreq_policy *policy)
if (policy->policy == CPUFREQ_POLICY_PERFORMANCE &&
policy->max >= policy->cpuinfo.max_freq) {
- pr_debug("intel_pstate: set performance\n");
+ pr_debug("set performance\n");
limits = &performance_limits;
goto out;
}
- pr_debug("intel_pstate: set powersave\n");
+ pr_debug("set powersave\n");
limits = &powersave_limits;
limits->min_policy_pct = (policy->min * 100) / policy->cpuinfo.max_freq;
limits->min_policy_pct = clamp_t(int, limits->min_policy_pct, 0 , 100);
@@ -1206,7 +1208,7 @@ static void intel_pstate_stop_cpu(struct cpufreq_policy *policy)
int cpu_num = policy->cpu;
struct cpudata *cpu = all_cpu_data[cpu_num];
- pr_debug("intel_pstate: CPU %d exiting\n", cpu_num);
+ pr_debug("CPU %d exiting\n", cpu_num);
intel_pstate_clear_update_util_hook(cpu_num);
@@ -1451,7 +1453,7 @@ hwp_cpu_matched:
if (intel_pstate_platform_pwr_mgmt_exists())
return -ENODEV;
- pr_info("Intel P-state driver initializing.\n");
+ pr_info("Intel P-state driver initializing\n");
all_cpu_data = vzalloc(sizeof(void *) * num_possible_cpus());
if (!all_cpu_data)
@@ -1468,7 +1470,7 @@ hwp_cpu_matched:
intel_pstate_sysfs_expose_params();
if (hwp_active)
- pr_info("intel_pstate: HWP enabled\n");
+ pr_info("HWP enabled\n");
return rc;
out:
@@ -1494,7 +1496,7 @@ static int __init intel_pstate_setup(char *str)
if (!strcmp(str, "disable"))
no_load = 1;
if (!strcmp(str, "no_hwp")) {
- pr_info("intel_pstate: HWP disabled\n");
+ pr_info("HWP disabled\n");
no_hwp = 1;
}
if (!strcmp(str, "force"))
--
2.8.0.rc4.16.g56331f8
[toc] | [prev] | [next] | [standalone]
| From | Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com> |
|---|---|
| Date | 2016-04-06 00:00 +0200 |
| Subject | Re: [PATCH 1/3] intel_pstate: Use pr_fmt |
| Message-ID | <rkHaX-1X2-51@gated-at.bofh.it> |
| In reply to | #1371920 |
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(-)
>
> diff --git a/drivers/cpufreq/intel_pstate.c
> b/drivers/cpufreq/intel_pstate.c
> index a382195..e674db8 100644
> --- a/drivers/cpufreq/intel_pstate.c
> +++ b/drivers/cpufreq/intel_pstate.c
> @@ -10,6 +10,8 @@
> * of the License.
> */
>
> +#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
> +
> #include <linux/kernel.h>
> #include <linux/kernel_stat.h>
> #include <linux/module.h>
> @@ -436,7 +438,7 @@ static ssize_t store_no_turbo(struct kobject *a,
> struct attribute *b,
>
> update_turbo_state();
> if (limits->turbo_disabled) {
> - pr_warn("intel_pstate: Turbo disabled by BIOS or
> unavailable on processor\n");
> + pr_warn("Turbo disabled by BIOS or unavailable on
> processor\n");
> return -EPERM;
> }
>
> @@ -1107,7 +1109,7 @@ static int intel_pstate_init_cpu(unsigned int
> cpunum)
>
> intel_pstate_busy_pid_reset(cpu);
>
> - pr_debug("intel_pstate: controlling: cpu %d\n", cpunum);
> + pr_debug("controlling: cpu %d\n", cpunum);
>
> return 0;
> }
> @@ -1149,12 +1151,12 @@ static int intel_pstate_set_policy(struct
> cpufreq_policy *policy)
>
> if (policy->policy == CPUFREQ_POLICY_PERFORMANCE &&
> policy->max >= policy->cpuinfo.max_freq) {
> - pr_debug("intel_pstate: set performance\n");
> + pr_debug("set performance\n");
> limits = &performance_limits;
> goto out;
> }
>
> - pr_debug("intel_pstate: set powersave\n");
> + pr_debug("set powersave\n");
> limits = &powersave_limits;
> limits->min_policy_pct = (policy->min * 100) / policy-
> >cpuinfo.max_freq;
> limits->min_policy_pct = clamp_t(int, limits-
> >min_policy_pct, 0 , 100);
> @@ -1206,7 +1208,7 @@ static void intel_pstate_stop_cpu(struct
> cpufreq_policy *policy)
> int cpu_num = policy->cpu;
> struct cpudata *cpu = all_cpu_data[cpu_num];
>
> - pr_debug("intel_pstate: CPU %d exiting\n", cpu_num);
> + pr_debug("CPU %d exiting\n", cpu_num);
>
> intel_pstate_clear_update_util_hook(cpu_num);
>
> @@ -1451,7 +1453,7 @@ hwp_cpu_matched:
> if (intel_pstate_platform_pwr_mgmt_exists())
> return -ENODEV;
>
> - pr_info("Intel P-state driver initializing.\n");
> + pr_info("Intel P-state driver initializing\n");
>
> all_cpu_data = vzalloc(sizeof(void *) *
> num_possible_cpus());
> if (!all_cpu_data)
> @@ -1468,7 +1470,7 @@ hwp_cpu_matched:
> intel_pstate_sysfs_expose_params();
>
> if (hwp_active)
> - pr_info("intel_pstate: HWP enabled\n");
> + pr_info("HWP enabled\n");
>
> return rc;
> out:
> @@ -1494,7 +1496,7 @@ static int __init intel_pstate_setup(char *str)
> if (!strcmp(str, "disable"))
> no_load = 1;
> if (!strcmp(str, "no_hwp")) {
> - pr_info("intel_pstate: HWP disabled\n");
> + pr_info("HWP disabled\n");
> no_hwp = 1;
> }
> if (!strcmp(str, "force"))
[toc] | [prev] | [next] | [standalone]
| From | "Doug Smythies" <dsmythies@telus.net> |
|---|---|
| Date | 2016-04-06 17:00 +0200 |
| Subject | RE: [PATCH 1/3] intel_pstate: Use pr_fmt |
| Message-ID | <rkX62-5pE-17@gated-at.bofh.it> |
| In reply to | #1371994 |
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.
Reference:
commit f16255eb930173f386db0ce78ed41401aa8a94a6
[toc] | [prev] | [next] | [standalone]
| From | Viresh Kumar <viresh.kumar@linaro.org> |
|---|---|
| Date | 2016-04-06 17:10 +0200 |
| Subject | Re: [PATCH 1/3] intel_pstate: Use pr_fmt |
| Message-ID | <rkXfH-5Ne-11@gated-at.bofh.it> |
| In reply to | #1372582 |
On 06-04-16, 07:51, 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 first line of the patch does this:
+#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
which will automagically add name of the current file (intel_pstate)
before every print message printed using pr_*() helpers.
--
viresh
[toc] | [prev] | [next] | [standalone]
| From | Joe Perches <joe@perches.com> |
|---|---|
| Date | 2016-04-06 17:20 +0200 |
| Subject | Re: [PATCH 1/3] intel_pstate: Use pr_fmt |
| Message-ID | <rkXpo-5RF-29@gated-at.bofh.it> |
| In reply to | #1372582 |
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.
[toc] | [prev] | [next] | [standalone]
| From | "Doug Smythies" <dsmythies@telus.net> |
|---|---|
| Date | 2016-04-06 17:50 +0200 |
| Subject | RE: [PATCH 1/3] intel_pstate: Use pr_fmt |
| Message-ID | <rkXSq-64S-5@gated-at.bofh.it> |
| In reply to | #1372602 |
On 2106.03.06 08:13 Joe Perches wrote: > 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: > The more common kernel mechanism to prefix messages > is using a pr_fmt define like: > > #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt > so this prefixes all messages and means that any > new message added later will also be prefixed without > copy/paste defects or omission. Ok. Thanks for your reply and education (and Viresh also). And sorry for my the ignorance in my patch submission last May. ... Doug
[toc] | [prev] | [next] | [standalone]
| From | Viresh Kumar <viresh.kumar@linaro.org> |
|---|---|
| Date | 2016-04-06 08:20 +0200 |
| Subject | Re: [PATCH 1/3] intel_pstate: Use pr_fmt |
| Message-ID | <rkOYO-880-13@gated-at.bofh.it> |
| In reply to | #1371920 |
On 05-04-16, 13:28, Joe Perches wrote: > Prefix the output using the more common kernel style. > > Signed-off-by: Joe Perches <joe@perches.com> > --- > drivers/cpufreq/intel_pstate.c | 18 ++++++++++-------- > 1 file changed, 10 insertions(+), 8 deletions(-) Acked-by: Viresh Kumar <viresh.kumar@linaro.org> -- viresh
[toc] | [prev] | [next] | [standalone]
| From | Viresh Kumar <viresh.kumar@linaro.org> |
|---|---|
| Date | 2016-04-06 08:30 +0200 |
| Subject | Re: [PATCH 3/3] cpufreq: Use consistent prefixing via pr_fmt |
| Message-ID | <rkP8u-8cs-1@gated-at.bofh.it> |
| In reply to | #1371919 |
On 05-04-16, 13:28, Joe Perches wrote: > Use the more common kernel style adding a define for pr_fmt. > > Miscellanea: > > o Remove now unused PFX defines > > Signed-off-by: Joe Perches <joe@perches.com> > --- > drivers/cpufreq/acpi-cpufreq.c | 8 ++--- > drivers/cpufreq/cpufreq-nforce2.c | 20 +++++------ > drivers/cpufreq/e_powersaver.c | 38 ++++++++++---------- > drivers/cpufreq/elanfreq.c | 2 ++ > drivers/cpufreq/ia64-acpi-cpufreq.c | 5 +-- > drivers/cpufreq/longhaul.c | 60 +++++++++++++++---------------- > drivers/cpufreq/loongson2_cpufreq.c | 7 ++-- > drivers/cpufreq/maple-cpufreq.c | 6 ++-- > drivers/cpufreq/omap-cpufreq.c | 5 ++- > drivers/cpufreq/p4-clockmod.c | 10 +++--- > drivers/cpufreq/pmac32-cpufreq.c | 8 +++-- > drivers/cpufreq/pmac64-cpufreq.c | 28 ++++++++------- > drivers/cpufreq/powernow-k6.c | 15 ++++---- > drivers/cpufreq/powernow-k7.c | 43 +++++++++++----------- > drivers/cpufreq/pxa2xx-cpufreq.c | 13 +++---- > drivers/cpufreq/s3c2412-cpufreq.c | 14 ++++---- > drivers/cpufreq/s3c2440-cpufreq.c | 2 ++ > drivers/cpufreq/s3c24xx-cpufreq-debugfs.c | 2 ++ > drivers/cpufreq/s3c24xx-cpufreq.c | 8 +++-- > drivers/cpufreq/s5pv210-cpufreq.c | 6 ++-- > drivers/cpufreq/sc520_freq.c | 6 ++-- > drivers/cpufreq/speedstep-centrino.c | 5 +-- > drivers/cpufreq/speedstep-ich.c | 8 +++-- > drivers/cpufreq/speedstep-lib.c | 4 ++- > drivers/cpufreq/speedstep-smi.c | 4 ++- > 25 files changed, 181 insertions(+), 146 deletions(-) Acked-by: Viresh Kumar <viresh.kumar@linaro.org> -- viresh
[toc] | [prev] | [standalone]
Back to top | Article view | linux.kernel
csiph-web