Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 218571
b: refs/heads/master
c: 478735e
h: refs/heads/master
i:
  218569: 81aaef1
  218567: defd7d5
v: v3
  • Loading branch information
KAMEZAWA Hiroyuki authored and Linus Torvalds committed Oct 28, 2010
1 parent 77c582b commit 899d4f3
Show file tree
Hide file tree
Showing 4 changed files with 22 additions and 9 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: f2c66cd8eeddedb440f33bc0f5cec1ed7ae376cb
refs/heads/master: 478735e38887077ac77a9756121b6ce0cb956e2f
10 changes: 2 additions & 8 deletions trunk/fs/proc/stat.c
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,6 @@ static int show_stat(struct seq_file *p, void *v)
u64 sum_softirq = 0;
unsigned int per_softirq_sums[NR_SOFTIRQS] = {0};
struct timespec boottime;
unsigned int per_irq_sum;

user = nice = system = idle = iowait =
irq = softirq = steal = cputime64_zero;
Expand Down Expand Up @@ -108,13 +107,8 @@ static int show_stat(struct seq_file *p, void *v)
seq_printf(p, "intr %llu", (unsigned long long)sum);

/* sum again ? it could be updated? */
for_each_irq_nr(j) {
per_irq_sum = 0;
for_each_possible_cpu(i)
per_irq_sum += kstat_irqs_cpu(j, i);

seq_printf(p, " %u", per_irq_sum);
}
for_each_irq_nr(j)
seq_printf(p, " %u", kstat_irqs(j));

seq_printf(p,
"\nctxt %llu\n"
Expand Down
4 changes: 4 additions & 0 deletions trunk/include/linux/kernel_stat.h
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,7 @@ static inline unsigned int kstat_softirqs_cpu(unsigned int irq, int cpu)
/*
* Number of interrupts per specific IRQ source, since bootup
*/
#ifndef CONFIG_GENERIC_HARDIRQS
static inline unsigned int kstat_irqs(unsigned int irq)
{
unsigned int sum = 0;
Expand All @@ -96,6 +97,9 @@ static inline unsigned int kstat_irqs(unsigned int irq)

return sum;
}
#else
extern unsigned int kstat_irqs(unsigned int irq);
#endif

/*
* Number of interrupts per cpu, since bootup
Expand Down
15 changes: 15 additions & 0 deletions trunk/kernel/irq/irqdesc.c
Original file line number Diff line number Diff line change
Expand Up @@ -393,3 +393,18 @@ unsigned int kstat_irqs_cpu(unsigned int irq, int cpu)
struct irq_desc *desc = irq_to_desc(irq);
return desc ? desc->kstat_irqs[cpu] : 0;
}

#ifdef CONFIG_GENERIC_HARDIRQS
unsigned int kstat_irqs(unsigned int irq)
{
struct irq_desc *desc = irq_to_desc(irq);
int cpu;
int sum = 0;

if (!desc)
return 0;
for_each_possible_cpu(cpu)
sum += desc->kstat_irqs[cpu];
return sum;
}
#endif /* CONFIG_GENERIC_HARDIRQS */

0 comments on commit 899d4f3

Please sign in to comment.