From owner-freebsd-threads@FreeBSD.ORG Fri Oct 31 01:20:38 2008 Return-Path: Delivered-To: freebsd-threads@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 0D3851065686 for ; Fri, 31 Oct 2008 01:20:38 +0000 (UTC) (envelope-from davidxu@freebsd.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2001:4f8:fff6::28]) by mx1.freebsd.org (Postfix) with ESMTP id D64238FC0A; Fri, 31 Oct 2008 01:20:37 +0000 (UTC) (envelope-from davidxu@freebsd.org) Received: from apple.my.domain (root@localhost [127.0.0.1]) by freefall.freebsd.org (8.14.3/8.14.3) with ESMTP id m9V1KavP034493; Fri, 31 Oct 2008 01:20:37 GMT (envelope-from davidxu@freebsd.org) Message-ID: <490A5DD2.8030703@freebsd.org> Date: Fri, 31 Oct 2008 09:22:26 +0800 From: David Xu User-Agent: Thunderbird 2.0.0.9 (X11/20080612) MIME-Version: 1.0 To: info@yourkit.com References: <678291552.20081030201553@yourkit.com> In-Reply-To: <678291552.20081030201553@yourkit.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Cc: freebsd-threads@freebsd.org Subject: Re: getting CPU time for particulat thread X-BeenThere: freebsd-threads@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Threading on FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 31 Oct 2008 01:20:38 -0000 Vladimir Kondratyev wrote: > Hi folks, > > is there any ability to get CPU time consumed by particular thread? > > We are porting YourKit Java Profiler (http://www.yourkit.com) to FreeBSD > platform. Everything works almost fine, but we cannot find a way how to receive > thread CPU times? > > Any help is greatly appreciated. > > Thank you in advance. > > Sincerely, > Vladimir Kondratyev > YourKit, LLC > http://www.yourkit.com > "Don't get lost in data, get information!" > if you just want to get current thread's time, there is a feature in -HEAD branch, call clock_gettime(CLOCK_THREAD_CPUTIME_ID, &ts) to get total cpu time for the current thread. Regards, David Xu