* [PATCH] turbostat, servers do not support uncore power register
@ 2013-12-20 0:27 Prarit Bhargava
2014-01-06 22:31 ` Rafael J. Wysocki
2014-01-19 3:50 ` Len Brown
0 siblings, 2 replies; 4+ messages in thread
From: Prarit Bhargava @ 2013-12-20 0:27 UTC (permalink / raw)
To: linux-kernel
Cc: Prarit Bhargava, Len Brown, Rafael J. Wysocki, Josh Triplett,
Kristen Carlson Accardi
>From the Intel Software Developer's Manual section 14.7.4,
"For server platforms, PP1 domain is not supported, but its PP0 domain
supports the MSR_PP0_PERF_STATUS interface."
When I run 'turbostat ls' I see the following error:
/dev/cpu/0/msr offset 0x641 read failed
because the server doesn't support the MSR_PP1_ENERGY_STATUS
register (0x641). This patch implements a get_msr_nowarn() which suppresses the
above warning and then sets !RAPL_GFX.
Signed-off-by: Prarit Bhargava <prarit@redhat.com>
Cc: Len Brown <len.brown@intel.com>
Cc: "Rafael J. Wysocki" <rafael.j.wysocki@intel.com>
Cc: Josh Triplett <josh@joshtriplett.org>
Cc: Kristen Carlson Accardi <kristen@linux.intel.com>
---
tools/power/x86/turbostat/turbostat.c | 23 ++++++++++++++++++-----
1 file changed, 18 insertions(+), 5 deletions(-)
diff --git a/tools/power/x86/turbostat/turbostat.c b/tools/power/x86/turbostat/turbostat.c
index 9d77f13..ff505c2 100644
--- a/tools/power/x86/turbostat/turbostat.c
+++ b/tools/power/x86/turbostat/turbostat.c
@@ -219,7 +219,7 @@ int cpu_migrate(int cpu)
return 0;
}
-int get_msr(int cpu, off_t offset, unsigned long long *msr)
+int _get_msr(int cpu, off_t offset, unsigned long long *msr, int warn)
{
ssize_t retval;
char pathname[32];
@@ -234,13 +234,25 @@ int get_msr(int cpu, off_t offset, unsigned long long *msr)
close(fd);
if (retval != sizeof *msr) {
- fprintf(stderr, "%s offset 0x%zx read failed\n", pathname, offset);
+ if (warn)
+ fprintf(stderr, "%s offset 0x%zx read failed\n",
+ pathname, offset);
return -1;
}
return 0;
}
+int get_msr(int cpu, off_t offset, unsigned long long *msr)
+{
+ return _get_msr(cpu, offset, msr, 1);
+}
+
+int get_msr_nowarn(int cpu, off_t offset, unsigned long long *msr)
+{
+ return _get_msr(cpu, offset, msr, 0);
+}
+
void print_header(void)
{
if (show_pkg)
@@ -953,9 +965,10 @@ int get_counters(struct thread_data *t, struct core_data *c, struct pkg_data *p)
p->energy_dram = msr & 0xFFFFFFFF;
}
if (do_rapl & RAPL_GFX) {
- if (get_msr(cpu, MSR_PP1_ENERGY_STATUS, &msr))
- return -16;
- p->energy_gfx = msr & 0xFFFFFFFF;
+ if (get_msr_nowarn(cpu, MSR_PP1_ENERGY_STATUS, &msr))
+ do_rapl &= ~RAPL_GFX; /* unsupported on servers */
+ else
+ p->energy_gfx = msr & 0xFFFFFFFF;
}
if (do_rapl & RAPL_PKG_PERF_STATUS) {
if (get_msr(cpu, MSR_PKG_PERF_STATUS, &msr))
--
1.7.9.3
^ permalink raw reply related [flat|nested] 4+ messages in thread* Re: [PATCH] turbostat, servers do not support uncore power register
2013-12-20 0:27 [PATCH] turbostat, servers do not support uncore power register Prarit Bhargava
@ 2014-01-06 22:31 ` Rafael J. Wysocki
2014-01-19 3:50 ` Len Brown
1 sibling, 0 replies; 4+ messages in thread
From: Rafael J. Wysocki @ 2014-01-06 22:31 UTC (permalink / raw)
To: Prarit Bhargava
Cc: linux-kernel, Len Brown, Rafael J. Wysocki, Josh Triplett,
Kristen Carlson Accardi
On Thursday, December 19, 2013 07:27:22 PM Prarit Bhargava wrote:
> From the Intel Software Developer's Manual section 14.7.4,
>
> "For server platforms, PP1 domain is not supported, but its PP0 domain
> supports the MSR_PP0_PERF_STATUS interface."
>
> When I run 'turbostat ls' I see the following error:
>
> /dev/cpu/0/msr offset 0x641 read failed
>
> because the server doesn't support the MSR_PP1_ENERGY_STATUS
> register (0x641). This patch implements a get_msr_nowarn() which suppresses the
> above warning and then sets !RAPL_GFX.
>
> Signed-off-by: Prarit Bhargava <prarit@redhat.com>
> Cc: Len Brown <len.brown@intel.com>
> Cc: "Rafael J. Wysocki" <rafael.j.wysocki@intel.com>
> Cc: Josh Triplett <josh@joshtriplett.org>
> Cc: Kristen Carlson Accardi <kristen@linux.intel.com>
Queued up for 3.14, thanks!
> ---
> tools/power/x86/turbostat/turbostat.c | 23 ++++++++++++++++++-----
> 1 file changed, 18 insertions(+), 5 deletions(-)
>
> diff --git a/tools/power/x86/turbostat/turbostat.c b/tools/power/x86/turbostat/turbostat.c
> index 9d77f13..ff505c2 100644
> --- a/tools/power/x86/turbostat/turbostat.c
> +++ b/tools/power/x86/turbostat/turbostat.c
> @@ -219,7 +219,7 @@ int cpu_migrate(int cpu)
> return 0;
> }
>
> -int get_msr(int cpu, off_t offset, unsigned long long *msr)
> +int _get_msr(int cpu, off_t offset, unsigned long long *msr, int warn)
> {
> ssize_t retval;
> char pathname[32];
> @@ -234,13 +234,25 @@ int get_msr(int cpu, off_t offset, unsigned long long *msr)
> close(fd);
>
> if (retval != sizeof *msr) {
> - fprintf(stderr, "%s offset 0x%zx read failed\n", pathname, offset);
> + if (warn)
> + fprintf(stderr, "%s offset 0x%zx read failed\n",
> + pathname, offset);
> return -1;
> }
>
> return 0;
> }
>
> +int get_msr(int cpu, off_t offset, unsigned long long *msr)
> +{
> + return _get_msr(cpu, offset, msr, 1);
> +}
> +
> +int get_msr_nowarn(int cpu, off_t offset, unsigned long long *msr)
> +{
> + return _get_msr(cpu, offset, msr, 0);
> +}
> +
> void print_header(void)
> {
> if (show_pkg)
> @@ -953,9 +965,10 @@ int get_counters(struct thread_data *t, struct core_data *c, struct pkg_data *p)
> p->energy_dram = msr & 0xFFFFFFFF;
> }
> if (do_rapl & RAPL_GFX) {
> - if (get_msr(cpu, MSR_PP1_ENERGY_STATUS, &msr))
> - return -16;
> - p->energy_gfx = msr & 0xFFFFFFFF;
> + if (get_msr_nowarn(cpu, MSR_PP1_ENERGY_STATUS, &msr))
> + do_rapl &= ~RAPL_GFX; /* unsupported on servers */
> + else
> + p->energy_gfx = msr & 0xFFFFFFFF;
> }
> if (do_rapl & RAPL_PKG_PERF_STATUS) {
> if (get_msr(cpu, MSR_PKG_PERF_STATUS, &msr))
>
--
I speak only for myself.
Rafael J. Wysocki, Intel Open Source Technology Center.
^ permalink raw reply [flat|nested] 4+ messages in thread* Re: [PATCH] turbostat, servers do not support uncore power register
2013-12-20 0:27 [PATCH] turbostat, servers do not support uncore power register Prarit Bhargava
2014-01-06 22:31 ` Rafael J. Wysocki
@ 2014-01-19 3:50 ` Len Brown
2014-01-19 13:21 ` Prarit Bhargava
1 sibling, 1 reply; 4+ messages in thread
From: Len Brown @ 2014-01-19 3:50 UTC (permalink / raw)
To: Prarit Bhargava
Cc: linux-kernel@vger.kernel.org, Len Brown, Rafael J. Wysocki,
Josh Triplett, Kristen Carlson Accardi
On Thu, Dec 19, 2013 at 7:27 PM, Prarit Bhargava <prarit@redhat.com> wrote:
> From the Intel Software Developer's Manual section 14.7.4,
>
> "For server platforms, PP1 domain is not supported, but its PP0 domain
> supports the MSR_PP0_PERF_STATUS interface."
>
> When I run 'turbostat ls' I see the following error:
>
> /dev/cpu/0/msr offset 0x641 read failed
Let me know if you see this when running turbostat v3.6 or later.
you can find that version in the linux-next tree.
thanks,
Len Brown, Intel Open Source Technology Center
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] turbostat, servers do not support uncore power register
2014-01-19 3:50 ` Len Brown
@ 2014-01-19 13:21 ` Prarit Bhargava
0 siblings, 0 replies; 4+ messages in thread
From: Prarit Bhargava @ 2014-01-19 13:21 UTC (permalink / raw)
To: Len Brown
Cc: linux-kernel@vger.kernel.org, Len Brown, Rafael J. Wysocki,
Josh Triplett, Kristen Carlson Accardi
On 01/18/2014 10:50 PM, Len Brown wrote:
> On Thu, Dec 19, 2013 at 7:27 PM, Prarit Bhargava <prarit@redhat.com> wrote:
>> From the Intel Software Developer's Manual section 14.7.4,
>>
>> "For server platforms, PP1 domain is not supported, but its PP0 domain
>> supports the MSR_PP0_PERF_STATUS interface."
>>
>> When I run 'turbostat ls' I see the following error:
>>
>> /dev/cpu/0/msr offset 0x641 read failed
>
> Let me know if you see this when running turbostat v3.6 or later.
> you can find that version in the linux-next tree.
>
Len, looks like v3.6 works -- I'll do some additional testing to confirm but
AFAICT it does work on the affected systems.
P.
> thanks,
> Len Brown, Intel Open Source Technology Center
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2014-01-19 13:21 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-12-20 0:27 [PATCH] turbostat, servers do not support uncore power register Prarit Bhargava
2014-01-06 22:31 ` Rafael J. Wysocki
2014-01-19 3:50 ` Len Brown
2014-01-19 13:21 ` Prarit Bhargava
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.