patch-2.1.81 linux/include/linux/kernel_stat.h
Next file: linux/include/linux/minix_fs_sb.h
Previous file: linux/include/linux/blk.h
Back to the patch index
Back to the overall index
- Lines: 36
- Date:
Wed Jan 21 12:13:57 1998
- Orig file:
v2.1.80/linux/include/linux/kernel_stat.h
- Orig date:
Tue Jan 20 12:57:40 1998
diff -u --recursive --new-file v2.1.80/linux/include/linux/kernel_stat.h linux/include/linux/kernel_stat.h
@@ -2,6 +2,7 @@
#define _LINUX_KERNEL_STAT_H
#include <asm/irq.h>
+#include <asm/smp.h>
#include <linux/smp.h>
#include <linux/tasks.h>
@@ -25,7 +26,7 @@
unsigned int dk_drive_wblk[DK_NDRIVE];
unsigned int pgpgin, pgpgout;
unsigned int pswpin, pswpout;
- unsigned int interrupts[NR_CPUS][NR_IRQS];
+ unsigned int irqs[NR_CPUS][NR_IRQS];
unsigned int ipackets, opackets;
unsigned int ierrors, oerrors;
unsigned int collisions;
@@ -33,5 +34,18 @@
};
extern struct kernel_stat kstat;
+
+/*
+ * Number of interrupts per specific IRQ source, since bootup
+ */
+extern inline int kstat_irqs (int irq)
+{
+ int i, sum=0;
+
+ for (i = 0 ; i < smp_num_cpus ; i++)
+ sum += kstat.irqs[cpu_logical_map(i)][irq];
+
+ return sum;
+}
#endif /* _LINUX_KERNEL_STAT_H */
FUNET's LINUX-ADM group, linux-adm@nic.funet.fi
TCL-scripts by Sam Shen, slshen@lbl.gov