diff options
Diffstat (limited to 'fs/proc/proc_misc.c')
| -rw-r--r-- | fs/proc/proc_misc.c | 15 |
1 files changed, 12 insertions, 3 deletions
diff --git a/fs/proc/proc_misc.c b/fs/proc/proc_misc.c index d24b8d46059a..f133afebed7a 100644 --- a/fs/proc/proc_misc.c +++ b/fs/proc/proc_misc.c | |||
| @@ -445,6 +445,11 @@ static int show_stat(struct seq_file *p, void *v) | |||
| 445 | cputime64_t user, nice, system, idle, iowait, irq, softirq, steal; | 445 | cputime64_t user, nice, system, idle, iowait, irq, softirq, steal; |
| 446 | u64 sum = 0; | 446 | u64 sum = 0; |
| 447 | struct timespec boottime; | 447 | struct timespec boottime; |
| 448 | unsigned int *per_irq_sum; | ||
| 449 | |||
| 450 | per_irq_sum = kzalloc(sizeof(unsigned int)*NR_IRQS, GFP_KERNEL); | ||
| 451 | if (!per_irq_sum) | ||
| 452 | return -ENOMEM; | ||
| 448 | 453 | ||
| 449 | user = nice = system = idle = iowait = | 454 | user = nice = system = idle = iowait = |
| 450 | irq = softirq = steal = cputime64_zero; | 455 | irq = softirq = steal = cputime64_zero; |
| @@ -462,8 +467,11 @@ static int show_stat(struct seq_file *p, void *v) | |||
| 462 | irq = cputime64_add(irq, kstat_cpu(i).cpustat.irq); | 467 | irq = cputime64_add(irq, kstat_cpu(i).cpustat.irq); |
| 463 | softirq = cputime64_add(softirq, kstat_cpu(i).cpustat.softirq); | 468 | softirq = cputime64_add(softirq, kstat_cpu(i).cpustat.softirq); |
| 464 | steal = cputime64_add(steal, kstat_cpu(i).cpustat.steal); | 469 | steal = cputime64_add(steal, kstat_cpu(i).cpustat.steal); |
| 465 | for (j = 0 ; j < NR_IRQS ; j++) | 470 | for (j = 0; j < NR_IRQS; j++) { |
| 466 | sum += kstat_cpu(i).irqs[j]; | 471 | unsigned int temp = kstat_cpu(i).irqs[j]; |
| 472 | sum += temp; | ||
| 473 | per_irq_sum[j] += temp; | ||
| 474 | } | ||
| 467 | } | 475 | } |
| 468 | 476 | ||
| 469 | seq_printf(p, "cpu %llu %llu %llu %llu %llu %llu %llu %llu\n", | 477 | seq_printf(p, "cpu %llu %llu %llu %llu %llu %llu %llu %llu\n", |
| @@ -501,7 +509,7 @@ static int show_stat(struct seq_file *p, void *v) | |||
| 501 | 509 | ||
| 502 | #if !defined(CONFIG_PPC64) && !defined(CONFIG_ALPHA) && !defined(CONFIG_IA64) | 510 | #if !defined(CONFIG_PPC64) && !defined(CONFIG_ALPHA) && !defined(CONFIG_IA64) |
| 503 | for (i = 0; i < NR_IRQS; i++) | 511 | for (i = 0; i < NR_IRQS; i++) |
| 504 | seq_printf(p, " %u", kstat_irqs(i)); | 512 | seq_printf(p, " %u", per_irq_sum[i]); |
| 505 | #endif | 513 | #endif |
| 506 | 514 | ||
| 507 | seq_printf(p, | 515 | seq_printf(p, |
| @@ -516,6 +524,7 @@ static int show_stat(struct seq_file *p, void *v) | |||
| 516 | nr_running(), | 524 | nr_running(), |
| 517 | nr_iowait()); | 525 | nr_iowait()); |
| 518 | 526 | ||
| 527 | kfree(per_irq_sum); | ||
| 519 | return 0; | 528 | return 0; |
| 520 | } | 529 | } |
| 521 | 530 | ||
