Date: Wed, 01 Feb 2006 11:20:17 -0800 From: Julian Elischer <julian@elischer.org> To: Daniel Eischen <deischen@freebsd.org> Cc: Ilya E Veretenkin <ilyaver@mail.ru>, freebsd-threads@freebsd.org Subject: Re: getting particular thread cpu time Message-ID: <43E109F1.6020304@elischer.org> In-Reply-To: <Pine.GSO.4.43.0602010829250.7356-100000@sea.ntplx.net> References: <Pine.GSO.4.43.0602010829250.7356-100000@sea.ntplx.net>
next in thread | previous in thread | raw e-mail | index | archive | help
Daniel Eischen wrote: >On Wed, 1 Feb 2006, Ilya E Veretenkin wrote: > > > >>Hello. >>I am writing a multi-threaded application and want to see the cpu >>usage of each thread of this application. >>I know that 'ps -H' outputs cpu usage information for threads, but how >>can I found out the correspondence between particular thread in 'ps-H' >>output and particular thread ID in my application? >> >> > >You can't, unless: > > 1) Every thread is system scope; or > 2) You use libthr where every thread maps 1:1 to a kernel thread > >Even then, I don't know whether CPU usage is maintained correctly >yet by the kernel for a multi-threaded process. Someone has been >working on it recently. > >Libpthread is M:N by default, so the kernel doesn't know about >userland threads. > > though we might think about ways that we can get that information.. maybe a way that the user thread scheduler can be asked for the info?
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?43E109F1.6020304>