Skip to content

Commit

Permalink
Merge branch 'cputime' of git://git390.marist.edu/pub/scm/linux-2.6
Browse files Browse the repository at this point in the history
* 'cputime' of git://git390.marist.edu/pub/scm/linux-2.6:
  [PATCH] Fix idle time field in /proc/uptime
  • Loading branch information
Linus Torvalds committed Sep 24, 2009
2 parents a6b49cb + 96830a5 commit 7ca263c
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion fs/proc/uptime.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit 7ca263c

Please sign in to comment.