better /proc/interrupts

Pavel Machek (pavel@bug.ucw.cz)
Tue, 11 May 1999 21:27:17 +0200


Hi!

If some interrupt has non-zero count, I think that it is worth
displaying even if there's no current user. If you want to know how
many interrupts from serial happened, you can do that now without cat
/dev/ttyS1... You'll also clearly see what interrupts are in use on
your system and what are not...

Pavel

--- clean/arch/i386/kernel/irq.c Sat Apr 17 22:31:43 1999
+++ linux/arch/i386/kernel/irq.c Mon May 3 21:09:07 1999
@@ -410,19 +410,23 @@
*p++ = '\n';

for (i = 0 ; i < NR_IRQS ; i++) {
+ unsigned keep = 0;
+ char *q = p;
action = irq_desc[i].action;
- if (!action)
- continue;
+
p += sprintf(p, "%3d: ",i);
#ifndef __SMP__
- p += sprintf(p, "%10u ", kstat_irqs(i));
+ p += sprintf(p, "%10u ", keep = kstat_irqs(i));
#else
for (j=0; j<smp_num_cpus; j++)
p += sprintf(p, "%10u ",
- kstat.irqs[cpu_logical_map(j)][i]);
+ keep |= kstat.irqs[cpu_logical_map(j)][i]);
#endif
p += sprintf(p, " %14s", irq_desc[i].handler->typename);
- p += sprintf(p, " %s", action->name);
+ if (!action) {
+ if (!keep) p = q; else *p++ = '\n';
+ continue;
+ } else p += sprintf(p, " %s", action->name);

for (action=action->next; action; action = action->next) {
p += sprintf(p, ", %s", action->name);

-- 
I'm really pavel@ucw.cz. Look at http://195.113.31.123/~pavel.          Pavel
Hi! I'm a .signature virus! Copy me into your ~/.signature to help me spread!

- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.rutgers.edu Please read the FAQ at http://www.tux.org/lkml/