1 #ifndef _LINUX_KERNEL_STAT_H
2 #define _LINUX_KERNEL_STAT_H
4 #include <linux/config.h>
7 #include <linux/threads.h>
10 * 'kernel_stat.h' contains the definitions needed for doing
11 * some kernel statistics (CPU usage, context switches ...),
12 * used by rstatd/perfmeter
15 #define DK_MAX_MAJOR 16
16 #define DK_MAX_DISK 16
19 unsigned int per_cpu_user
[NR_CPUS
],
20 per_cpu_nice
[NR_CPUS
],
21 per_cpu_system
[NR_CPUS
];
22 unsigned int dk_drive
[DK_MAX_MAJOR
][DK_MAX_DISK
];
23 unsigned int dk_drive_rio
[DK_MAX_MAJOR
][DK_MAX_DISK
];
24 unsigned int dk_drive_wio
[DK_MAX_MAJOR
][DK_MAX_DISK
];
25 unsigned int dk_drive_rblk
[DK_MAX_MAJOR
][DK_MAX_DISK
];
26 unsigned int dk_drive_wblk
[DK_MAX_MAJOR
][DK_MAX_DISK
];
27 unsigned int pgpgin
, pgpgout
;
28 unsigned int pswpin
, pswpout
;
29 #if !defined(CONFIG_ARCH_S390)
30 unsigned int irqs
[NR_CPUS
][NR_IRQS
];
32 unsigned int ipackets
, opackets
;
33 unsigned int ierrors
, oerrors
;
34 unsigned int collisions
;
35 unsigned int context_swtch
;
38 extern struct kernel_stat kstat
;
40 #if !defined(CONFIG_ARCH_S390)
42 * Number of interrupts per specific IRQ source, since bootup
44 extern inline int kstat_irqs (int irq
)
48 for (i
= 0 ; i
< smp_num_cpus
; i
++)
49 sum
+= kstat
.irqs
[cpu_logical_map(i
)][irq
];
55 #endif /* _LINUX_KERNEL_STAT_H */