aboutsummaryrefslogtreecommitdiffstats
path: root/arch/alpha
diff options
context:
space:
mode:
authorMichael Cree <mcree@orcon.net.nz>2010-08-09 20:20:05 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2010-08-09 23:45:03 -0400
commit65d920646a1c720c5ba95b7643ab1b46167d9e6a (patch)
tree262f77223f5368bdfdb461e658d8ddd6750f651f /arch/alpha
parent7624ee72aa09334af072853457a5d46d9901c3f8 (diff)
alpha: add performance monitor interrupt counter
The following patches implement hardware performance events for the Alpha EV67 and later CPUs. I have had this running on a Compaq XP1000 (EV67, single CPU) for a few days now. Pretty cool -- discovered that the glibc exp2() library routine uses on average 985 cycles to execute 777 CPU instructions whereas Compaq's CPML library version of exp2() uses on average 32 cycles to execute 47 CPU instructions to achieve the same thing! This patch: Add performance monitor interrupt counternd and export the count to user space via /proc/interrupts. Signed-off-by: Michael Cree <mcree@orcon.net.nz> Cc: Richard Henderson <rth@twiddle.net> Cc: Ivan Kokshaysky <ink@jurassic.park.msu.ru> Cc: Matt Turner <mattst88@gmail.com> Cc: Thomas Gleixner <tglx@linutronix.de> Cc: Peter Zijlstra <peterz@infradead.org> Cc: Ingo Molnar <mingo@elte.hu> Cc: Jay Estabrook <jay.estabrook@hp.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'arch/alpha')
-rw-r--r--arch/alpha/include/asm/hw_irq.h1
-rw-r--r--arch/alpha/kernel/irq.c7
2 files changed, 6 insertions, 2 deletions
diff --git a/arch/alpha/include/asm/hw_irq.h b/arch/alpha/include/asm/hw_irq.h
index a37db0f95092..5050ac81cd90 100644
--- a/arch/alpha/include/asm/hw_irq.h
+++ b/arch/alpha/include/asm/hw_irq.h
@@ -3,6 +3,7 @@
3 3
4 4
5extern volatile unsigned long irq_err_count; 5extern volatile unsigned long irq_err_count;
6DECLARE_PER_CPU(unsigned long, irq_pmi_count);
6 7
7#ifdef CONFIG_ALPHA_GENERIC 8#ifdef CONFIG_ALPHA_GENERIC
8#define ACTUAL_NR_IRQS alpha_mv.nr_irqs 9#define ACTUAL_NR_IRQS alpha_mv.nr_irqs
diff --git a/arch/alpha/kernel/irq.c b/arch/alpha/kernel/irq.c
index 7f912ba3d9ad..fe912984d9b1 100644
--- a/arch/alpha/kernel/irq.c
+++ b/arch/alpha/kernel/irq.c
@@ -31,6 +31,7 @@
31#include <asm/uaccess.h> 31#include <asm/uaccess.h>
32 32
33volatile unsigned long irq_err_count; 33volatile unsigned long irq_err_count;
34DEFINE_PER_CPU(unsigned long, irq_pmi_count);
34 35
35void ack_bad_irq(unsigned int irq) 36void ack_bad_irq(unsigned int irq)
36{ 37{
@@ -63,9 +64,7 @@ int irq_select_affinity(unsigned int irq)
63int 64int
64show_interrupts(struct seq_file *p, void *v) 65show_interrupts(struct seq_file *p, void *v)
65{ 66{
66#ifdef CONFIG_SMP
67 int j; 67 int j;
68#endif
69 int irq = *(loff_t *) v; 68 int irq = *(loff_t *) v;
70 struct irqaction * action; 69 struct irqaction * action;
71 unsigned long flags; 70 unsigned long flags;
@@ -112,6 +111,10 @@ unlock:
112 seq_printf(p, "%10lu ", cpu_data[j].ipi_count); 111 seq_printf(p, "%10lu ", cpu_data[j].ipi_count);
113 seq_putc(p, '\n'); 112 seq_putc(p, '\n');
114#endif 113#endif
114 seq_puts(p, "PMI: ");
115 for_each_online_cpu(j)
116 seq_printf(p, "%10lu ", per_cpu(irq_pmi_count, j));
117 seq_puts(p, " Performance Monitoring\n");
115 seq_printf(p, "ERR: %10lu\n", irq_err_count); 118 seq_printf(p, "ERR: %10lu\n", irq_err_count);
116 } 119 }
117 return 0; 120 return 0;