Re: [PATCH] [6/28] x86: MCE: Add machine check exception count in/proc/interrupts

From: Hidetoshi Seto
Date: Wed Apr 08 2009 - 01:00:35 EST


Andi Kleen wrote:
> @@ -96,6 +97,12 @@
> seq_printf(p, " Threshold APIC interrupts\n");
> # 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
> seq_printf(p, "%*s: %10u\n", prec, "ERR", atomic_read(&irq_err_count));
> #if defined(CONFIG_X86_IO_APIC)
> seq_printf(p, "%*s: %10u\n", prec, "MIS", atomic_read(&irq_mis_count));

How about unifying ifdefs?
The patched code will be:

#ifdef CONFIG_X86_MCE
seq_printf(p, "%*s: ", prec, "TRM");
for_each_online_cpu(j)
seq_printf(p, "%10u ", irq_stats(j)->irq_thermal_count);
seq_printf(p, " Thermal event interrupts\n");
# ifdef CONFIG_X86_64
seq_printf(p, "%*s: ", prec, "THR");
for_each_online_cpu(j)
seq_printf(p, "%10u ", irq_stats(j)->irq_threshold_count);
seq_printf(p, " Threshold APIC interrupts\n");
# 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

> @@ -163,6 +170,9 @@
> {
> 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
> sum += irq_stats(cpu)->apic_timer_irqs;
> sum += irq_stats(cpu)->irq_spurious_count;

Ditto.


Thanks,
H.Seto
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/