1 The following is an example of the statsnoop tool.
4 statsnoop is a companion to opensnoop, which traces a variety of stat()
5 calls rather than open() calls.
7 Here I run statsnoop on my idle laptop for about 3 seconds,
11 0 1485 dtrace 0 /devices/pseudo/pts@0:6
12 100 791 dtwm -1 /usr/mail/brendan
13 100 791 dtwm -1 /usr/mail/brendan
14 100 791 dtwm -1 /usr/mail/brendan
15 100 791 dtwm -1 /usr/mail/brendan
16 100 795 sdtperfmeter 0 /devices/pseudo/mm@0:null
17 0 803 rpc.rstatd 0 /devices/pseudo/udp@0:udp
18 0 803 rpc.rstatd 0 /devices/pseudo/udp@0:udp
19 100 795 sdtperfmeter 0 /devices/pseudo/mm@0:null
20 100 791 dtwm 0 /export/home/brendan/.dt/Trash/.trashinfo
21 100 791 dtwm 0 /export/home/brendan/.dt/Trash/.trashinfo
22 100 791 dtwm 0 /devices/pseudo/mm@0:null
23 100 783 ttsession 0 /devices/pseudo/pts@0:3
24 100 783 ttsession 0 /devices/pseudo/pts@0:3
25 100 783 ttsession 0 /devices/pseudo/pts@0:3
26 100 791 dtwm 0 /devices/pseudo/mm@0:null
27 100 783 ttsession 0 /devices/pseudo/pts@0:3
28 100 783 ttsession 0 /devices/pseudo/pts@0:3
29 100 791 dtwm 0 /devices/pseudo/mm@0:null
30 100 791 dtwm 0 /devices/pseudo/mm@0:null
31 100 792 dtfile 0 /devices/pseudo/mm@0:null
32 100 783 ttsession 0 /devices/pseudo/pts@0:3
35 It is interesting what turns up. In the above output, a "dtwm" process
36 with process ID 791 called stat on /usr/mail/brendan and received -1 as
37 a return value - as this file does not exist. (when were mailboxes ever
38 stored in /usr/mail??).
41 statsnoop has a variety of options, as opensnoop does. Here I trace stat()s
42 from processes called "bash", while a new bash shell is executed,
46 100 1493 bash 0 /usr/bin/bash
47 100 1493 bash 0 /devices/pseudo/pts@0:8
48 100 1493 bash 0 /lib/libcurses.so.1
49 100 1493 bash 0 /lib/libsocket.so.1
50 100 1493 bash 0 /lib/libnsl.so.1
51 100 1493 bash 0 /lib/libdl.so.1
52 100 1493 bash 0 /lib/libc.so.1
53 100 1493 bash 0 /devices/pseudo/pts@0:8
54 100 1493 bash 0 /devices/pseudo/pts@0:8
55 100 1493 bash 0 /export/home/brendan
57 100 1493 bash 0 /export/home/brendan/.bashrc
58 100 1493 bash -1 /usr/mail/brendan
59 100 1493 bash 0 /export/home/brendan/.bash_history
60 100 1493 bash 0 /export/home/brendan/.bash_history
61 100 1493 bash 0 /export/home/brendan/.bash_history
62 100 1493 bash -1 /export/home/brendan/.inputrc
66 bash also checked /usr/mail/brendan? hmm...
74 # This is the default standard profile provided to a user.
75 # They are expected to edit it to meet their own needs.
77 MAIL=/usr/mail/${LOGNAME:?}
81 $ cat /etc/skel/.profile
82 # This is the default standard profile provided to a user.
83 # They are expected to edit it to meet their own needs.
85 MAIL=/usr/mail/${LOGNAME:?}
87 $ cat /var/sadm/pkg/SUNWcsr/save/pspool/SUNWcsr/reloc/etc/skel/.profile
88 # This is the default standard profile provided to a user.
89 # They are expected to edit it to meet their own needs.
91 MAIL=/usr/mail/${LOGNAME:?}