Mailing List Archive


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[tlug] /proc/uptime



Hi,

What is the meaning of the second number( idle time) in the output of
`cat /proc/uptime`?
I really don't understand what is the "idle time" of the kernel.

[vuhung@example.com proc]$ cat /proc/uptime
6529.80 6494.24

cf:
# linux-2.6.18/fs/proc/proc_misc.c:uptime_read_proc() function:
static int uptime_read_proc(char *page, char **start, off_t off,
                                 int count, int *eof, void *data)
{
        struct timespec uptime;
        struct timespec idle;
        int len;
        cputime_t idletime = cputime_add(init_task.utime, init_task.stime);

        do_posix_clock_monotonic_gettime(&uptime);
        cputime_to_timespec(idletime, &idle);
        len = sprintf(page,"%lu.%02lu %lu.%02lu\n",
                        (unsigned long) uptime.tv_sec,
                        (uptime.tv_nsec / (NSEC_PER_SEC / 100)),
                        (unsigned long) idle.tv_sec,
                        (idle.tv_nsec / (NSEC_PER_SEC / 100)));

        return proc_calc_metrics(page, start, off, count, eof, len);
}


-- 
Best Regards,
Nguyen Hung Vu ( Nguyễn Vũ Hưng )
vuhung16plus{remove}@example.com , YIM: vuhung16 , Skype: vuhung16dg
A brief profile: http://www.hn.is.uec.ac.jp/~vuhung/Nguyen.Vu.Hung.html

Home | Main Index | Thread Index

Home Page Mailing List Linux and Japan TLUG Members Links