diff options
| author | Martin Schwidefsky <schwidefsky@de.ibm.com> | 2003-07-16 20:34:28 -0700 |
|---|---|---|
| committer | Linus Torvalds <torvalds@home.osdl.org> | 2003-07-16 20:34:28 -0700 |
| commit | c01b325f446960d5045ccde1de0bc8608749d126 (patch) | |
| tree | 10be46e4fd4bcc4789710e77df73df8fbcd4525e | |
| parent | 2eb5ee047f78987e7004e84c5b4fb0812bc49de9 (diff) | |
[PATCH] s390: irq stats.
Enable irq statistics for s390*. We defined NR_IRQS to 2, one for all i/o
interrupts and one for all external interrupts.
| -rw-r--r-- | arch/s390/kernel/entry.S | 3 | ||||
| -rw-r--r-- | arch/s390/kernel/entry64.S | 1 | ||||
| -rw-r--r-- | arch/s390/kernel/s390_ext.c | 8 | ||||
| -rw-r--r-- | arch/s390/kernel/setup.c | 40 | ||||
| -rw-r--r-- | drivers/s390/cio/cio.c | 3 | ||||
| -rw-r--r-- | fs/proc/proc_misc.c | 8 | ||||
| -rw-r--r-- | include/asm-s390/irq.h | 7 | ||||
| -rw-r--r-- | include/linux/kernel_stat.h | 4 |
8 files changed, 58 insertions, 16 deletions
diff --git a/arch/s390/kernel/entry.S b/arch/s390/kernel/entry.S index 6192dfd1271b..c8e982649b6a 100644 --- a/arch/s390/kernel/entry.S +++ b/arch/s390/kernel/entry.S @@ -606,6 +606,8 @@ ext_int_handler: SAVE_ALL_BASE SAVE_ALL __LC_EXT_OLD_PSW,0 GET_THREAD_INFO # load pointer to task_struct to R9 + l %r1,BASED(.Ldo_extint) + basr %r14,%r1 lh %r6,__LC_EXT_INT_CODE # get interruption code lr %r1,%r6 # calculate index = code & 0xff n %r1,BASED(.Lc0xff) @@ -694,6 +696,7 @@ restart_go: */ .Ls390_mcck: .long s390_do_machine_check .Ldo_IRQ: .long do_IRQ +.Ldo_extint: .long do_extint .Ldo_signal: .long do_signal .Ldo_softirq: .long do_softirq .Lentry_base: .long entry_base diff --git a/arch/s390/kernel/entry64.S b/arch/s390/kernel/entry64.S index 40efb385eda9..3e0ec9116eb5 100644 --- a/arch/s390/kernel/entry64.S +++ b/arch/s390/kernel/entry64.S @@ -637,6 +637,7 @@ io_sigpending: ext_int_handler: SAVE_ALL __LC_EXT_OLD_PSW,0 GET_THREAD_INFO # load pointer to task_struct to R9 + brasl %r14,do_extint llgh %r6,__LC_EXT_INT_CODE # get interruption code lgr %r1,%r6 # calculate index = code & 0xff nill %r1,0xff diff --git a/arch/s390/kernel/s390_ext.c b/arch/s390/kernel/s390_ext.c index a1ebcd81bf3a..afc5cb5018d7 100644 --- a/arch/s390/kernel/s390_ext.c +++ b/arch/s390/kernel/s390_ext.c @@ -11,8 +11,11 @@ #include <linux/kernel.h> #include <linux/slab.h> #include <linux/errno.h> +#include <linux/kernel_stat.h> + #include <asm/lowcore.h> #include <asm/s390_ext.h> +#include <asm/irq.h> /* * Simple hash strategy: index = code & 0xff; @@ -98,6 +101,11 @@ int unregister_early_external_interrupt(__u16 code, ext_int_handler_t handler, return 0; } +void do_extint(void) +{ + kstat_cpu(smp_processor_id()).irqs[EXTERNAL_INTERRUPT]++; +} + EXPORT_SYMBOL(register_external_interrupt); EXPORT_SYMBOL(unregister_external_interrupt); diff --git a/arch/s390/kernel/setup.c b/arch/s390/kernel/setup.c index a4f84f8c6bcc..1f032a16cf17 100644 --- a/arch/s390/kernel/setup.c +++ b/arch/s390/kernel/setup.c @@ -34,12 +34,15 @@ #include <linux/root_dev.h> #include <linux/console.h> #include <linux/seq_file.h> +#include <linux/kernel_stat.h> + #include <asm/uaccess.h> #include <asm/system.h> #include <asm/smp.h> #include <asm/mmu_context.h> #include <asm/cpcmd.h> #include <asm/lowcore.h> +#include <asm/irq.h> /* * Machine setup.. @@ -600,3 +603,40 @@ struct seq_operations cpuinfo_op = { .stop = c_stop, .show = show_cpuinfo, }; + +/* + * show_interrupts is needed by /proc/interrupts. + */ + +static const char *intrclass_names[] = { + "EXT", + "I/O", +}; + +int show_interrupts(struct seq_file *p, void *v) +{ + int i, j; + + seq_puts(p, " "); + + for (j=0; j<NR_CPUS; j++) + if (cpu_online(j)) + seq_printf(p, "CPU%d ",j); + + seq_putc(p, '\n'); + + for (i = 0 ; i < NR_IRQS ; i++) { + seq_printf(p, "%s: ", intrclass_names[i]); +#ifndef CONFIG_SMP + seq_printf(p, "%10u ", kstat_irqs(i)); +#else + for (j = 0; j < NR_CPUS; j++) + if (cpu_online(j)) + seq_printf(p, "%10u ", kstat_cpu(j).irqs[i]); +#endif + seq_putc(p, '\n'); + + } + + return 0; +} diff --git a/drivers/s390/cio/cio.c b/drivers/s390/cio/cio.c index 7b3245af7384..9b15dca4d8da 100644 --- a/drivers/s390/cio/cio.c +++ b/drivers/s390/cio/cio.c @@ -16,10 +16,12 @@ #include <linux/init.h> #include <linux/slab.h> #include <linux/device.h> +#include <linux/kernel_stat.h> #include <asm/hardirq.h> #include <asm/cio.h> #include <asm/delay.h> +#include <asm/irq.h> #include "airq.h" #include "cio.h" @@ -608,6 +610,7 @@ do_IRQ (struct pt_regs regs) tpi_info = (struct tpi_info *) __LC_SUBCHANNEL_ID; irb = (struct irb *) __LC_IRB; do { + kstat_cpu(smp_processor_id()).irqs[IO_INTERRUPT]++; /* * Non I/O-subchannel thin interrupts are processed differently */ diff --git a/fs/proc/proc_misc.c b/fs/proc/proc_misc.c index c66785012545..4ceb4a90a6f2 100644 --- a/fs/proc/proc_misc.c +++ b/fs/proc/proc_misc.c @@ -388,10 +388,8 @@ static int kstat_read_proc(char *page, char **start, off_t off, system += kstat_cpu(i).cpustat.system; idle += kstat_cpu(i).cpustat.idle; iowait += kstat_cpu(i).cpustat.iowait; -#if !defined(CONFIG_ARCH_S390) for (j = 0 ; j < NR_IRQS ; j++) sum += kstat_cpu(i).irqs[j]; -#endif } len = sprintf(page, "cpu %u %u %u %u %u\n", @@ -412,7 +410,7 @@ static int kstat_read_proc(char *page, char **start, off_t off, } len += sprintf(page + len, "intr %u", sum); -#if !defined(CONFIG_ARCH_S390) && !defined(CONFIG_PPC64) && !defined(CONFIG_ALPHA) +#if !defined(CONFIG_PPC64) && !defined(CONFIG_ALPHA) for (i = 0 ; i < NR_IRQS ; i++) len += sprintf(page + len, " %u", kstat_irqs(i)); #endif @@ -440,7 +438,6 @@ static int devices_read_proc(char *page, char **start, off_t off, return proc_calc_metrics(page, start, off, count, eof, len); } -#if !defined(CONFIG_ARCH_S390) extern int show_interrupts(struct seq_file *p, void *v); static int interrupts_open(struct inode *inode, struct file *file) { @@ -466,7 +463,6 @@ static struct file_operations proc_interrupts_operations = { .llseek = seq_lseek, .release = single_release, }; -#endif static int filesystems_read_proc(char *page, char **start, off_t off, int count, int *eof, void *data) @@ -646,9 +642,7 @@ void __init proc_misc_init(void) entry->proc_fops = &proc_kmsg_operations; create_seq_entry("cpuinfo", 0, &proc_cpuinfo_operations); create_seq_entry("partitions", 0, &proc_partitions_operations); -#if !defined(CONFIG_ARCH_S390) create_seq_entry("interrupts", 0, &proc_interrupts_operations); -#endif create_seq_entry("slabinfo",S_IWUSR|S_IRUGO,&proc_slabinfo_operations); create_seq_entry("buddyinfo",S_IRUGO, &fragmentation_file_operations); create_seq_entry("vmstat",S_IRUGO, &proc_vmstat_file_operations); diff --git a/include/asm-s390/irq.h b/include/asm-s390/irq.h index 36027232a820..25f1808531cc 100644 --- a/include/asm-s390/irq.h +++ b/include/asm-s390/irq.h @@ -8,16 +8,13 @@ * 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 (6). + * of interrupt classes (2). + * Only external and i/o interrupts make much sense here (CH). */ enum interruption_class { EXTERNAL_INTERRUPT, IO_INTERRUPT, - MACHINE_CHECK_INTERRUPT, - PROGRAM_INTERRUPT, - RESTART_INTERRUPT, - SUPERVISOR_CALL, NR_IRQS, }; diff --git a/include/linux/kernel_stat.h b/include/linux/kernel_stat.h index 9971827a3c4b..f2449476b088 100644 --- a/include/linux/kernel_stat.h +++ b/include/linux/kernel_stat.h @@ -23,9 +23,7 @@ struct cpu_usage_stat { struct kernel_stat { struct cpu_usage_stat cpustat; -#if !defined(CONFIG_ARCH_S390) unsigned int irqs[NR_IRQS]; -#endif }; DECLARE_PER_CPU(struct kernel_stat, kstat); @@ -36,7 +34,6 @@ DECLARE_PER_CPU(struct kernel_stat, kstat); extern unsigned long nr_context_switches(void); -#if !defined(CONFIG_ARCH_S390) /* * Number of interrupts per specific IRQ source, since bootup */ @@ -50,6 +47,5 @@ static inline int kstat_irqs(int irq) return sum; } -#endif #endif /* _LINUX_KERNEL_STAT_H */ |
