diff options
author | Ian Munsie <imunsie@au1.ibm.com> | 2013-03-21 15:22:52 -0400 |
---|---|---|
committer | Michael Ellerman <michael@ellerman.id.au> | 2013-04-18 01:59:55 -0400 |
commit | a6a058e52a0ce62de84496c9d4b133f2afc61f27 (patch) | |
tree | a140df07d650136779b3a8b1772a13ad6d3f26ed | |
parent | 61435690a9c781b4c9e617aa86bd20c146c9a998 (diff) |
powerpc: Add accounting for Doorbell interrupts
This patch adds a new line to /proc/interrupts to account for the
doorbell interrupts that each hardware thread has received. The total
interrupt count in /proc/stat will now also include doorbells.
# cat /proc/interrupts
CPU0 CPU1 CPU2 CPU3
16: 551 1267 281 175 XICS Level IPI
LOC: 2037 1503 1688 1625 Local timer interrupts
SPU: 0 0 0 0 Spurious interrupts
CNT: 0 0 0 0 Performance monitoring interrupts
MCE: 0 0 0 0 Machine check exceptions
DBL: 42 550 20 91 Doorbell interrupts
Signed-off-by: Ian Munsie <imunsie@au1.ibm.com>
Signed-off-by: Michael Ellerman <michael@ellerman.id.au>
-rw-r--r-- | arch/powerpc/include/asm/hardirq.h | 3 | ||||
-rw-r--r-- | arch/powerpc/kernel/dbell.c | 2 | ||||
-rw-r--r-- | arch/powerpc/kernel/irq.c | 12 |
3 files changed, 17 insertions, 0 deletions
diff --git a/arch/powerpc/include/asm/hardirq.h b/arch/powerpc/include/asm/hardirq.h index 3147a2970125..3bdcfce2c42a 100644 --- a/arch/powerpc/include/asm/hardirq.h +++ b/arch/powerpc/include/asm/hardirq.h | |||
@@ -10,6 +10,9 @@ typedef struct { | |||
10 | unsigned int pmu_irqs; | 10 | unsigned int pmu_irqs; |
11 | unsigned int mce_exceptions; | 11 | unsigned int mce_exceptions; |
12 | unsigned int spurious_irqs; | 12 | unsigned int spurious_irqs; |
13 | #ifdef CONFIG_PPC_DOORBELL | ||
14 | unsigned int doorbell_irqs; | ||
15 | #endif | ||
13 | } ____cacheline_aligned irq_cpustat_t; | 16 | } ____cacheline_aligned irq_cpustat_t; |
14 | 17 | ||
15 | DECLARE_PER_CPU_SHARED_ALIGNED(irq_cpustat_t, irq_stat); | 18 | DECLARE_PER_CPU_SHARED_ALIGNED(irq_cpustat_t, irq_stat); |
diff --git a/arch/powerpc/kernel/dbell.c b/arch/powerpc/kernel/dbell.c index 9ebbc24bb23c..d55c76c571f3 100644 --- a/arch/powerpc/kernel/dbell.c +++ b/arch/powerpc/kernel/dbell.c | |||
@@ -41,6 +41,8 @@ void doorbell_exception(struct pt_regs *regs) | |||
41 | 41 | ||
42 | may_hard_irq_enable(); | 42 | may_hard_irq_enable(); |
43 | 43 | ||
44 | __get_cpu_var(irq_stat).doorbell_irqs++; | ||
45 | |||
44 | smp_ipi_demux(); | 46 | smp_ipi_demux(); |
45 | 47 | ||
46 | irq_exit(); | 48 | irq_exit(); |
diff --git a/arch/powerpc/kernel/irq.c b/arch/powerpc/kernel/irq.c index 4f97fe345526..5cbcf4d5a808 100644 --- a/arch/powerpc/kernel/irq.c +++ b/arch/powerpc/kernel/irq.c | |||
@@ -374,6 +374,15 @@ int arch_show_interrupts(struct seq_file *p, int prec) | |||
374 | seq_printf(p, "%10u ", per_cpu(irq_stat, j).mce_exceptions); | 374 | seq_printf(p, "%10u ", per_cpu(irq_stat, j).mce_exceptions); |
375 | seq_printf(p, " Machine check exceptions\n"); | 375 | seq_printf(p, " Machine check exceptions\n"); |
376 | 376 | ||
377 | #ifdef CONFIG_PPC_DOORBELL | ||
378 | if (cpu_has_feature(CPU_FTR_DBELL)) { | ||
379 | seq_printf(p, "%*s: ", prec, "DBL"); | ||
380 | for_each_online_cpu(j) | ||
381 | seq_printf(p, "%10u ", per_cpu(irq_stat, j).doorbell_irqs); | ||
382 | seq_printf(p, " Doorbell interrupts\n"); | ||
383 | } | ||
384 | #endif | ||
385 | |||
377 | return 0; | 386 | return 0; |
378 | } | 387 | } |
379 | 388 | ||
@@ -387,6 +396,9 @@ u64 arch_irq_stat_cpu(unsigned int cpu) | |||
387 | sum += per_cpu(irq_stat, cpu).pmu_irqs; | 396 | sum += per_cpu(irq_stat, cpu).pmu_irqs; |
388 | sum += per_cpu(irq_stat, cpu).mce_exceptions; | 397 | sum += per_cpu(irq_stat, cpu).mce_exceptions; |
389 | sum += per_cpu(irq_stat, cpu).spurious_irqs; | 398 | sum += per_cpu(irq_stat, cpu).spurious_irqs; |
399 | #ifdef CONFIG_PPC_DOORBELL | ||
400 | sum += per_cpu(irq_stat, cpu).doorbell_irqs; | ||
401 | #endif | ||
390 | 402 | ||
391 | return sum; | 403 | return sum; |
392 | } | 404 | } |