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

Commit 052ff461 authored by Heiko Carstens's avatar Heiko Carstens Committed by Martin Schwidefsky
Browse files

[S390] irq: have detailed statistics for interrupt types



Up to now /proc/interrupts only has statistics for external and i/o
interrupts but doesn't split up them any further.
This patch adds a line for every single interrupt source so that it
is possible to easier tell what the machine is/was doing.
Part of the output now looks like this;

           CPU0       CPU2       CPU4
EXT:       3898       4232       2305
I/O:        782        315        245
CLK:       1029       1964        727   [EXT] Clock Comparator
IPI:       2868       2267       1577   [EXT] Signal Processor
TMR:          0          0          0   [EXT] CPU Timer
TAL:          0          0          0   [EXT] Timing Alert
PFL:          0          0          0   [EXT] Pseudo Page Fault
[...]
NMI:          0          1          1   [NMI] Machine Checks

Signed-off-by: default avatarHeiko Carstens <heiko.carstens@de.ibm.com>
Signed-off-by: default avatarMartin Schwidefsky <schwidefsky@de.ibm.com>
parent 545b288d
Loading
Loading
Loading
Loading
+11 −12
Original line number Diff line number Diff line
#ifndef _ASM_IRQ_H
#define _ASM_IRQ_H

#ifdef __KERNEL__
#include <linux/hardirq.h>

/*
 * the definition of irqs has changed in 2.5.46:
 * NR_IRQS is no longer the number of i/o
 * interrupts (65536), but rather the number
 * of interrupt classes (2).
 * Only external and i/o interrupts make much sense here (CH).
 */

enum interruption_class {
	EXTERNAL_INTERRUPT,
	IO_INTERRUPT,

	EXTINT_CLK,
	EXTINT_IPI,
	EXTINT_TMR,
	EXTINT_TLA,
	EXTINT_PFL,
	EXTINT_DSD,
	EXTINT_VRT,
	EXTINT_SCP,
	EXTINT_IUC,
	NMI_NMI,
	NR_IRQS,
};

#endif /* __KERNEL__ */
#endif
#endif /* _ASM_IRQ_H */
+24 −6
Original line number Diff line number Diff line
/*
 *  arch/s390/kernel/irq.c
 *
 *    Copyright IBM Corp. 2004,2007
 *    Copyright IBM Corp. 2004,2010
 *    Author(s): Martin Schwidefsky (schwidefsky@de.ibm.com),
 *		 Thomas Spatzier (tspat@de.ibm.com)
 *
@@ -17,12 +15,31 @@
#include <linux/proc_fs.h>
#include <linux/profile.h>

struct irq_class {
	char *name;
	char *desc;
};

static const struct irq_class intrclass_names[] = {
	{.name = "EXT" },
	{.name = "I/O" },
	{.name = "CLK", .desc = "[EXT] Clock Comparator" },
	{.name = "IPI", .desc = "[EXT] Signal Processor" },
	{.name = "TMR", .desc = "[EXT] CPU Timer" },
	{.name = "TAL", .desc = "[EXT] Timing Alert" },
	{.name = "PFL", .desc = "[EXT] Pseudo Page Fault" },
	{.name = "DSD", .desc = "[EXT] DASD Diag" },
	{.name = "VRT", .desc = "[EXT] Virtio" },
	{.name = "SCP", .desc = "[EXT] Service Call" },
	{.name = "IUC", .desc = "[EXT] IUCV" },
	{.name = "NMI", .desc = "[NMI] Machine Check" },
};

/*
 * show_interrupts is needed by /proc/interrupts.
 */
int show_interrupts(struct seq_file *p, void *v)
{
	static const char *intrclass_names[] = { "EXT", "I/O", };
	int i = *(loff_t *) v, j;

	get_online_cpus();
@@ -34,15 +51,16 @@ int show_interrupts(struct seq_file *p, void *v)
	}

	if (i < NR_IRQS) {
		seq_printf(p, "%s: ", intrclass_names[i]);
		seq_printf(p, "%s: ", intrclass_names[i].name);
#ifndef CONFIG_SMP
		seq_printf(p, "%10u ", kstat_irqs(i));
#else
		for_each_online_cpu(j)
			seq_printf(p, "%10u ", kstat_cpu(j).irqs[i]);
#endif
		if (intrclass_names[i].desc)
			seq_printf(p, "  %s", intrclass_names[i].desc);
                seq_putc(p, '\n');

        }
	put_online_cpus();
        return 0;
+2 −1
Original line number Diff line number Diff line
@@ -8,6 +8,7 @@
 *		 Heiko Carstens <heiko.carstens@de.ibm.com>,
 */

#include <linux/kernel_stat.h>
#include <linux/init.h>
#include <linux/errno.h>
#include <linux/hardirq.h>
@@ -255,7 +256,7 @@ void notrace s390_do_machine_check(struct pt_regs *regs)
	nmi_enter();
	s390_idle_check(regs, S390_lowcore.mcck_clock,
			S390_lowcore.mcck_enter_timer);

	kstat_cpu(smp_processor_id()).irqs[NMI_NMI]++;
	mci = (struct mci *) &S390_lowcore.mcck_interruption_code;
	mcck = &__get_cpu_var(cpu_mcck);
	umode = user_mode(regs);
+1 −0
Original line number Diff line number Diff line
@@ -161,6 +161,7 @@ static void do_ext_call_interrupt(unsigned int ext_int_code,
{
	unsigned long bits;

	kstat_cpu(smp_processor_id()).irqs[EXTINT_IPI]++;
	/*
	 * handle bit signal external calls
	 *
+3 −0
Original line number Diff line number Diff line
@@ -15,6 +15,7 @@
#define KMSG_COMPONENT "time"
#define pr_fmt(fmt) KMSG_COMPONENT ": " fmt

#include <linux/kernel_stat.h>
#include <linux/errno.h>
#include <linux/module.h>
#include <linux/sched.h>
@@ -160,6 +161,7 @@ static void clock_comparator_interrupt(unsigned int ext_int_code,
				       unsigned int param32,
				       unsigned long param64)
{
	kstat_cpu(smp_processor_id()).irqs[EXTINT_CLK]++;
	if (S390_lowcore.clock_comparator == -1ULL)
		set_clock_comparator(S390_lowcore.clock_comparator);
}
@@ -170,6 +172,7 @@ static void stp_timing_alert(struct stp_irq_parm *);
static void timing_alert_interrupt(unsigned int ext_int_code,
				   unsigned int param32, unsigned long param64)
{
	kstat_cpu(smp_processor_id()).irqs[EXTINT_TLA]++;
	if (param32 & 0x00c40000)
		etr_timing_alert((struct etr_irq_parm *) &param32);
	if (param32 & 0x00038000)
Loading