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


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]