Skip to content

Commit 3ca0a6e

Browse files
Zhen Leipaulmckrcu
authored andcommitted
sched: Add helper kstat_cpu_softirqs_sum()
Add a kstat_cpu_softirqs_sum() function that is similar to kstat_cpu_irqs_sum(), but which counts software interrupts since boot on the specified CPU. Signed-off-by: Zhen Lei <[email protected]> Cc: Josh Don <[email protected]> Cc: Tejun Heo <[email protected]> Cc: Peter Zijlstra <[email protected]> Reviewed-by: Frederic Weisbecker <[email protected]> Signed-off-by: Paul E. McKenney <[email protected]>
1 parent 47904ae commit 3ca0a6e

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

include/linux/kernel_stat.h

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,17 @@ static inline unsigned int kstat_softirqs_cpu(unsigned int irq, int cpu)
6767
return kstat_cpu(cpu).softirqs[irq];
6868
}
6969

70+
static inline unsigned int kstat_cpu_softirqs_sum(int cpu)
71+
{
72+
int i;
73+
unsigned int sum = 0;
74+
75+
for (i = 0; i < NR_SOFTIRQS; i++)
76+
sum += kstat_softirqs_cpu(i, cpu);
77+
78+
return sum;
79+
}
80+
7081
/*
7182
* Number of interrupts per specific IRQ source, since bootup
7283
*/

0 commit comments

Comments
 (0)