This is the mail archive of the
systemtap@sourceware.org
mailing list for the systemtap project.
Re: Finding out thread name
- From: fche at redhat dot com (Frank Ch. Eigler)
- To: corpaul <c dot bezemer at tudelft dot nl>
- Cc: systemtap at sourceware dot org
- Date: Wed, 08 May 2013 11:53:25 -0400
- Subject: Re: Finding out thread name
- References: <1368025448212-231050 dot post at n7 dot nabble dot com>
corpaul <c.bezemer@tudelft.nl> writes:
> [...]
> This is probably very easy to solve but I cannot seem to find how to do this
> I would like to get the name of a thread from a tid().
> [...]
It's not as simple as it appears. When answering a /proc/$$/.../comm
request, the kernel can lock the task list and do such lookups safely
(if slowly). From the context of an arbitrary systemtap probe, we
can't do that. (From the context of a custom guru-mode systemtap
script, sure.)
By the way, is this what you tried? What happened?
probe foo {
/* do something with */ task_execname(pid2task(pid))
}
- FChE