x86, mce: add machine check exception count in /proc/interrupts
Useful for debugging, but it's also good general policy to have a counter for all special interrupts there. This makes it easier to diagnose where a CPU is spending its time. [ Impact: feature, debugging tool ] 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>
This commit is contained in:
parent
48b1fddbb1
commit
01ca79f141
3 changed files with 17 additions and 0 deletions
|
@ -89,6 +89,7 @@ struct mce_log {
|
||||||
extern int mce_disabled;
|
extern int mce_disabled;
|
||||||
|
|
||||||
#include <asm/atomic.h>
|
#include <asm/atomic.h>
|
||||||
|
#include <linux/percpu.h>
|
||||||
|
|
||||||
void mce_setup(struct mce *m);
|
void mce_setup(struct mce *m);
|
||||||
void mce_log(struct mce *m);
|
void mce_log(struct mce *m);
|
||||||
|
@ -123,6 +124,8 @@ static inline void mce_amd_feature_init(struct cpuinfo_x86 *c) { }
|
||||||
|
|
||||||
int mce_available(struct cpuinfo_x86 *c);
|
int mce_available(struct cpuinfo_x86 *c);
|
||||||
|
|
||||||
|
DECLARE_PER_CPU(unsigned, mce_exception_count);
|
||||||
|
|
||||||
void mce_log_therm_throt_event(__u64 status);
|
void mce_log_therm_throt_event(__u64 status);
|
||||||
|
|
||||||
extern atomic_t mce_entry;
|
extern atomic_t mce_entry;
|
||||||
|
|
|
@ -57,6 +57,8 @@ int mce_disabled;
|
||||||
|
|
||||||
atomic_t mce_entry;
|
atomic_t mce_entry;
|
||||||
|
|
||||||
|
DEFINE_PER_CPU(unsigned, mce_exception_count);
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Tolerant levels:
|
* Tolerant levels:
|
||||||
* 0: always panic on uncorrected errors, log corrected errors
|
* 0: always panic on uncorrected errors, log corrected errors
|
||||||
|
@ -359,6 +361,8 @@ void do_machine_check(struct pt_regs *regs, long error_code)
|
||||||
|
|
||||||
atomic_inc(&mce_entry);
|
atomic_inc(&mce_entry);
|
||||||
|
|
||||||
|
__get_cpu_var(mce_exception_count)++;
|
||||||
|
|
||||||
if (notify_die(DIE_NMI, "machine check", regs, error_code,
|
if (notify_die(DIE_NMI, "machine check", regs, error_code,
|
||||||
18, SIGKILL) == NOTIFY_STOP)
|
18, SIGKILL) == NOTIFY_STOP)
|
||||||
goto out;
|
goto out;
|
||||||
|
|
|
@ -12,6 +12,7 @@
|
||||||
#include <asm/io_apic.h>
|
#include <asm/io_apic.h>
|
||||||
#include <asm/irq.h>
|
#include <asm/irq.h>
|
||||||
#include <asm/idle.h>
|
#include <asm/idle.h>
|
||||||
|
#include <asm/mce.h>
|
||||||
|
|
||||||
atomic_t irq_err_count;
|
atomic_t irq_err_count;
|
||||||
|
|
||||||
|
@ -93,6 +94,12 @@ static int show_other_interrupts(struct seq_file *p, int prec)
|
||||||
seq_printf(p, "%10u ", irq_stats(j)->irq_threshold_count);
|
seq_printf(p, "%10u ", irq_stats(j)->irq_threshold_count);
|
||||||
seq_printf(p, " Threshold APIC interrupts\n");
|
seq_printf(p, " Threshold APIC interrupts\n");
|
||||||
# endif
|
# endif
|
||||||
|
#endif
|
||||||
|
#if defined(CONFIG_X86_MCE) && defined(CONFIG_X86_64)
|
||||||
|
seq_printf(p, "%*s: ", prec, "MCE");
|
||||||
|
for_each_online_cpu(j)
|
||||||
|
seq_printf(p, "%10u ", per_cpu(mce_exception_count, j));
|
||||||
|
seq_printf(p, " Machine check exceptions\n");
|
||||||
#endif
|
#endif
|
||||||
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));
|
||||||
#if defined(CONFIG_X86_IO_APIC)
|
#if defined(CONFIG_X86_IO_APIC)
|
||||||
|
@ -161,6 +168,9 @@ u64 arch_irq_stat_cpu(unsigned int cpu)
|
||||||
{
|
{
|
||||||
u64 sum = irq_stats(cpu)->__nmi_count;
|
u64 sum = irq_stats(cpu)->__nmi_count;
|
||||||
|
|
||||||
|
#if defined(CONFIG_X86_MCE) && defined(CONFIG_X86_64)
|
||||||
|
sum += per_cpu(mce_exception_count, cpu);
|
||||||
|
#endif
|
||||||
#ifdef CONFIG_X86_LOCAL_APIC
|
#ifdef CONFIG_X86_LOCAL_APIC
|
||||||
sum += irq_stats(cpu)->apic_timer_irqs;
|
sum += irq_stats(cpu)->apic_timer_irqs;
|
||||||
sum += irq_stats(cpu)->irq_spurious_count;
|
sum += irq_stats(cpu)->irq_spurious_count;
|
||||||
|
|
Loading…
Add table
Reference in a new issue