public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [patch/rfc] perf on raspberry-pi without overflow interrupt
@ 2014-01-08 21:28 Vince Weaver
  2014-01-08 22:23 ` Stephane Eranian
  2014-01-08 22:53 ` Peter Zijlstra
  0 siblings, 2 replies; 23+ messages in thread
From: Vince Weaver @ 2014-01-08 21:28 UTC (permalink / raw)
  To: linux-kernel
  Cc: Will Deacon, Peter Zijlstra, Paul Mackerras, Ingo Molnar,
	Arnaldo Carvalho de Melo, Stephane Eranian


I'm working on getting the hardware performance counters working on a 
Raspberry-Pi (BCM2835/ARM1176).  

The counters are there, but the overflow interrupt is not hooked up so the 
init code disables perf_event.

The following patch enables perf_event and it works fine for simple 
"perf stat" type workloads.  perf record and anything requiring sampling 
doesn't work (as expected).

I thought I would have to add a periodic timer to catch counter overflows, 
but it turns out that's unnecessary.  From what I can tell even though the
nPMUIRQ interrupt is not hooked up, the overflows are marked in the status 
register and this is noticed and handled at context-switch time.  So as 
long as the counters overflow less frequently than the context switch 
interval the registers don't overflow.

So my question, is a patch like this acceptable?

Should the perf_event interface handle setups like this better and work 
fine in aggregate mode but return ENOTSUP if a sampled or overflow event 
is attempted?

Vince


Signed-off-by: Vince Weaver <vincent.weaver@maine.edu>

diff --git a/arch/arm/kernel/perf_event_cpu.c b/arch/arm/kernel/perf_event_cpu.c
index d85055c..ff1a752 100644
--- a/arch/arm/kernel/perf_event_cpu.c
+++ b/arch/arm/kernel/perf_event_cpu.c
@@ -97,8 +97,8 @@ static int cpu_pmu_request_irq(struct arm_pmu *cpu_pmu, irq_handler_t handler)
 
 	irqs = min(pmu_device->num_resources, num_possible_cpus());
 	if (irqs < 1) {
-		pr_err("no irqs for PMUs defined\n");
-		return -ENODEV;
+		printk_once("no irqs for PMUs defined, enabling anyway\n");
+		return 0;
 	}
 
 	for (i = 0; i < irqs; ++i) {

^ permalink raw reply related	[flat|nested] 23+ messages in thread

end of thread, other threads:[~2014-05-07 21:25 UTC | newest]

Thread overview: 23+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-01-08 21:28 [patch/rfc] perf on raspberry-pi without overflow interrupt Vince Weaver
2014-01-08 22:23 ` Stephane Eranian
2014-01-08 22:53 ` Peter Zijlstra
2014-01-09  3:47   ` Vince Weaver
2014-01-09 10:19     ` Will Deacon
2014-01-10  4:08       ` Vince Weaver
2014-01-10  9:40         ` Peter Zijlstra
2014-01-14  4:55           ` Vince Weaver
2014-01-14 10:57             ` Peter Zijlstra
2014-01-16 17:13               ` Vince Weaver
2014-01-16 17:31                 ` Peter Zijlstra
2014-01-17  5:45                   ` Vince Weaver
2014-02-24 10:46                     ` Will Deacon
2014-02-24 15:37                       ` Vince Weaver
2014-05-07 17:29                         ` Will Deacon
2014-05-07 21:21                           ` Vince Weaver
2014-05-07 21:23                             ` Will Deacon
2014-01-10 10:08         ` Will Deacon
2014-01-10 10:43           ` Stephane Eranian
2014-01-10 13:54             ` Vince Weaver
2014-01-14  4:42           ` Vince Weaver
2014-01-15 18:38             ` Will Deacon
2014-01-16 16:13               ` Vince Weaver

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox