2013-03-06 07:00:18

by Sukadev Bhattiprolu

[permalink] [raw]
Subject: Re: [PATCH 5/6][v4]: perf: Create a sysfs entry for Power event format

Michael Ellerman [[email protected]] wrote:
| I suspect Arnaldo was either waiting for an ACK from Ben, or was
| expecting Ben to take it?

Arnaldo, here is an updated patch. If it is acked by Paul Mackerras,
Michael Ellerman or Ben, will you add it to your tree so the whole
patchset comes from one place ?

Sukadev

---
>From 50c7a46f14083c0ed10d66b7aed66ba76e798550 Mon Sep 17 00:00:00 2001
From: Sukadev Bhattiprolu <[email protected]>
Date: Tue, 5 Mar 2013 21:20:56 -0800
Subject: [PATCH] [PATCH 5/6][v4]: perf Create a sysfs format entry for Power7 events

Create a sysfs entry, '/sys/bus/event_source/devices/cpu/format/event'
which describes the format of the POWER7 PMU events.

This code is based on corresponding code in x86.

Changelog[v4]: [Michael Ellerman, Paul Mckerras] The event format is different
for other POWER cpus. So move the code to POWER7-specific,
power7-pmu.c Also, the POWER7 format uses bits 0-19 not 0-20.

Changelog[v2]: [Jiri Osla] Use PMU_FORMAT_ATTR rather than duplicating code.

Signed-off-by: Sukadev Bhattiprolu <[email protected]>
---
arch/powerpc/perf/power7-pmu.c | 13 +++++++++++++
1 files changed, 13 insertions(+), 0 deletions(-)

diff --git a/arch/powerpc/perf/power7-pmu.c b/arch/powerpc/perf/power7-pmu.c
index b554879..3c475d6 100644
--- a/arch/powerpc/perf/power7-pmu.c
+++ b/arch/powerpc/perf/power7-pmu.c
@@ -420,7 +420,20 @@ static struct attribute_group power7_pmu_events_group = {
.attrs = power7_events_attr,
};

+PMU_FORMAT_ATTR(event, "config:0-19");
+
+static struct attribute *power7_pmu_format_attr[] = {
+ &format_attr_event.attr,
+ NULL,
+};
+
+struct attribute_group power7_pmu_format_group = {
+ .name = "format",
+ .attrs = power7_pmu_format_attr,
+};
+
static const struct attribute_group *power7_pmu_attr_groups[] = {
+ &power7_pmu_format_group,
&power7_pmu_events_group,
NULL,
};
--
1.7.1


2013-03-12 09:27:53

by Paul Mackerras

[permalink] [raw]
Subject: Re: [PATCH 5/6][v4]: perf: Create a sysfs entry for Power event format

On Tue, Mar 05, 2013 at 09:48:26PM -0800, Sukadev Bhattiprolu wrote:
> Michael Ellerman [[email protected]] wrote:
> | I suspect Arnaldo was either waiting for an ACK from Ben, or was
> | expecting Ben to take it?
>
> Arnaldo, here is an updated patch. If it is acked by Paul Mackerras,
> Michael Ellerman or Ben, will you add it to your tree so the whole
> patchset comes from one place ?
>
> Sukadev
>
> ---
> >From 50c7a46f14083c0ed10d66b7aed66ba76e798550 Mon Sep 17 00:00:00 2001
> From: Sukadev Bhattiprolu <[email protected]>
> Date: Tue, 5 Mar 2013 21:20:56 -0800
> Subject: [PATCH] [PATCH 5/6][v4]: perf Create a sysfs format entry for Power7 events
>
> Create a sysfs entry, '/sys/bus/event_source/devices/cpu/format/event'
> which describes the format of the POWER7 PMU events.
>
> This code is based on corresponding code in x86.
>
> Changelog[v4]: [Michael Ellerman, Paul Mckerras] The event format is different
> for other POWER cpus. So move the code to POWER7-specific,
> power7-pmu.c Also, the POWER7 format uses bits 0-19 not 0-20.
>
> Changelog[v2]: [Jiri Osla] Use PMU_FORMAT_ATTR rather than duplicating code.
>
> Signed-off-by: Sukadev Bhattiprolu <[email protected]>

Acked-by: Paul Mackerras <[email protected]>

2013-03-13 00:15:48

by Michael Ellerman

[permalink] [raw]
Subject: Re: [PATCH 5/6][v4]: perf: Create a sysfs entry for Power event format

