ARC: perf: ARC 700 PMU doesn't support sampling events
authorMischa Jonker <mjonker@synopsys.com>
Wed, 13 Nov 2013 15:06:06 +0000 (16:06 +0100)
committerVineet Gupta <vgupta@synopsys.com>
Fri, 15 Nov 2013 05:22:28 +0000 (10:52 +0530)
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.

Signed-off-by: Mischa Jonker <mjonker@synopsys.com>
Acked-by: Peter Zijlstra <peterz@infradead.org>
Signed-off-by: Vineet Gupta <vgupta@synopsys.com>
arch/arc/kernel/perf_event.c

index 759e5f3e9029406a5544039a2db68a98fedd3879..e46d81f709797a868b7cc68cc81ef71277a0f070 100644 (file)
@@ -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)