[S390] irq: have detailed statistics for interrupt types
authorHeiko Carstens <heiko.carstens@de.ibm.com>
Wed, 5 Jan 2011 11:47:28 +0000 (12:47 +0100)
committerMartin Schwidefsky <sky@mschwide.boeblingen.de.ibm.com>
Wed, 5 Jan 2011 11:47:25 +0000 (12:47 +0100)
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: Heiko Carstens <heiko.carstens@de.ibm.com>
Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
arch/s390/include/asm/irq.h
arch/s390/kernel/irq.c
arch/s390/kernel/nmi.c
arch/s390/kernel/smp.c
arch/s390/kernel/time.c
arch/s390/kernel/vtime.c
arch/s390/mm/fault.c
drivers/s390/block/dasd_diag.c
drivers/s390/char/sclp.c
drivers/s390/kvm/kvm_virtio.c
net/iucv/iucv.c

index 7da991a858f8c97f1f390fd8285ebb3ab9e3c592..f65faf63ab3afcec20d1787a4daeb070957d9be9 100644 (file)
@@ -1,23 +1,22 @@
 #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 */
index 026a37a94fc9fa6c3560de0bb1424688fddd4f39..9bd049b8f99714ff84d7e9eda0d87f74101d395d 100644 (file)
@@ -1,7 +1,5 @@
 /*
- *  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)
  *
 #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;
index 1995c1712fc83485193dab760623241576b0ef29..fab88431a06fcb70a92b4fdfe0f475d269be67a6 100644 (file)
@@ -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);
index 94cf510b8fe181850e36acdeaa8a9fa65b1397b7..a9702df22f3a2733c2ac94d124510a96df388cfa 100644 (file)
@@ -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
         *
index 4c9d72d2e273d7abec0bc7395b0202888612a016..9e7b039458da30e56d3e85074b70d703111d866c 100644 (file)
@@ -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)
index 8636dd00e3931cbc8bf0cbc1018486577db47242..1ccdf4d8aa850ffb4206dfc0a349280adead120a 100644 (file)
@@ -324,6 +324,7 @@ static void do_cpu_timer_interrupt(unsigned int ext_int_code,
        struct list_head cb_list;       /* the callback queue */
        __u64 elapsed, next;
 
+       kstat_cpu(smp_processor_id()).irqs[EXTINT_TMR]++;
        INIT_LIST_HEAD(&cb_list);
        vq = &__get_cpu_var(virt_cpu_timer);
 
index fe5701e9efbfb95392328a389b1baae49e897844..839b16df72b3d12d0cada745166fb54e7cc5f95a 100644 (file)
@@ -10,6 +10,7 @@
  *    Copyright (C) 1995  Linus Torvalds
  */
 
+#include <linux/kernel_stat.h>
 #include <linux/perf_event.h>
 #include <linux/signal.h>
 #include <linux/sched.h>
@@ -543,6 +544,7 @@ static void pfault_interrupt(unsigned int ext_int_code,
        struct task_struct *tsk;
        __u16 subcode;
 
+       kstat_cpu(smp_processor_id()).irqs[EXTINT_PFL]++;
        /*
         * Get the external interruption subcode & pfault
         * initial/completion signal bit. VM stores this 
index 266b34b55403c638a946d918fb0f45f84b203f6d..a3a5db58df189e1fba028b0d900b5e860940a3fc 100644 (file)
@@ -10,6 +10,7 @@
 
 #define KMSG_COMPONENT "dasd"
 
+#include <linux/kernel_stat.h>
 #include <linux/stddef.h>
 #include <linux/kernel.h>
 #include <linux/slab.h>
@@ -238,6 +239,7 @@ static void dasd_ext_handler(unsigned int ext_int_code,
        addr_t ip;
        int rc;
 
+       kstat_cpu(smp_processor_id()).irqs[EXTINT_DSD]++;
        switch (ext_int_code >> 24) {
        case DASD_DIAG_CODE_31BIT:
                ip = (addr_t) param32;
index 35cc4686b99b458d75a9422ca89394fe4e16ba14..e65572e504ba8f47f3a0e700fd5c82ffa14510b5 100644 (file)
@@ -7,6 +7,7 @@
  *           Martin Schwidefsky <schwidefsky@de.ibm.com>
  */
 
+#include <linux/kernel_stat.h>
 #include <linux/module.h>
 #include <linux/err.h>
 #include <linux/spinlock.h>
@@ -18,8 +19,9 @@
 #include <linux/suspend.h>
 #include <linux/completion.h>
 #include <linux/platform_device.h>
-#include <asm/types.h>
 #include <asm/s390_ext.h>
+#include <asm/types.h>
+#include <asm/irq.h>
 
 #include "sclp.h"
 
@@ -402,6 +404,7 @@ static void sclp_interrupt_handler(unsigned int ext_int_code,
        u32 finished_sccb;
        u32 evbuf_pending;
 
+       kstat_cpu(smp_processor_id()).irqs[EXTINT_SCP]++;
        spin_lock(&sclp_lock);
        finished_sccb = param32 & 0xfffffff8;
        evbuf_pending = param32 & 0x3;
@@ -824,6 +827,7 @@ static void sclp_check_handler(unsigned int ext_int_code,
 {
        u32 finished_sccb;
 
+       kstat_cpu(smp_processor_id()).irqs[EXTINT_SCP]++;
        finished_sccb = param32 & 0xfffffff8;
        /* Is this the interrupt we are waiting for? */
        if (finished_sccb == 0)
index 375aeeaf9ea5e9b9a97e47e6e0ee5a4ba73f78b3..414427d64a8ff6f46b3b7e375c7db97a95a66dac 100644 (file)
@@ -10,6 +10,7 @@
  *    Author(s): Christian Borntraeger <borntraeger@de.ibm.com>
  */
 
+#include <linux/kernel_stat.h>
 #include <linux/init.h>
 #include <linux/bootmem.h>
 #include <linux/err.h>
@@ -25,6 +26,7 @@
 #include <asm/kvm_virtio.h>
 #include <asm/setup.h>
 #include <asm/s390_ext.h>
+#include <asm/irq.h>
 
 #define VIRTIO_SUBCODE_64 0x0D00
 
@@ -379,6 +381,7 @@ static void kvm_extint_handler(unsigned int ext_int_code,
        u16 subcode;
        u32 param;
 
+       kstat_cpu(smp_processor_id()).irqs[EXTINT_VRT]++;
        subcode = ext_int_code >> 16;
        if ((subcode & 0xff00) != VIRTIO_SUBCODE_64)
                return;
index f7db676de77d7568b463df2b8a7db770a0f090e7..1ee5dab3cfaedf26fdab349aa19a3805318a08b2 100644 (file)
@@ -36,6 +36,7 @@
 #define KMSG_COMPONENT "iucv"
 #define pr_fmt(fmt) KMSG_COMPONENT ": " fmt
 
+#include <linux/kernel_stat.h>
 #include <linux/module.h>
 #include <linux/moduleparam.h>
 #include <linux/spinlock.h>
@@ -1804,6 +1805,7 @@ static void iucv_external_interrupt(unsigned int ext_int_code,
        struct iucv_irq_data *p;
        struct iucv_irq_list *work;
 
+       kstat_cpu(smp_processor_id()).irqs[EXTINT_IUC]++;
        p = iucv_irq_data[smp_processor_id()];
        if (p->ippathid >= iucv_max_pathid) {
                WARN_ON(p->ippathid >= iucv_max_pathid);