Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 181902
b: refs/heads/master
c: 89713ed
h: refs/heads/master
v: v3
  • Loading branch information
Anton Blanchard authored and Benjamin Herrenschmidt committed Feb 17, 2010
1 parent 8f1efd5 commit de13471
Show file tree
Hide file tree
Showing 5 changed files with 51 additions and 1 deletion.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: fc380c0c8a17bc2bd2d9d7fb41d4a88c3e618db2
refs/heads/master: 89713ed10815401a1bfe12e3a076b64048381b56
9 changes: 9 additions & 0 deletions trunk/arch/powerpc/include/asm/hardirq.h
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,9 @@

typedef struct {
unsigned int __softirq_pending;
unsigned int timer_irqs;
unsigned int pmu_irqs;
unsigned int mce_exceptions;
} ____cacheline_aligned irq_cpustat_t;

DECLARE_PER_CPU_SHARED_ALIGNED(irq_cpustat_t, irq_stat);
Expand All @@ -19,4 +22,10 @@ static inline void ack_bad_irq(unsigned int irq)
printk(KERN_CRIT "unexpected IRQ trap at vector %02x\n", irq);
}

extern u64 arch_irq_stat_cpu(unsigned int cpu);
#define arch_irq_stat_cpu arch_irq_stat_cpu

extern u64 arch_irq_stat(void);
#define arch_irq_stat arch_irq_stat

#endif /* _ASM_POWERPC_HARDIRQ_H */
35 changes: 35 additions & 0 deletions trunk/arch/powerpc/kernel/irq.c
Original file line number Diff line number Diff line change
Expand Up @@ -196,6 +196,21 @@ static int show_other_interrupts(struct seq_file *p, int prec)
}
#endif /* CONFIG_PPC32 && CONFIG_TAU_INT */

seq_printf(p, "%*s: ", prec, "LOC");
for_each_online_cpu(j)
seq_printf(p, "%10u ", per_cpu(irq_stat, j).timer_irqs);
seq_printf(p, " Local timer interrupts\n");

seq_printf(p, "%*s: ", prec, "CNT");
for_each_online_cpu(j)
seq_printf(p, "%10u ", per_cpu(irq_stat, j).pmu_irqs);
seq_printf(p, " Performance monitoring interrupts\n");

seq_printf(p, "%*s: ", prec, "MCE");
for_each_online_cpu(j)
seq_printf(p, "%10u ", per_cpu(irq_stat, j).mce_exceptions);
seq_printf(p, " Machine check exceptions\n");

seq_printf(p, "%*s: %10u\n", prec, "BAD", ppc_spurious_interrupts);

return 0;
Expand Down Expand Up @@ -258,6 +273,26 @@ int show_interrupts(struct seq_file *p, void *v)
return 0;
}

/*
* /proc/stat helpers
*/
u64 arch_irq_stat_cpu(unsigned int cpu)
{
u64 sum = per_cpu(irq_stat, cpu).timer_irqs;

sum += per_cpu(irq_stat, cpu).pmu_irqs;
sum += per_cpu(irq_stat, cpu).mce_exceptions;

return sum;
}

u64 arch_irq_stat(void)
{
u64 sum = ppc_spurious_interrupts;

return sum;
}

#ifdef CONFIG_HOTPLUG_CPU
void fixup_irqs(cpumask_t map)
{
Expand Down
2 changes: 2 additions & 0 deletions trunk/arch/powerpc/kernel/time.c
Original file line number Diff line number Diff line change
Expand Up @@ -575,6 +575,8 @@ void timer_interrupt(struct pt_regs * regs)

trace_timer_interrupt_entry(regs);

__get_cpu_var(irq_stat).timer_irqs++;

/* Ensure a positive value is written to the decrementer, or else
* some CPUs will continuue to take decrementer exceptions */
set_dec(DECREMENTER_MAX);
Expand Down
4 changes: 4 additions & 0 deletions trunk/arch/powerpc/kernel/traps.c
Original file line number Diff line number Diff line change
Expand Up @@ -483,6 +483,8 @@ void machine_check_exception(struct pt_regs *regs)
{
int recover = 0;

__get_cpu_var(irq_stat).mce_exceptions++;

/* See if any machine dependent calls. In theory, we would want
* to call the CPU first, and call the ppc_md. one if the CPU
* one returns a positive number. However there is existing code
Expand Down Expand Up @@ -965,6 +967,8 @@ void vsx_unavailable_exception(struct pt_regs *regs)

void performance_monitor_exception(struct pt_regs *regs)
{
__get_cpu_var(irq_stat).pmu_irqs++;

perf_irq(regs);
}

Expand Down

0 comments on commit de13471

Please sign in to comment.