Skip to contentSkip to conversation

perf top: set perf_event_attr->pmu_id

RFC PATCH Superseded Lin Ming 2 participants 2 messages May 10, 2010 perf events

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore

Lin Ming

author
#0 lore raw

RFC PATCH 9/9 perf top: set perf_event_attr->pmu_id

This is just a temporary patch to show the setting of perf_event_attr->pmu_id.

---
 tools/perf/builtin-top.c |    5 +++++
 1 files changed, 5 insertions(+), 0 deletions(-)
tools/perf/builtin-top.c +5 -0
index ed9b5b6..f775393 100644
@@ -1213,6 +1213,11 @@ static void start_counter(int i, int counter)
 
 	attr = attrs + counter;
 
+	/*
+	 * TBD: in the future, may read /sys/devices/system/cpu/pmus/<pmu_id> 
+	 * to get the pmu id
+	 */
+	attr.pmu_id = 0;
 	attr->sample_type	= PERF_SAMPLE_IP | PERF_SAMPLE_TID;
 
 	if (freq) {
maintainer
#1 lore raw
Quoted 13 lines · Lin Ming

This is just a temporary patch to show the setting of perf_event_attr->pmu_id.

---
 tools/perf/builtin-top.c |    5 +++++
 1 files changed, 5 insertions(+), 0 deletions(-)
tools/perf/builtin-top.c +0 -0
index ed9b5b6..f775393 100644

tools/perf/builtin-top.c static void start_counter(int i, int counter) · line 1220

Quoted 8 lines
tools/perf/builtin-top.c +5 -0
@@ -1213,6 +1213,11 @@ static void start_counter(int i, int counter)
 
 	attr = attrs + counter;
 
+	/*
+	 * TBD: in the future, may read /sys/devices/system/cpu/pmus/<pmu_id> 
+	 * to get the pmu id
+	 */
+	attr.pmu_id = 0;

No, cpu PMUs must always be pmu_id 0.