This is the mail archive of the
systemtap@sourceware.org
mailing list for the systemtap project.
RE: Finding out thread name
- From: "Cor-Paul Bezemer" <c dot bezemer at tudelft dot nl>
- To: "'Frank Ch. Eigler'" <fche at redhat dot com>
- Cc: <systemtap at sourceware dot org>
- Date: Thu, 9 May 2013 09:46:49 +0200
- Subject: RE: Finding out thread name
- References: <1368025448212-231050 dot post at n7 dot nabble dot com> <y0mtxmd5uyy dot fsf at fche dot csb>
This actually works. I was under the impression that /proc/$$/.../comm holds
the python thread name, but this is of course not the case (as the process
was started as 'python', resulting in many threads with that name).
Thanks for clearing the confusion!
--CP
-----Original Message-----
From: Frank Ch. Eigler [mailto:fche@redhat.com]
Sent: woensdag 8 mei 2013 17:53
To: corpaul
Cc: systemtap@sourceware.org
Subject: Re: Finding out thread name
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