Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 218570
b: refs/heads/master
c: f2c66cd
h: refs/heads/master
v: v3
  • Loading branch information
KAMEZAWA Hiroyuki authored and Linus Torvalds committed Oct 28, 2010
1 parent 81aaef1 commit 77c582b
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 6 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 19cd56c48da58bebc3a638e036bcab69469acd27
refs/heads/master: f2c66cd8eeddedb440f33bc0f5cec1ed7ae376cb
4 changes: 1 addition & 3 deletions trunk/fs/proc/stat.c
Original file line number Diff line number Diff line change
Expand Up @@ -52,9 +52,7 @@ static int show_stat(struct seq_file *p, void *v)
guest = cputime64_add(guest, kstat_cpu(i).cpustat.guest);
guest_nice = cputime64_add(guest_nice,
kstat_cpu(i).cpustat.guest_nice);
for_each_irq_nr(j) {
sum += kstat_irqs_cpu(j, i);
}
sum += kstat_cpu_irqs_sum(i);
sum += arch_irq_stat_cpu(i);

for (j = 0; j < NR_SOFTIRQS; j++) {
Expand Down
14 changes: 12 additions & 2 deletions trunk/include/linux/kernel_stat.h
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ struct kernel_stat {
#ifndef CONFIG_GENERIC_HARDIRQS
unsigned int irqs[NR_IRQS];
#endif
unsigned long irqs_sum;
unsigned int softirqs[NR_SOFTIRQS];
};

Expand All @@ -54,6 +55,7 @@ static inline void kstat_incr_irqs_this_cpu(unsigned int irq,
struct irq_desc *desc)
{
kstat_this_cpu.irqs[irq]++;
kstat_this_cpu.irqs_sum++;
}

static inline unsigned int kstat_irqs_cpu(unsigned int irq, int cpu)
Expand All @@ -65,8 +67,9 @@ static inline unsigned int kstat_irqs_cpu(unsigned int irq, int cpu)
extern unsigned int kstat_irqs_cpu(unsigned int irq, int cpu);
#define kstat_irqs_this_cpu(DESC) \
((DESC)->kstat_irqs[smp_processor_id()])
#define kstat_incr_irqs_this_cpu(irqno, DESC) \
((DESC)->kstat_irqs[smp_processor_id()]++)
#define kstat_incr_irqs_this_cpu(irqno, DESC) do {\
((DESC)->kstat_irqs[smp_processor_id()]++);\
kstat_this_cpu.irqs_sum++; } while (0)

#endif

Expand Down Expand Up @@ -94,6 +97,13 @@ static inline unsigned int kstat_irqs(unsigned int irq)
return sum;
}

/*
* Number of interrupts per cpu, since bootup
*/
static inline unsigned int kstat_cpu_irqs_sum(unsigned int cpu)
{
return kstat_cpu(cpu).irqs_sum;
}

/*
* Lock/unlock the current runqueue - to extract task statistics:
Expand Down

0 comments on commit 77c582b

Please sign in to comment.