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 [EMAIL PROTECTED]
> with "unsubscribe freebsd-hackers" in the body of the message
> 



To Unsubscribe: send mail to [EMAIL PROTECTED]
with "unsubscribe freebsd-hackers" in the body of the message

Reply via email to