Skip to contentSkip to conversation

ARC: perf: ARC 700 PMU doesn't support sampling events

PATCH In review Mischa Jonker 2 participants 2 messages Nov 13, 2013

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 ARC: perf: ARC 700 PMU doesn't support sampling events

The ARC 700 does not have an interrupt associated with it, and as such it cannot trigger when a counter overflows. As the counters are 48 bit, it will usually take at least 100 days before a counter overflows, so for mere counting of events, there is no problem. Sampling is not supported though.

Cc Peter Zijlstra <[email protected]>
Cc Vineet Gupta <[email protected]>
---
 arch/arc/kernel/perf_event.c |    4 ++++
 1 file changed, 4 insertions(+)
arch/arc/kernel/perf_event.c +4 -0
index 759e5f3..e46d81f 100644
@@ -99,6 +99,10 @@ static int arc_pmu_event_init(struct perf_event *event)
 	struct hw_perf_event *hwc = &event->hw;
 	int ret;
 
+	/* ARC 700 PMU does not support sampling events */
+	if (is_sampling_event(event))
+		return -ENOENT;
+
 	switch (event->attr.type) {
 	case PERF_TYPE_HARDWARE:
 		if (event->attr.config >= PERF_COUNT_HW_MAX)
Signature · 1 line
1.7.9.5
maintainer Acked-by on v1 1/1
#1 lore raw
Quoted 5 lines · Mischa Jonker

The ARC 700 does not have an interrupt associated with it, and as such it cannot trigger when a counter overflows. As the counters are 48 bit, it will usually take at least 100 days before a counter overflows, so for mere counting of events, there is no problem. Sampling is not supported though.

Quoted 24 lines
---
 arch/arc/kernel/perf_event.c |    4 ++++
 1 file changed, 4 insertions(+)
arch/arc/kernel/perf_event.c +4 -0
index 759e5f3..e46d81f 100644
@@ -99,6 +99,10 @@ static int arc_pmu_event_init(struct perf_event *event)
 	struct hw_perf_event *hwc = &event->hw;
 	int ret;
 
+	/* ARC 700 PMU does not support sampling events */
+	if (is_sampling_event(event))
+		return -ENOENT;
+
 	switch (event->attr.type) {
 	case PERF_TYPE_HARDWARE:
 		if (event->attr.config >= PERF_COUNT_HW_MAX)
Signature · 1 line
1.7.9.5