Re: lug-bg: Kakvo e jiffies time
- Subject: Re: lug-bg: Kakvo e jiffies time
- From: Nikolay Mitev <nikolaym@xxxxxxxxxxxxxxxxxxx>
- Date: Mon, 08 Sep 2003 10:58:57 -0500
Здравейте,
Yavor Shahpasov wrote:
Macha se da napisha edin script deto da pokazva uptime na opredelen
process
za tselta cheta
/proc/pid/stat, vav 22 element pishe che e vremeto ot boot vav jiffie,
vremeto ot boot go gepia on /proc/stat, no kakvo po diavolite e giffies
pitah google no samo source ot kernel mi vadi, iavno e che search
engines ne sa mnogo umni, ili az ne pitam pravilno, dali pak jeeves ne
znae .
Niakoi madar kernel haker moje li da pomogne.
Бе не съм нито мъдар, нито хакер, ама мисля, че мога да ти помогна.
/linux/kernel/itimer.c
/static void *jiffiestotv*(unsigned long *jiffies*, struct *timeval* **value*)
{
*value*->*tv_usec* = (*jiffies* % *HZ*) * (1000000 / *HZ*);
*value*->*tv_sec* = *jiffies* / *HZ*;
return;
}
или по-простичко, секунди == jiffies / HZ
За i386 архитектури HZ == 100
linux/include/asm-i386/param.h:
#ifndef HZ
#define HZ 100
#endif
Use the source :-)
cheers,
face
============================================================================
A mail-list of Linux Users Group - Bulgaria (bulgarian linuxers).
http://www.linux-bulgaria.org - Hosted by Internet Group Ltd. - Stara Zagora
To unsubscribe: http://www.linux-bulgaria.org/public/mail_list.html
============================================================================
|