This is the mail archive of the systemtap@sourceware.org mailing list for the systemtap project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

RE: Finding out thread name


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]