drivers: irqchip: gic: add IPI trace events
Alex Van Brunt [Wed, 7 May 2014 16:28:41 +0000 (09:28 -0700)]
Add enter and exit trace events for IPI. This makes it possible to
account for hte time in IPI handlers using trace logs.

Change-Id: Ied5d840beca6dfe9ad65ed21ebf77333fbd17e00
Signed-off-by: Alex Van Brunt <avanbrunt@nvidia.com>
Reviewed-on: http://git-master/r/407688
GVS: Gerrit_Virtual_Submit

drivers/irqchip/irq-gic.c
include/trace/events/irq.h

index c1e4bcd..65ab1b4 100644 (file)
@@ -42,6 +42,7 @@
 #include <linux/ftrace.h>
 #include <linux/irqchip/chained_irq.h>
 #include <linux/irqchip/arm-gic.h>
+#include <trace/events/irq.h>
 
 #include <asm/irq.h>
 #include <asm/exception.h>
@@ -310,7 +311,9 @@ static asmlinkage void __exception_irq_entry gic_handle_irq(struct pt_regs *regs
                if (irqnr < 16) {
                        writel_relaxed(irqstat, cpu_base + GIC_CPU_EOI);
 #ifdef CONFIG_SMP
+                       trace_ipi_enter(irqnr);
                        handle_IPI(irqnr, regs);
+                       trace_ipi_exit(irqnr);
 #endif
                        continue;
                }
index 1c09820..89e2ca9 100644 (file)
@@ -144,6 +144,40 @@ DEFINE_EVENT(softirq, softirq_raise,
        TP_ARGS(vec_nr)
 );
 
+TRACE_EVENT(ipi_enter,
+
+       TP_PROTO(u32 irq),
+
+       TP_ARGS(irq),
+
+       TP_STRUCT__entry(
+               __field( u32, irq)
+       ),
+
+       TP_fast_assign(
+               __entry->irq = irq;
+       ),
+
+       TP_printk("ipinr=%d", __entry->irq)
+);
+
+TRACE_EVENT(ipi_exit,
+
+       TP_PROTO(u32 irq),
+
+       TP_ARGS(irq),
+
+       TP_STRUCT__entry(
+               __field( u32, irq)
+       ),
+
+       TP_fast_assign(
+               __entry->irq = irq;
+       ),
+
+       TP_printk("ipinr=%d", __entry->irq)
+);
+
 #endif /*  _TRACE_IRQ_H */
 
 /* This part must be outside protection */