Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 277373
b: refs/heads/master
c: c3e0ef9
h: refs/heads/master
i:
  277371: 581c8c2
v: v3
  • Loading branch information
Martin Schwidefsky committed Dec 15, 2011
1 parent b39561d commit 4ed221d
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 3 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 648616343cdbe904c585a6c12e323d3b3c72e46f
refs/heads/master: c3e0ef9a298e028a82ada28101ccd5cf64d209ee
9 changes: 7 additions & 2 deletions trunk/fs/proc/uptime.c
Original file line number Diff line number Diff line change
Expand Up @@ -11,15 +11,20 @@ static int uptime_proc_show(struct seq_file *m, void *v)
{
struct timespec uptime;
struct timespec idle;
cputime64_t idletime;
u64 nsec;
u32 rem;
int i;
cputime_t idletime = 0;

idletime = 0;
for_each_possible_cpu(i)
idletime += kstat_cpu(i).cpustat.idle;

do_posix_clock_monotonic_gettime(&uptime);
monotonic_to_bootbased(&uptime);
cputime_to_timespec(idletime, &idle);
nsec = cputime64_to_jiffies64(idletime) * TICK_NSEC;
idle.tv_sec = div_u64_rem(nsec, NSEC_PER_SEC, &rem);
idle.tv_nsec = rem;
seq_printf(m, "%lu.%02lu %lu.%02lu\n",
(unsigned long) uptime.tv_sec,
(uptime.tv_nsec / (NSEC_PER_SEC / 100)),
Expand Down

0 comments on commit 4ed221d

Please sign in to comment.