diff options
author | Stephen Rothwell <sfr@canb.auug.org.au> | 2009-09-15 14:46:31 +1000 |
---|---|---|
committer | Stephen Rothwell <sfr@canb.auug.org.au> | 2009-09-15 14:46:31 +1000 |
commit | d5f0f0f57f4cf6a0a9cfe971143804ab36f04a70 (patch) | |
tree | 4b9b48e21db17a51726272113d10804a2daa731c /fs | |
parent | 77afa9043f8c0df364bbd373117070d41bcb66a9 (diff) | |
parent | 27bf8712477db47c891e6198000c985631cd18de (diff) |
Merge commit 'cputime/cputime'
Diffstat (limited to 'fs')
-rw-r--r-- | fs/proc/uptime.c | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/fs/proc/uptime.c b/fs/proc/uptime.c index 0c10a0b3f146..766b1d456050 100644 --- a/fs/proc/uptime.c +++ b/fs/proc/uptime.c @@ -4,13 +4,18 @@ #include <linux/sched.h> #include <linux/seq_file.h> #include <linux/time.h> +#include <linux/kernel_stat.h> #include <asm/cputime.h> static int uptime_proc_show(struct seq_file *m, void *v) { struct timespec uptime; struct timespec idle; - cputime_t idletime = cputime_add(init_task.utime, init_task.stime); + int i; + cputime_t idletime = cputime_zero; + + for_each_possible_cpu(i) + idletime = cputime64_add(idletime, kstat_cpu(i).cpustat.idle); do_posix_clock_monotonic_gettime(&uptime); monotonic_to_bootbased(&uptime); |