diff options
-rw-r--r-- | include/linux/kernel_stat.h | 12 | ||||
-rw-r--r-- | kernel/softirq.c | 1 |
2 files changed, 13 insertions, 0 deletions
diff --git a/include/linux/kernel_stat.h b/include/linux/kernel_stat.h index a77c6007dc99..348fa8874b52 100644 --- a/include/linux/kernel_stat.h +++ b/include/linux/kernel_stat.h | |||
@@ -5,6 +5,7 @@ | |||
5 | #include <linux/threads.h> | 5 | #include <linux/threads.h> |
6 | #include <linux/percpu.h> | 6 | #include <linux/percpu.h> |
7 | #include <linux/cpumask.h> | 7 | #include <linux/cpumask.h> |
8 | #include <linux/interrupt.h> | ||
8 | #include <asm/irq.h> | 9 | #include <asm/irq.h> |
9 | #include <asm/cputime.h> | 10 | #include <asm/cputime.h> |
10 | 11 | ||
@@ -31,6 +32,7 @@ struct kernel_stat { | |||
31 | #ifndef CONFIG_GENERIC_HARDIRQS | 32 | #ifndef CONFIG_GENERIC_HARDIRQS |
32 | unsigned int irqs[NR_IRQS]; | 33 | unsigned int irqs[NR_IRQS]; |
33 | #endif | 34 | #endif |
35 | unsigned int softirqs[NR_SOFTIRQS]; | ||
34 | }; | 36 | }; |
35 | 37 | ||
36 | DECLARE_PER_CPU(struct kernel_stat, kstat); | 38 | DECLARE_PER_CPU(struct kernel_stat, kstat); |
@@ -67,6 +69,16 @@ extern unsigned int kstat_irqs_cpu(unsigned int irq, int cpu); | |||
67 | 69 | ||
68 | #endif | 70 | #endif |
69 | 71 | ||
72 | static inline void kstat_incr_softirqs_this_cpu(unsigned int irq) | ||
73 | { | ||
74 | kstat_this_cpu.softirqs[irq]++; | ||
75 | } | ||
76 | |||
77 | static inline unsigned int kstat_softirqs_cpu(unsigned int irq, int cpu) | ||
78 | { | ||
79 | return kstat_cpu(cpu).softirqs[irq]; | ||
80 | } | ||
81 | |||
70 | /* | 82 | /* |
71 | * Number of interrupts per specific IRQ source, since bootup | 83 | * Number of interrupts per specific IRQ source, since bootup |
72 | */ | 84 | */ |
diff --git a/kernel/softirq.c b/kernel/softirq.c index b41fb710e114..3a94905fa5d2 100644 --- a/kernel/softirq.c +++ b/kernel/softirq.c | |||
@@ -213,6 +213,7 @@ restart: | |||
213 | do { | 213 | do { |
214 | if (pending & 1) { | 214 | if (pending & 1) { |
215 | int prev_count = preempt_count(); | 215 | int prev_count = preempt_count(); |
216 | kstat_incr_softirqs_this_cpu(h - softirq_vec); | ||
216 | 217 | ||
217 | trace_softirq_entry(h, softirq_vec); | 218 | trace_softirq_entry(h, softirq_vec); |
218 | h->action(h); | 219 | h->action(h); |