]> git.karo-electronics.de Git - karo-tx-linux.git/commitdiff
x86, mce: add MCE poll count to /proc/interrupts
authorAndi Kleen <andi@firstfloor.org>
Wed, 27 May 2009 19:56:57 +0000 (21:56 +0200)
committerH. Peter Anvin <hpa@zytor.com>
Wed, 3 Jun 2009 21:40:38 +0000 (14:40 -0700)
Keep a count of the machine check polls (or CMCI events) in
/proc/interrupts.

Andi needs this for debugging, but it's also useful in general
to see what's going in by the kernel.

Signed-off-by: Andi Kleen <ak@linux.intel.com>
Signed-off-by: Hidetoshi Seto <seto.hidetoshi@jp.fujitsu.com>
Signed-off-by: H. Peter Anvin <hpa@zytor.com>
arch/x86/include/asm/mce.h
arch/x86/kernel/cpu/mcheck/mce.c
arch/x86/kernel/irq.c

index 1156dae295ac22c3f6023a402bae8f6eb1795e4b..63abf3b1943216a3aee268593bcfe9335815a8a4 100644 (file)
@@ -125,6 +125,7 @@ static inline void mce_amd_feature_init(struct cpuinfo_x86 *c) { }
 int mce_available(struct cpuinfo_x86 *c);
 
 DECLARE_PER_CPU(unsigned, mce_exception_count);
+DECLARE_PER_CPU(unsigned, mce_poll_count);
 
 void mce_log_therm_throt_event(__u64 status);
 
index 287268d2183620aceae7e55e594dbd0c6271d633..784f6ae9d6f4d8e294a9fa7d5607205cabca1e46 100644 (file)
@@ -264,6 +264,8 @@ static inline void mce_get_rip(struct mce *m, struct pt_regs *regs)
        }
 }
 
+DEFINE_PER_CPU(unsigned, mce_poll_count);
+
 /*
  * Poll for corrected events or events that happened before reset.
  * Those are just logged through /dev/mcelog.
@@ -275,6 +277,8 @@ void machine_check_poll(enum mcp_flags flags, mce_banks_t *b)
        struct mce m;
        int i;
 
+       __get_cpu_var(mce_poll_count)++;
+
        mce_setup(&m);
 
        m.mcgstatus = mce_rdmsrl(MSR_IA32_MCG_STATUS);
index 05fc635c28c02173517b0a0fae9ba8424dfa2a89..eff46b5de62fab99fa7e7827aecf9a1efaaeab4b 100644 (file)
@@ -100,6 +100,10 @@ static int show_other_interrupts(struct seq_file *p, int prec)
        for_each_online_cpu(j)
                seq_printf(p, "%10u ", per_cpu(mce_exception_count, j));
        seq_printf(p, "  Machine check exceptions\n");
+       seq_printf(p, "%*s: ", prec, "MCP");
+       for_each_online_cpu(j)
+               seq_printf(p, "%10u ", per_cpu(mce_poll_count, j));
+       seq_printf(p, "  Machine check polls\n");
 #endif
        seq_printf(p, "%*s: %10u\n", prec, "ERR", atomic_read(&irq_err_count));
 #if defined(CONFIG_X86_IO_APIC)