Skip to content

Commit

Permalink
alpha: add performance monitor interrupt counter
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Michael Cree authored and Linus Torvalds committed Aug 10, 2010
1 parent 7624ee7 commit 65d9206
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
1 change: 1 addition & 0 deletions arch/alpha/include/asm/hw_irq.h
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@


extern volatile unsigned long irq_err_count;
DECLARE_PER_CPU(unsigned long, irq_pmi_count);

#ifdef CONFIG_ALPHA_GENERIC
#define ACTUAL_NR_IRQS alpha_mv.nr_irqs
Expand Down
7 changes: 5 additions & 2 deletions arch/alpha/kernel/irq.c
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@
#include <asm/uaccess.h>

volatile unsigned long irq_err_count;
DEFINE_PER_CPU(unsigned long, irq_pmi_count);

void ack_bad_irq(unsigned int irq)
{
Expand Down Expand Up @@ -63,9 +64,7 @@ int irq_select_affinity(unsigned int irq)
int
show_interrupts(struct seq_file *p, void *v)
{
#ifdef CONFIG_SMP
int j;
#endif
int irq = *(loff_t *) v;
struct irqaction * action;
unsigned long flags;
Expand Down Expand Up @@ -112,6 +111,10 @@ show_interrupts(struct seq_file *p, void *v)
seq_printf(p, "%10lu ", cpu_data[j].ipi_count);
seq_putc(p, '\n');
#endif
seq_puts(p, "PMI: ");
for_each_online_cpu(j)
seq_printf(p, "%10lu ", per_cpu(irq_pmi_count, j));
seq_puts(p, " Performance Monitoring\n");
seq_printf(p, "ERR: %10lu\n", irq_err_count);
}
return 0;
Expand Down

0 comments on commit 65d9206

Please sign in to comment.