Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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>

authored by

Michael Cree and committed by
Linus Torvalds
65d92064 7624ee72

+6 -2
+1
arch/alpha/include/asm/hw_irq.h
··· 3 3 4 4 5 5 extern volatile unsigned long irq_err_count; 6 + DECLARE_PER_CPU(unsigned long, irq_pmi_count); 6 7 7 8 #ifdef CONFIG_ALPHA_GENERIC 8 9 #define ACTUAL_NR_IRQS alpha_mv.nr_irqs
+5 -2
arch/alpha/kernel/irq.c
··· 31 31 #include <asm/uaccess.h> 32 32 33 33 volatile unsigned long irq_err_count; 34 + DEFINE_PER_CPU(unsigned long, irq_pmi_count); 34 35 35 36 void ack_bad_irq(unsigned int irq) 36 37 { ··· 64 63 int 65 64 show_interrupts(struct seq_file *p, void *v) 66 65 { 67 - #ifdef CONFIG_SMP 68 66 int j; 69 - #endif 70 67 int irq = *(loff_t *) v; 71 68 struct irqaction * action; 72 69 unsigned long flags; ··· 111 112 seq_printf(p, "%10lu ", cpu_data[j].ipi_count); 112 113 seq_putc(p, '\n'); 113 114 #endif 115 + seq_puts(p, "PMI: "); 116 + for_each_online_cpu(j) 117 + seq_printf(p, "%10lu ", per_cpu(irq_pmi_count, j)); 118 + seq_puts(p, " Performance Monitoring\n"); 114 119 seq_printf(p, "ERR: %10lu\n", irq_err_count); 115 120 } 116 121 return 0;