Debian Codegraph @

testsuite/systemtap.examples/lwtools/accept2close-nd.txt

raw
1 Examples of accept2close-nd.stp, the Linux SystemTap version.
2
3
4 This shows accepted socket lifespans, by measuring the time from syscall
5 accept() to close() on the same file descriptor. Sessions are printed as they
6 occur, and a histogram summary is printed at the end. For example:
7
8 # ./accept2close-nd.stp
9 TIME PID COMM FD DURATION
10 Sat Jan 31 05:31:14 2015 29042 node 11 1 ms
11 Sat Jan 31 05:31:15 2015 29042 node 11 1 ms
12 Sat Jan 31 05:31:15 2015 29042 node 11 1 ms
13 Sat Jan 31 05:31:15 2015 29042 node 11 1 ms
14 Sat Jan 31 05:31:15 2015 29042 node 11 1 ms
15 Sat Jan 31 05:31:15 2015 29042 node 11 1 ms
16 Sat Jan 31 05:31:15 2015 29042 node 11 1 ms
17 Sat Jan 31 05:31:15 2015 29042 node 11 1 ms
18 Sat Jan 31 05:31:15 2015 29042 node 11 1 ms
19 Sat Jan 31 05:31:15 2015 29042 node 11 1 ms
20 Sat Jan 31 05:31:15 2015 29042 node 11 1 ms
21 Sat Jan 31 05:31:15 2015 29042 node 11 1 ms
22 Sat Jan 31 05:31:15 2015 29042 node 11 2 ms
23 Sat Jan 31 05:31:15 2015 29042 node 11 3 ms
24 Sat Jan 31 05:31:15 2015 29042 node 11 2 ms
25 Sat Jan 31 05:31:15 2015 29042 node 11 1 ms
26 Sat Jan 31 05:31:15 2015 29042 node 11 1 ms
27 Sat Jan 31 05:31:15 2015 29042 node 11 1 ms
28 Sat Jan 31 05:31:15 2015 29042 node 11 1 ms
29 [...]
30 Duration (ns):
31 value |-------------------------------------------------- count
32 131072 | 0
33 262144 | 0
34 524288 | 1
35 1048576 |@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ 138
36 2097152 |@@ 6
37 4194304 | 1
38 8388608 | 0
39 16777216 | 0
40
41 Most of these sessions were between 1 and 2 milliseconds in lifespan.
42
43 The socket lifespan is expected to represent the time taken by a server to
44 respond to a request. This time may include cycles on-CPU, and cycles off-CPU
45 blocked on another resource. Note that HTTP keep-alive sessions may have long
46 durations which process multiple requests.
47
48
49 accept2close-nd.stp accepts an optional argument: a minimum lifespan threshold
50 in milliseconds. For example, socket sessions that are 5 milliseconds and
51 longer:
52
53 # ./accept2close-nd.stp 5
54 Only tracing events slower than 5 ms.
55 TIME PID COMM FD DURATION
56 Sat Jan 31 05:36:23 2015 5236 node 11 5 ms
57 Sat Jan 31 05:37:39 2015 5236 node 11 5 ms
58 Sat Jan 31 05:37:50 2015 5236 node 11 9 ms
59 Sat Jan 31 05:38:09 2015 5236 node 11 7 ms
60 ^C
61 Duration (ns):
62 value |-------------------------------------------------- count
63 1048576 | 0
64 2097152 | 0
65 4194304 |@@@ 3
66 8388608 |@ 1
67 16777216 | 0
68 33554432 | 0