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>
This commit is contained in:
@@ -1,9 +1,16 @@
|
|||||||
#ifndef __ASM_SH_HARDIRQ_H
|
#ifndef __ASM_SH_HARDIRQ_H
|
||||||
#define __ASM_SH_HARDIRQ_H
|
#define __ASM_SH_HARDIRQ_H
|
||||||
|
|
||||||
extern void ack_bad_irq(unsigned int irq);
|
#include <linux/threads.h>
|
||||||
#define ack_bad_irq ack_bad_irq
|
#include <linux/irq.h>
|
||||||
|
|
||||||
#include <asm-generic/hardirq.h>
|
typedef struct {
|
||||||
|
unsigned int __softirq_pending;
|
||||||
|
unsigned int __nmi_count; /* arch dependent */
|
||||||
|
} ____cacheline_aligned irq_cpustat_t;
|
||||||
|
|
||||||
|
#include <linux/irq_cpustat.h> /* Standard mappings for irq_cpustat_t above */
|
||||||
|
|
||||||
|
extern void ack_bad_irq(unsigned int irq);
|
||||||
|
|
||||||
#endif /* __ASM_SH_HARDIRQ_H */
|
#endif /* __ASM_SH_HARDIRQ_H */
|
||||||
|
@@ -36,7 +36,15 @@ void ack_bad_irq(unsigned int irq)
|
|||||||
*/
|
*/
|
||||||
static int show_other_interrupts(struct seq_file *p, int prec)
|
static int show_other_interrupts(struct seq_file *p, int prec)
|
||||||
{
|
{
|
||||||
|
int j;
|
||||||
|
|
||||||
|
seq_printf(p, "%*s: ", prec, "NMI");
|
||||||
|
for_each_online_cpu(j)
|
||||||
|
seq_printf(p, "%10u ", irq_stat[j].__nmi_count);
|
||||||
|
seq_printf(p, " Non-maskable interrupts\n");
|
||||||
|
|
||||||
seq_printf(p, "%*s: %10u\n", prec, "ERR", atomic_read(&irq_err_count));
|
seq_printf(p, "%*s: %10u\n", prec, "ERR", atomic_read(&irq_err_count));
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -95,9 +95,11 @@ BUILD_TRAP_HANDLER(bug)
|
|||||||
|
|
||||||
BUILD_TRAP_HANDLER(nmi)
|
BUILD_TRAP_HANDLER(nmi)
|
||||||
{
|
{
|
||||||
|
unsigned int cpu = smp_processor_id();
|
||||||
TRAP_HANDLER_DECL;
|
TRAP_HANDLER_DECL;
|
||||||
|
|
||||||
nmi_enter();
|
nmi_enter();
|
||||||
|
nmi_count(cpu)++;
|
||||||
|
|
||||||
switch (notify_die(DIE_NMI, "NMI", regs, 0, vec & 0xff, SIGINT)) {
|
switch (notify_die(DIE_NMI, "NMI", regs, 0, vec & 0xff, SIGINT)) {
|
||||||
case NOTIFY_OK:
|
case NOTIFY_OK:
|
||||||
|
Reference in New Issue
Block a user