aboutsummaryrefslogtreecommitdiffstats
path: root/fs/proc/proc_misc.c
diff options
context:
space:
mode:
Diffstat (limited to 'fs/proc/proc_misc.c')
-rw-r--r--fs/proc/proc_misc.c25
1 files changed, 18 insertions, 7 deletions
diff --git a/fs/proc/proc_misc.c b/fs/proc/proc_misc.c
index 5fd49e47f83a..bee251cb87c8 100644
--- a/fs/proc/proc_misc.c
+++ b/fs/proc/proc_misc.c
@@ -105,6 +105,7 @@ static int uptime_read_proc(char *page, char **start, off_t off,
105 cputime_t idletime = cputime_add(init_task.utime, init_task.stime); 105 cputime_t idletime = cputime_add(init_task.utime, init_task.stime);
106 106
107 do_posix_clock_monotonic_gettime(&uptime); 107 do_posix_clock_monotonic_gettime(&uptime);
108 monotonic_to_bootbased(&uptime);
108 cputime_to_timespec(idletime, &idle); 109 cputime_to_timespec(idletime, &idle);
109 len = sprintf(page,"%lu.%02lu %lu.%02lu\n", 110 len = sprintf(page,"%lu.%02lu %lu.%02lu\n",
110 (unsigned long) uptime.tv_sec, 111 (unsigned long) uptime.tv_sec,
@@ -443,12 +444,17 @@ static int show_stat(struct seq_file *p, void *v)
443 unsigned long jif; 444 unsigned long jif;
444 cputime64_t user, nice, system, idle, iowait, irq, softirq, steal; 445 cputime64_t user, nice, system, idle, iowait, irq, softirq, steal;
445 u64 sum = 0; 446 u64 sum = 0;
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;
446 453
447 user = nice = system = idle = iowait = 454 user = nice = system = idle = iowait =
448 irq = softirq = steal = cputime64_zero; 455 irq = softirq = steal = cputime64_zero;
449 jif = - wall_to_monotonic.tv_sec; 456 getboottime(&boottime);
450 if (wall_to_monotonic.tv_nsec) 457 jif = boottime.tv_sec;
451 --jif;
452 458
453 for_each_possible_cpu(i) { 459 for_each_possible_cpu(i) {
454 int j; 460 int j;
@@ -461,8 +467,11 @@ static int show_stat(struct seq_file *p, void *v)
461 irq = cputime64_add(irq, kstat_cpu(i).cpustat.irq); 467 irq = cputime64_add(irq, kstat_cpu(i).cpustat.irq);
462 softirq = cputime64_add(softirq, kstat_cpu(i).cpustat.softirq); 468 softirq = cputime64_add(softirq, kstat_cpu(i).cpustat.softirq);
463 steal = cputime64_add(steal, kstat_cpu(i).cpustat.steal); 469 steal = cputime64_add(steal, kstat_cpu(i).cpustat.steal);
464 for (j = 0 ; j < NR_IRQS ; j++) 470 for (j = 0; j < NR_IRQS; j++) {
465 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 }
466 } 475 }
467 476
468 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",
@@ -498,9 +507,10 @@ static int show_stat(struct seq_file *p, void *v)
498 } 507 }
499 seq_printf(p, "intr %llu", (unsigned long long)sum); 508 seq_printf(p, "intr %llu", (unsigned long long)sum);
500 509
501#if !defined(CONFIG_PPC64) && !defined(CONFIG_ALPHA) && !defined(CONFIG_IA64) 510#ifndef CONFIG_SMP
511 /* Touches too many cache lines on SMP setups */
502 for (i = 0; i < NR_IRQS; i++) 512 for (i = 0; i < NR_IRQS; i++)
503 seq_printf(p, " %u", kstat_irqs(i)); 513 seq_printf(p, " %u", per_irq_sum[i]);
504#endif 514#endif
505 515
506 seq_printf(p, 516 seq_printf(p,
@@ -515,6 +525,7 @@ static int show_stat(struct seq_file *p, void *v)
515 nr_running(), 525 nr_running(),
516 nr_iowait()); 526 nr_iowait());
517 527
528 kfree(per_irq_sum);
518 return 0; 529 return 0;
519} 530}
520 531