Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 17 Jul 2000 11:23:54 -0400 (EDT)
From:      Song Li <sl5b@cs.virginia.edu>
To:        hackers@FreeBSD.ORG
Subject:   Re: different clocks in FreeBSD
Message-ID:  <Pine.GSO.4.05.10007171120300.13550-100000@viper.cs.Virginia.EDU>
In-Reply-To: <Pine.GSO.4.05.10007151248410.26368-100000@viper.cs.Virginia.EDU>

next in thread | previous in thread | raw e-mail | index | archive | help
Could somebody give me suggestion? I believe many people know about this
question. But I did not recieve any reply until now. If you think my
question is not clear or can be solve by simply reading some man
page/source code, please tell me. I am a newbie here. So please do not
hesitate to give me some advice.

thank you all!

-Song

> Hey,
> 
> I want to get the accurate user-time and system-time used by a process 
> whenever I want. My code will run inside the kernel. I try to use the
> getrusage from within the kernel, but the function didn't give right data.
> Then I try to read the p_uticks in the proc structure. But it seems that
> value is not accurate enough because it will be zero when the actual user
> time is small(e.g., 20microsecond). I guess it is because the frequency
> of the statclock is not high enough( stathz=128 from the kern_clockrate).
> So, I have the following questions:
> 
> 1. Can I use getrusage from within the kernel to get the utime and stime?
> 2. Can I use the p_uticks and p_sticks as the utime and stime of the
> system? What's the meaning of p_uu and p_su? What's the meaning of the
> 'tick' in the comments of these variable? Stat tick or sched tick or
> anything else?
> 3. If I have to change the stathz(currently 128, as reported by
> kern_clockrate), where should I change in the source code?
> 4. Is it possible to get the accurate utime and stime at any time, but do
> not have to change the stathz(I worry about it will not efficient). I plan
> to insert some code when interrupt and context switch occured. Is it
> difficult?
> 
> 
> thank you!
> 
> -Song
> 
> 
> 
> 
> To Unsubscribe: send mail to majordomo@FreeBSD.org
> with "unsubscribe freebsd-hackers" in the body of the message
> 



To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-hackers" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?Pine.GSO.4.05.10007171120300.13550-100000>