Sexy truss and pstack additions

Now I know I'm becoming a bit of an old man and my definition of sexy my be getting a tad sad, but Adam Leventhal has recently made some changes in build 63 to truss(1) and pstack(1) that have got me strangely excited for a friday night.

Now I know that DTrace meets our every need but it's nice to see some of the old tools getting some nice new additions. Good old truss(1) and pstack(1) have now been made to operate on individual threads. Hurraahh!! If you've ever tried to use these tools on processes with 100's or even 1000's of threads then you'll be cheering to. Let's see them in action on the mildly threaded nscd(1M).
# pstack `pgrep nscd` | grep -c "lwp#"
24
# pstack `pgrep nscd`/13-14
100203: /usr/sbin/nscd
-----------------  lwp# 13 / thread# 13  --------------------
 ff1be628 nanosleep (fe57bed8, fe57bed0)
 00019334 reap_hash (79a30, 30258, 2e648, ad, 0, 0) + 11c
 00012400 nsc_reaper (2f0d0, 79a30, 30258, 2e648, 0, 2e400) + 48
 ff1be3ec _lwp_start (0, 0, 0, 0, 0, 0)
-----------------  lwp# 14 / thread# 14  --------------------
 ff1be628 nanosleep (fe47bed8, fe47bed0)
 00019334 reap_hash (79a48, 30258, 2e648, ad, 0, 0) + 11c
 00012400 nsc_reaper (2f0d8, 79a48, 30258, 2e648, 0, 2e400) + 48
 ff1be3ec _lwp_start (0, 0, 0, 0, 0, 0)

# truss -p `pgrep nscd`/13-14
/13:    nanosleep(0xFE57BED8, 0xFE57BED0) (sleeping...)
/14:    nanosleep(0xFE47BED8, 0xFE47BED0) (sleeping...)
Marvellous. So we have 24 threads in total but just look at two of them, 13 and 14. Never again will you have to wade through screenfuls of output trying to correlate the output of individual threads. Like I said before though - you'd obviously do it in DTrace but just for one of your off days you've got a nice backup.

Additions like this may seem small but they add to the quality of life no end. Check out Adams blog for more discussions on other nice additions coming your way in Solaris 10 . The build 63 additions I've mentioned here will be hitting the streets as part of the Software Express for Solaris program in August.
Comments:

Jon, while I'd love to take credit for the sexiness of per-thread ptools, Eric Schrock actually did the heavy lifting -- I just asked him to do it.

Posted by Adam Leventhal on July 17, 2004 at 10:42 PM GMT+00:00 #

Post a Comment:
Comments are closed for this entry.
About

jonh

Search

Categories
Archives
« April 2014
MonTueWedThuFriSatSun
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
    
       
Today