Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 07 Oct 2008 11:32:33 +0800
From:      David Xu <davidxu@freebsd.org>
To:        Petri Helenius <petri@helenius.fi>
Cc:        freebsd-threads@freebsd.org
Subject:   Re: getrusage with pthreads
Message-ID:  <48EAD851.7000404@freebsd.org>
In-Reply-To: <48EA8320.5050500@helenius.fi>
References:  <48EA8320.5050500@helenius.fi>

next in thread | previous in thread | raw e-mail | index | archive | help
Petri Helenius wrote:
> 
> Is there a way to get thread-specific CPU utilization like the getrusage 
> returns for the whole process? Looking at the kernel sources the 
> utilization is accumulated on thread basis and then summed up but it 
> would be useful to be able to determine utilization on a single thread 
> between two checkpoints. Would pmc or ITIMER_PROF help?
> 
> Pete
> 

You can use clock_gettime(CLOCK_THREAD_CPUTIME_ID), but I admit
getrusage like function is better.

Regards,
David Xu







Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?48EAD851.7000404>