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

sh: Count NMIs in irq_cpustat_t.

This plugs in support for NMI counting per-CPU via irq_cpustat_t.
Modelled after the x86 implementation.

Signed-off-by: Paul Mundt <lethal@linux-sh.org>

+20 -3
+10 -3
arch/sh/include/asm/hardirq.h
··· 1 1 #ifndef __ASM_SH_HARDIRQ_H 2 2 #define __ASM_SH_HARDIRQ_H 3 3 4 - extern void ack_bad_irq(unsigned int irq); 5 - #define ack_bad_irq ack_bad_irq 4 + #include <linux/threads.h> 5 + #include <linux/irq.h> 6 6 7 - #include <asm-generic/hardirq.h> 7 + typedef struct { 8 + unsigned int __softirq_pending; 9 + unsigned int __nmi_count; /* arch dependent */ 10 + } ____cacheline_aligned irq_cpustat_t; 11 + 12 + #include <linux/irq_cpustat.h> /* Standard mappings for irq_cpustat_t above */ 13 + 14 + extern void ack_bad_irq(unsigned int irq); 8 15 9 16 #endif /* __ASM_SH_HARDIRQ_H */
+8
arch/sh/kernel/irq.c
··· 36 36 */ 37 37 static int show_other_interrupts(struct seq_file *p, int prec) 38 38 { 39 + int j; 40 + 41 + seq_printf(p, "%*s: ", prec, "NMI"); 42 + for_each_online_cpu(j) 43 + seq_printf(p, "%10u ", irq_stat[j].__nmi_count); 44 + seq_printf(p, " Non-maskable interrupts\n"); 45 + 39 46 seq_printf(p, "%*s: %10u\n", prec, "ERR", atomic_read(&irq_err_count)); 47 + 40 48 return 0; 41 49 } 42 50
+2
arch/sh/kernel/traps.c
··· 95 95 96 96 BUILD_TRAP_HANDLER(nmi) 97 97 { 98 + unsigned int cpu = smp_processor_id(); 98 99 TRAP_HANDLER_DECL; 99 100 100 101 nmi_enter(); 102 + nmi_count(cpu)++; 101 103 102 104 switch (notify_die(DIE_NMI, "NMI", regs, 0, vec & 0xff, SIGINT)) { 103 105 case NOTIFY_OK: