[PATCH 2/3] perf/e6500: Create a sysfs format entry for e6500 events

Tom Huynh tom.huynh at freescale.com
Sat Feb 7 09:43:55 AEDT 2015


Create a sysfs entry, '/sys/bus/event_source/devices/cpu/format/event'
which describes the format of the e6500 PMU events. e6500 has <= 512
events, so use the 9 lsb to specify the raw event code.

	$ cat /sys/devices/cpu/format/event
	config:0-8

Similar to commit 3bf7b07ece6e ("perf/POWER7: Create a sysfs format
entry for Power7 events").

Signed-off-by: Kim Phillips <kim.phillips at freescale.com>
Signed-off-by: Tom Huynh <tom.huynh at freescale.com>
---
 arch/powerpc/perf/e6500-pmu.c | 13 +++++++++++++
 1 file changed, 13 insertions(+)

diff --git a/arch/powerpc/perf/e6500-pmu.c b/arch/powerpc/perf/e6500-pmu.c
index abaa6d7..4bbdbb0 100644
--- a/arch/powerpc/perf/e6500-pmu.c
+++ b/arch/powerpc/perf/e6500-pmu.c
@@ -133,7 +133,20 @@ static struct attribute_group e6500_pmu_events_group = {
 	.attrs = e6500_events_attr,
 };
 
+PMU_FORMAT_ATTR(event, "config:0-8");
+
+static struct attribute *e6500_pmu_format_attr[] = {
+	&format_attr_event.attr,
+	NULL,
+};
+
+struct attribute_group e6500_pmu_format_group = {
+	.name = "format",
+	.attrs = e6500_pmu_format_attr,
+};
+
 static const struct attribute_group *e6500_pmu_attr_groups[] = {
+	&e6500_pmu_format_group,
 	&e6500_pmu_events_group,
 	NULL,
 };
-- 
1.9.1



More information about the Linuxppc-dev mailing list