diff options
author | Michael Cree <mcree@orcon.net.nz> | 2010-08-09 20:20:05 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2010-08-09 23:45:03 -0400 |
commit | 65d920646a1c720c5ba95b7643ab1b46167d9e6a (patch) | |
tree | 262f77223f5368bdfdb461e658d8ddd6750f651f /arch/alpha/kernel | |
parent | 7624ee72aa09334af072853457a5d46d9901c3f8 (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/kernel')
-rw-r--r-- | arch/alpha/kernel/irq.c | 7 |
1 files changed, 5 insertions, 2 deletions
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 | ||
33 | volatile unsigned long irq_err_count; | 33 | volatile unsigned long irq_err_count; |
34 | DEFINE_PER_CPU(unsigned long, irq_pmi_count); | ||
34 | 35 | ||
35 | void ack_bad_irq(unsigned int irq) | 36 | void ack_bad_irq(unsigned int irq) |
36 | { | 37 | { |
@@ -63,9 +64,7 @@ int irq_select_affinity(unsigned int irq) | |||
63 | int | 64 | int |
64 | show_interrupts(struct seq_file *p, void *v) | 65 | show_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; |