aboutsummaryrefslogtreecommitdiffstats
path: root/fs/proc
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2009-09-24 12:04:24 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2009-09-24 12:04:24 -0400
commit7ca263cdf8cf74d0f1c6f48d07d556de92e3bec9 (patch)
tree409ed34476208f714e0d4c529a642d8fd21feaa5 /fs/proc
parenta6b49cb210f878709bdc0bddc16a853f18790d02 (diff)
parent96830a57de1197519b62af6a4c9ceea556c18c3d (diff)
Merge branch 'cputime' of git://git390.marist.edu/pub/scm/linux-2.6
* 'cputime' of git://git390.marist.edu/pub/scm/linux-2.6: [PATCH] Fix idle time field in /proc/uptime
Diffstat (limited to 'fs/proc')
-rw-r--r--fs/proc/uptime.c7
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 @@
4#include <linux/sched.h> 4#include <linux/sched.h>
5#include <linux/seq_file.h> 5#include <linux/seq_file.h>
6#include <linux/time.h> 6#include <linux/time.h>
7#include <linux/kernel_stat.h>
7#include <asm/cputime.h> 8#include <asm/cputime.h>
8 9
9static int uptime_proc_show(struct seq_file *m, void *v) 10static int uptime_proc_show(struct seq_file *m, void *v)
10{ 11{
11 struct timespec uptime; 12 struct timespec uptime;
12 struct timespec idle; 13 struct timespec idle;
13 cputime_t idletime = cputime_add(init_task.utime, init_task.stime); 14 int i;
15 cputime_t idletime = cputime_zero;
16
17 for_each_possible_cpu(i)
18 idletime = cputime64_add(idletime, kstat_cpu(i).cpustat.idle);
14 19
15 do_posix_clock_monotonic_gettime(&uptime); 20 do_posix_clock_monotonic_gettime(&uptime);
16 monotonic_to_bootbased(&uptime); 21 monotonic_to_bootbased(&uptime);