Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Newer
Older
100644 62 lines (55 sloc) 3.306 kb
4c7465f @davepacheco initial commit
authored
1 # portsnoop: trace event port activity
2
3 portsnoop is a DTrace script to trace event port activity on illumos-based
4 systems. It traces:
5
6 * port\_get or port\_getn when either one fails or returns at least 1 event
7 * the first 30 events returned by each port\_get or port\_getn invocation
8 * all calls to port\_associate and port\_dissociate
9 * calls to read, write, accept, or close between a returned event and a call
10 to port\_associate for the same file descriptor
11
12 There are probably useful cases that are missing. Contributions welcome.
13
14 Here's an example of watching Node.js:
15
16 TIME TID SYSCALL FD DETAILS ERROR
17 12.208422 1 port_associate 6 0x01
18 12.242194 1 port_associate 9 0x01
19 12.255736 1 port_getn - 1 events
20 12.274277 1 PORT_SOURCE_FD 9 fdevents 0x01
21 12.328980 1 read 9 = 385
22 12.271295 1 port_associate 9 0x01
23 12.288007 1 port_getn - 1 events
24 12.298038 1 PORT_SOURCE_FD 4 fdevents 0x01
25 12.328153 1 read 4 = 1
26 12.629188 1 port_associate 4 0x01
27 12.645012 1 port_getn - 1 events
28 12.654589 1 PORT_SOURCE_FD 4 fdevents 0x01
29 12.682737 1 read 4 = 1
30 12.416725 1 port_associate 4 0x01
31 12.432715 1 port_getn - 1 events
32 12.442648 1 PORT_SOURCE_FD 4 fdevents 0x01
33 12.471463 1 read 4 = 1
34 12.508922 1 port_associate 4 0x01
35 12.521278 1 port_getn - 1 events
36 12.528865 1 PORT_SOURCE_FD 4 fdevents 0x01
37 12.553993 1 read 4 = 1
38 12.574697 1 port_associate 4 0x01
39 12.822090 1 port_getn - 1 events
40 12.831173 1 PORT_SOURCE_FD 6 fdevents 0x01
41 12.869254 1 accept 6 = 11
42 12.088036 1 accept 6 = -1 (errno = 11)
43 12.125804 1 port_associate 6 0x01
44 12.149611 1 port_associate 11 0x01
45 13.033215 1 port_getn - 1 events
46 13.043168 1 PORT_SOURCE_FD 6 fdevents 0x01
47 13.078822 1 accept 6 = 12
48 13.145472 1 accept 6 = 23
49 13.194127 1 accept 6 = -1 (errno = 11)
50 13.225361 1 port_associate 6 0x01
51 13.248414 1 port_associate 12 0x01
52 13.269476 1 port_associate 23 0x01
53 13.310552 1 port_getn - 1 events
54 13.320322 1 PORT_SOURCE_FD 6 fdevents 0x01
55 13.353921 1 accept 6 = 30
56 13.431817 1 accept 6 = 37
57 13.478750 1 accept 6 = -1 (errno = 11)
58 13.510167 1 port_associate 6 0x01
59 13.533580 1 port_associate 30 0x01
60 13.554498 1 port_associate 37 0x01
61
Something went wrong with that request. Please try again.