Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 61561
b: refs/heads/master
c: 4004c69
h: refs/heads/master
i:
  61559: c5712bf
v: v3
  • Loading branch information
Ravikiran G Thirumalai authored and Linus Torvalds committed Jul 19, 2007
1 parent e781e8a commit 471d419
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 4 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: a0a9983509f45b2225ca87fdcf7b40ea916834ed
refs/heads/master: 4004c69ad68dd03733179277280ea2946990ba36
15 changes: 12 additions & 3 deletions trunk/fs/proc/proc_misc.c
Original file line number Diff line number Diff line change
Expand Up @@ -445,6 +445,11 @@ static int show_stat(struct seq_file *p, void *v)
cputime64_t user, nice, system, idle, iowait, irq, softirq, steal;
u64 sum = 0;
struct timespec boottime;
unsigned int *per_irq_sum;

per_irq_sum = kzalloc(sizeof(unsigned int)*NR_IRQS, GFP_KERNEL);
if (!per_irq_sum)
return -ENOMEM;

user = nice = system = idle = iowait =
irq = softirq = steal = cputime64_zero;
Expand All @@ -462,8 +467,11 @@ static int show_stat(struct seq_file *p, void *v)
irq = cputime64_add(irq, kstat_cpu(i).cpustat.irq);
softirq = cputime64_add(softirq, kstat_cpu(i).cpustat.softirq);
steal = cputime64_add(steal, kstat_cpu(i).cpustat.steal);
for (j = 0 ; j < NR_IRQS ; j++)
sum += kstat_cpu(i).irqs[j];
for (j = 0; j < NR_IRQS; j++) {
unsigned int temp = kstat_cpu(i).irqs[j];
sum += temp;
per_irq_sum[j] += temp;
}
}

seq_printf(p, "cpu %llu %llu %llu %llu %llu %llu %llu %llu\n",
Expand Down Expand Up @@ -501,7 +509,7 @@ static int show_stat(struct seq_file *p, void *v)

#if !defined(CONFIG_PPC64) && !defined(CONFIG_ALPHA) && !defined(CONFIG_IA64)
for (i = 0; i < NR_IRQS; i++)
seq_printf(p, " %u", kstat_irqs(i));
seq_printf(p, " %u", per_irq_sum[i]);
#endif

seq_printf(p,
Expand All @@ -516,6 +524,7 @@ static int show_stat(struct seq_file *p, void *v)
nr_running(),
nr_iowait());

kfree(per_irq_sum);
return 0;
}

Expand Down

0 comments on commit 471d419

Please sign in to comment.