Look for t_pctcpu, it's essentially what prstat(1m) uses. 

Hth

Rafael



On Dec 5, 2013, at 11:10, Daniil Lunev <[email protected]> wrote:

> Hello.
> Measuring and investigating perfomance in Illumos I have faced the problem 
> that I can't find a mechanism to get a thread's CPU time in the code. Two 
> things I've found are not applicable: the dtraces' fields in kthread_t are 
> filled when the dtrace's vtime is enabled only, another is tk_cpu_time and 
> tk_cpu_ticks in task_t but this way has a bad resolution and updates on 
> clockticks only. Have I missed anything? If it's all we have, may be it's a 
> good idea to add some mechanisms for monitoring thread CPU usage inside the 
> kernel? For example, I have an idea to add a flag to the kthread structure 
> which makes the kernel to use the dtrace's switch procedures or something 
> similar if it's enabled. Does it make any sense? Will it be so bad for the 
> context switching time?
> Thanks,
> Daniil Lunev.
> illumos-discuss | Archives  | Modify Your Subscription         



-------------------------------------------
illumos-discuss
Archives: https://www.listbox.com/member/archive/182180/=now
RSS Feed: https://www.listbox.com/member/archive/rss/182180/21175430-2e6923be
Modify Your Subscription: 
https://www.listbox.com/member/?member_id=21175430&id_secret=21175430-6a77cda4
Powered by Listbox: http://www.listbox.com

Reply via email to