@@ -123,6 +123,8 @@ struct arm_pmu {
extern const struct dev_pm_ops armpmu_dev_pm_ops;
+irqreturn_t armpmu_dispatch_irq(int irq, void *dev);
+
int armpmu_register(struct arm_pmu *armpmu, int type);
u64 armpmu_event_update(struct perf_event *event);
@@ -296,7 +296,7 @@ validate_group(struct perf_event *event)
return 0;
}
-static irqreturn_t armpmu_dispatch_irq(int irq, void *dev)
+irqreturn_t armpmu_dispatch_irq(int irq, void *dev)
{
struct arm_pmu *armpmu;
struct platform_device *plat_device;
@@ -177,9 +177,17 @@ static int cpu_pmu_request_irq(struct arm_pmu *cpu_pmu, irq_handler_t handler)
continue;
}
- err = request_irq(irq, handler,
- IRQF_NOBALANCING | IRQF_NO_THREAD, "arm-pmu",
- per_cpu_ptr(&hw_events->percpu_pmu, i));
+ err = request_irq(
+ irq, handler,
+ IRQF_NOBALANCING | IRQF_NMI,
+ "arm-pmu", per_cpu_ptr(&hw_events->percpu_pmu, i));
+ if (err) {
+ err = request_irq(
+ irq, handler,
+ IRQF_NOBALANCING | IRQF_NO_THREAD,
+ "arm-pmu",
+ per_cpu_ptr(&hw_events->percpu_pmu, i));
+ }
if (err) {
pr_err("unable to request IRQ%d for ARM PMU counters\n",
irq);
@@ -39,6 +39,7 @@
#include <asm/tls.h>
#include <asm/system_misc.h>
#include <asm/opcodes.h>
+#include <asm/pmu.h>
static const char *handler[]= {
@@ -466,6 +467,9 @@ die_sig:
int arch_filter_nmi_handler(irq_handler_t handler)
{
irq_handler_t whitelist[] = {
+#ifdef CONFIG_HW_PERF_EVENTS
+ armpmu_dispatch_irq,
+#endif
};
int i;
Using FIQ (if it is available) gives perf a better insight into the system by allowing code run with interrupts disabled to be profiled. Signed-off-by: Daniel Thompson <daniel.thompson@linaro.org> --- arch/arm/include/asm/pmu.h | 2 ++ arch/arm/kernel/perf_event.c | 2 +- arch/arm/kernel/perf_event_cpu.c | 14 +++++++++++--- arch/arm/kernel/traps.c | 4 ++++ 4 files changed, 18 insertions(+), 4 deletions(-)