On Tue, Mar 12, 2013 at 08:27:40PM +1100, Paul Mackerras wrote:
> On Tue, Mar 05, 2013 at 09:48:26PM -0800, Sukadev Bhattiprolu wrote:
> > Michael Ellerman [[email protected]] wrote:
> > | I suspect Arnaldo was either waiting for an ACK from Ben, or was
> > | expecting Ben to take it?
> >
> > Arnaldo, here is an updated patch. If it is acked by Paul Mackerras,
> > Michael Ellerman or Ben, will you add it to your tree so the whole
> > patchset comes from one place ?
> >
> > Sukadev
> >
> > ---
> > >From 50c7a46f14083c0ed10d66b7aed66ba76e798550 Mon Sep 17 00:00:00 2001
> > From: Sukadev Bhattiprolu <[email protected]>
> > Date: Tue, 5 Mar 2013 21:20:56 -0800
> > Subject: [PATCH] [PATCH 5/6][v4]: perf Create a sysfs format entry for Power7 events
> >
> > Create a sysfs entry, '/sys/bus/event_source/devices/cpu/format/event'
> > which describes the format of the POWER7 PMU events.
> >
> > This code is based on corresponding code in x86.
> >
> > Changelog[v4]: [Michael Ellerman, Paul Mckerras] The event format is different
> > for other POWER cpus. So move the code to POWER7-specific,
> > power7-pmu.c Also, the POWER7 format uses bits 0-19 not 0-20.
> >
> > Changelog[v2]: [Jiri Osla] Use PMU_FORMAT_ATTR rather than duplicating code.
> >
> > Signed-off-by: Sukadev Bhattiprolu <[email protected]>
>
> Acked-by: Paul Mackerras <[email protected]>

Tested-by: Michael Ellerman <[email protected]>

cheers

Subject: [tip:perf/urgent] perf/POWER7: Create a sysfs format entry for Power7 events

Commit-ID: 3bf7b07ece6e00747602938f68c1db8001b9925f
Gitweb: http://git.kernel.org/tip/3bf7b07ece6e00747602938f68c1db8001b9925f
Author: Sukadev Bhattiprolu <[email protected]>
AuthorDate: Tue, 5 Mar 2013 21:48:26 -0800
Committer: Arnaldo Carvalho de Melo <[email protected]>
CommitDate: Wed, 13 Mar 2013 17:01:04 -0300

perf/POWER7: Create a sysfs format entry for Power7 events

Create a sysfs entry, '/sys/bus/event_source/devices/cpu/format/event'
which describes the format of the POWER7 PMU events.

This code is based on corresponding code in x86.

Changelog[v4]: [Michael Ellerman, Paul Mckerras] The event format is different
for other POWER cpus. So move the code to POWER7-specific,
power7-pmu.c Also, the POWER7 format uses bits 0-19 not 0-20.

Changelog[v2]: [Jiri Osla] Use PMU_FORMAT_ATTR rather than duplicating code.

Signed-off-by: Sukadev Bhattiprolu <[email protected]>
Acked-by: Paul Mackerras <[email protected]>
Tested-by: Michael Ellerman <[email protected]>
Cc: Andi Kleen <[email protected]>
Cc: Anton Blanchard <[email protected]>
Cc: Ingo Molnar <[email protected]>
Cc: Jiri Olsa <[email protected]>
Cc: Michael Ellerman <[email protected]>
Cc: Paul Mackerras <[email protected]>
Cc: Peter Zijlstra <[email protected]>
Cc: Robert Richter <[email protected]>
Cc: Stephane Eranian <[email protected]>
Cc: [email protected]
Cc: [email protected]
Link: http://lkml.kernel.org/r/[email protected]
Signed-off-by: Arnaldo Carvalho de Melo <[email protected]>
---
arch/powerpc/perf/power7-pmu.c | 13 +++++++++++++
1 file changed, 13 insertions(+)

diff --git a/arch/powerpc/perf/power7-pmu.c b/arch/powerpc/perf/power7-pmu.c
index b554879..3c475d6 100644
--- a/arch/powerpc/perf/power7-pmu.c
+++ b/arch/powerpc/perf/power7-pmu.c
@@ -420,7 +420,20 @@ static struct attribute_group power7_pmu_events_group = {
.attrs = power7_events_attr,
};

+PMU_FORMAT_ATTR(event, "config:0-19");
+
+static struct attribute *power7_pmu_format_attr[] = {
+ &format_attr_event.attr,
+ NULL,
+};
+
+struct attribute_group power7_pmu_format_group = {
+ .name = "format",
+ .attrs = power7_pmu_format_attr,
+};
+
static const struct attribute_group *power7_pmu_attr_groups[] = {
+ &power7_pmu_format_group,
&power7_pmu_events_group,
NULL,
};