Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit ca84f696 authored by Andi Kleen's avatar Andi Kleen Committed by H. Peter Anvin
Browse files

x86, mce: add MCE poll count to /proc/interrupts



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: default avatarAndi Kleen <ak@linux.intel.com>
Signed-off-by: default avatarHidetoshi Seto <seto.hidetoshi@jp.fujitsu.com>
Signed-off-by: default avatarH. Peter Anvin <hpa@zytor.com>
parent 01ca79f1
Loading
Loading
Loading
Loading
+1 −0
Original line number Original line Diff line number Diff line
@@ -125,6 +125,7 @@ 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);
DECLARE_PER_CPU(unsigned, mce_exception_count);
DECLARE_PER_CPU(unsigned, mce_poll_count);


void mce_log_therm_throt_event(__u64 status);
void mce_log_therm_throt_event(__u64 status);


+4 −0
Original line number Original line Diff line number Diff line
@@ -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.
 * Poll for corrected events or events that happened before reset.
 * Those are just logged through /dev/mcelog.
 * 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;
	struct mce m;
	int i;
	int i;


	__get_cpu_var(mce_poll_count)++;

	mce_setup(&m);
	mce_setup(&m);


	m.mcgstatus = mce_rdmsrl(MSR_IA32_MCG_STATUS);
	m.mcgstatus = mce_rdmsrl(MSR_IA32_MCG_STATUS);
+4 −0
Original line number Original line Diff line number Diff line
@@ -100,6 +100,10 @@ static int show_other_interrupts(struct seq_file *p, int prec)
	for_each_online_cpu(j)
	for_each_online_cpu(j)
		seq_printf(p, "%10u ", per_cpu(mce_exception_count, j));
		seq_printf(p, "%10u ", per_cpu(mce_exception_count, j));
	seq_printf(p, "  Machine check exceptions\n");
	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
#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)