~ubuntu-branches/ubuntu/quantal/linux-lowlatency/quantal

« back to all changes in this revision

Viewing changes to fs/proc/uptime.c

  • Committer: Package Import Robot
  • Author(s): Alessio Igor Bogani
  • Date: 2011-10-26 11:13:05 UTC
  • Revision ID: package-import@ubuntu.com-20111026111305-04kado7d1u2er2rl
Tags: 3.2.0-16.25
Add new lowlatency kernel flavour

Show diffs side-by-side

added added

removed removed

Lines of Context:
11
11
{
12
12
        struct timespec uptime;
13
13
        struct timespec idle;
 
14
        cputime64_t idletime;
 
15
        u64 nsec;
 
16
        u32 rem;
14
17
        int i;
15
 
        cputime_t idletime = cputime_zero;
16
18
 
 
19
        idletime = 0;
17
20
        for_each_possible_cpu(i)
18
21
                idletime = cputime64_add(idletime, kstat_cpu(i).cpustat.idle);
19
22
 
20
23
        do_posix_clock_monotonic_gettime(&uptime);
21
24
        monotonic_to_bootbased(&uptime);
22
 
        cputime_to_timespec(idletime, &idle);
 
25
        nsec = cputime64_to_jiffies64(idletime) * TICK_NSEC;
 
26
        idle.tv_sec = div_u64_rem(nsec, NSEC_PER_SEC, &rem);
 
27
        idle.tv_nsec = rem;
23
28
        seq_printf(m, "%lu.%02lu %lu.%02lu\n",
24
29
                        (unsigned long) uptime.tv_sec,
25
30
                        (uptime.tv_nsec / (NSEC_PER_SEC / 100)),