* pthread_setname_np and ps on Digital UNIX 4.0D
@ 1998-03-07 5:00 Laurent Deniel
1998-03-09 5:00 ` Dave Butenhof
0 siblings, 1 reply; 2+ messages in thread
From: Laurent Deniel @ 1998-03-07 5:00 UTC (permalink / raw)
Hi,
Is there a way to display the name of a thread (specified thanks
to the function pthread_setname_np) in commands such a ps ?
(in order to quickly see the behavior of a well-known thread).
If it is not possible with Digital UNIX's ps, someone may
have hacked some interesting similar utilities that display
such thread informations ?
Thanks in advance,
Laurent.
--
Laurent DENIEL | E-mail: deniel@worldnet.fr
Paris, FRANCE | deniel@fr.airsysatm.thomson-csf.com
| WWW : http://www.worldnet.fr/~deniel
All above opinions are personal, unless stated otherwise.
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: pthread_setname_np and ps on Digital UNIX 4.0D
1998-03-07 5:00 pthread_setname_np and ps on Digital UNIX 4.0D Laurent Deniel
@ 1998-03-09 5:00 ` Dave Butenhof
0 siblings, 0 replies; 2+ messages in thread
From: Dave Butenhof @ 1998-03-09 5:00 UTC (permalink / raw)
To: Laurent Deniel
Laurent Deniel wrote:
> Is there a way to display the name of a thread (specified thanks
> to the function pthread_setname_np) in commands such a ps ?
> (in order to quickly see the behavior of a well-known thread).
> If it is not possible with Digital UNIX's ps, someone may
> have hacked some interesting similar utilities that display
> such thread informations ?
The ps command is a utility to show system information, and this would be
getting into an entirely different level of process information. It would,
arguably, be "inappropriate" to do this in ps. In any case, the decision
was made long ago to not do as you suggest.
The easiest way to get this information is to attach to the process with
ladebug (or another suitable user-level-thread-enabled debugger) and ask
for the information. (E.g., ladebug's "show thread" command.)
While one certainly could create a standalone utility, you'd need to find
the binary associated with the process, look up symbols, use /proc (or
equivalent) to access process memory, and so forth -- sounds a lot like a
debugger, doesn't it?
The mechanism used to access this information is in libpthreaddebug.so. As
of 4.0D, the associated header file, <pthread_debug.h> is available on the
standard OS kit (with the other development header files). Although it's
not externally documented, it's heavily commented, and reasonably
self-describing.
/---------------------------[ Dave Butenhof ]--------------------------\
| Digital Equipment Corporation butenhof@zko.dec.com |
| 110 Spit Brook Rd ZKO2-3/Q18 http://members.aol.com/drbutenhof |
| Nashua NH 03062-2698 http://www.awl.com/cseng/titles/0-201-63392-2/ |
\-----------------[ Better Living Through Concurrency ]----------------/
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~1998-03-09 5:00 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
1998-03-07 5:00 pthread_setname_np and ps on Digital UNIX 4.0D Laurent Deniel
1998-03-09 5:00 ` Dave Butenhof
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox