Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 16 Feb 2012 22:58:07 +0100
From:      Jilles Tjoelker <jilles@stack.nl>
To:        Christoph Splittgerber <cs@sdata.de>
Cc:        "freebsd-threads@freebsd.org" <freebsd-threads@freebsd.org>
Subject:   Re: How to map a thread-id to a thread-address
Message-ID:  <20120216215806.GA65161@stack.nl>
In-Reply-To: <813D616D-66E4-41BB-9D4C-BB736268B88A@sdata.de>
References:  <813D616D-66E4-41BB-9D4C-BB736268B88A@sdata.de>

next in thread | previous in thread | raw e-mail | index | archive | help
On Thu, Feb 16, 2012 at 03:10:47PM +0100, Christoph Splittgerber wrote:
> Hallo, I hope his is the correct maling list for his:

> I need a per thread overview of CPU time used.

> I found out that a "ps -H -otdaddr,time" gives me exactly this. The
> question now is, how to relate the thread-address printed by the ps
> command to my threads. I did let the program print the thread-ids, and
> the threads stack-address but non of them correlate to the address
> printed by ps.

> I would be grateful for any pointers.

The keyword for the thread ID is lwp, apparently for compatibility with
other OSes.

Alternatively, you can modify your code to set thread names using
pthread_set_name_np() and use the tdnam keyword.

-- 
Jilles Tjoelker



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