diff options
Diffstat (limited to 'include/linux/kernel_stat.h')
-rw-r--r-- | include/linux/kernel_stat.h | 18 |
1 files changed, 16 insertions, 2 deletions
diff --git a/include/linux/kernel_stat.h b/include/linux/kernel_stat.h index c059044bc6dc..ad54c846911b 100644 --- a/include/linux/kernel_stat.h +++ b/include/linux/kernel_stat.h | |||
@@ -33,6 +33,7 @@ struct kernel_stat { | |||
33 | #ifndef CONFIG_GENERIC_HARDIRQS | 33 | #ifndef CONFIG_GENERIC_HARDIRQS |
34 | unsigned int irqs[NR_IRQS]; | 34 | unsigned int irqs[NR_IRQS]; |
35 | #endif | 35 | #endif |
36 | unsigned long irqs_sum; | ||
36 | unsigned int softirqs[NR_SOFTIRQS]; | 37 | unsigned int softirqs[NR_SOFTIRQS]; |
37 | }; | 38 | }; |
38 | 39 | ||
@@ -54,6 +55,7 @@ static inline void kstat_incr_irqs_this_cpu(unsigned int irq, | |||
54 | struct irq_desc *desc) | 55 | struct irq_desc *desc) |
55 | { | 56 | { |
56 | kstat_this_cpu.irqs[irq]++; | 57 | kstat_this_cpu.irqs[irq]++; |
58 | kstat_this_cpu.irqs_sum++; | ||
57 | } | 59 | } |
58 | 60 | ||
59 | static inline unsigned int kstat_irqs_cpu(unsigned int irq, int cpu) | 61 | static inline unsigned int kstat_irqs_cpu(unsigned int irq, int cpu) |
@@ -65,8 +67,9 @@ static inline unsigned int kstat_irqs_cpu(unsigned int irq, int cpu) | |||
65 | extern unsigned int kstat_irqs_cpu(unsigned int irq, int cpu); | 67 | extern unsigned int kstat_irqs_cpu(unsigned int irq, int cpu); |
66 | #define kstat_irqs_this_cpu(DESC) \ | 68 | #define kstat_irqs_this_cpu(DESC) \ |
67 | ((DESC)->kstat_irqs[smp_processor_id()]) | 69 | ((DESC)->kstat_irqs[smp_processor_id()]) |
68 | #define kstat_incr_irqs_this_cpu(irqno, DESC) \ | 70 | #define kstat_incr_irqs_this_cpu(irqno, DESC) do {\ |
69 | ((DESC)->kstat_irqs[smp_processor_id()]++) | 71 | ((DESC)->kstat_irqs[smp_processor_id()]++);\ |
72 | kstat_this_cpu.irqs_sum++; } while (0) | ||
70 | 73 | ||
71 | #endif | 74 | #endif |
72 | 75 | ||
@@ -83,6 +86,7 @@ static inline unsigned int kstat_softirqs_cpu(unsigned int irq, int cpu) | |||
83 | /* | 86 | /* |
84 | * Number of interrupts per specific IRQ source, since bootup | 87 | * Number of interrupts per specific IRQ source, since bootup |
85 | */ | 88 | */ |
89 | #ifndef CONFIG_GENERIC_HARDIRQS | ||
86 | static inline unsigned int kstat_irqs(unsigned int irq) | 90 | static inline unsigned int kstat_irqs(unsigned int irq) |
87 | { | 91 | { |
88 | unsigned int sum = 0; | 92 | unsigned int sum = 0; |
@@ -93,7 +97,17 @@ static inline unsigned int kstat_irqs(unsigned int irq) | |||
93 | 97 | ||
94 | return sum; | 98 | return sum; |
95 | } | 99 | } |
100 | #else | ||
101 | extern unsigned int kstat_irqs(unsigned int irq); | ||
102 | #endif | ||
96 | 103 | ||
104 | /* | ||
105 | * Number of interrupts per cpu, since bootup | ||
106 | */ | ||
107 | static inline unsigned int kstat_cpu_irqs_sum(unsigned int cpu) | ||
108 | { | ||
109 | return kstat_cpu(cpu).irqs_sum; | ||
110 | } | ||
97 | 111 | ||
98 | /* | 112 | /* |
99 | * Lock/unlock the current runqueue - to extract task statistics: | 113 | * Lock/unlock the current runqueue - to extract task statistics: |