• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1// Copyright Joyent, Inc. and other Node contributors.
2//
3// Permission is hereby granted, free of charge, to any person obtaining a
4// copy of this software and associated documentation files (the
5// "Software"), to deal in the Software without restriction, including
6// without limitation the rights to use, copy, modify, merge, publish,
7// distribute, sublicense, and/or sell copies of the Software, and to permit
8// persons to whom the Software is furnished to do so, subject to the
9// following conditions:
10//
11// The above copyright notice and this permission notice shall be included
12// in all copies or substantial portions of the Software.
13//
14// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
15// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
16// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN
17// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
18// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
19// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
20// USE OR OTHER DEALINGS IN THE SOFTWARE.
21
22probe node_net_server_connection = process("node").mark("net__server__connection")
23{
24  remote = user_string($arg2);
25  port = $arg3;
26  fd = $arg4;
27
28  probestr = sprintf("%s(remote=%s, port=%d, fd=%d)",
29    $$name,
30    remote,
31    port,
32    fd);
33}
34
35probe node_net_stream_end = process("node").mark("net__stream__end")
36{
37  remote = user_string($arg2);
38  port = $arg3;
39  fd = $arg4;
40
41  probestr = sprintf("%s(remote=%s, port=%d, fd=%d)",
42    $$name,
43    remote,
44    port,
45    fd);
46}
47
48probe node_http_server_request = process("node").mark("http__server__request")
49{
50  remote = user_string($arg3);
51  port = $arg4;
52  method = user_string($arg5);
53  url = user_string($arg6);
54  fd = $arg7;
55
56  probestr = sprintf("%s(remote=%s, port=%d, method=%s, url=%s, fd=%d)",
57    $$name,
58    remote,
59    port,
60    method,
61    url,
62    fd);
63}
64
65probe node_http_server_response = process("node").mark("http__server__response")
66{
67  remote = user_string($arg2);
68  port = $arg3;
69  fd = $arg4;
70
71  probestr = sprintf("%s(remote=%s, port=%d, fd=%d)",
72    $$name,
73    remote,
74    port,
75    fd);
76}
77
78probe node_http_client_request = process("node").mark("http__client__request")
79{
80  remote = user_string($arg3);
81  port = $arg4;
82  method = user_string($arg5);
83  url = user_string($arg6);
84  fd = $arg7;
85
86  probestr = sprintf("%s(remote=%s, port=%d, method=%s, url=%s, fd=%d)",
87    $$name,
88    remote,
89    port,
90    method,
91    url,
92    fd);
93}
94
95probe node_http_client_response = process("node").mark("http__client__response")
96{
97  remote = user_string($arg2);
98  port = $arg3;
99  fd = $arg4;
100
101  probestr = sprintf("%s(remote=%s, port=%d, fd=%d)",
102    $$name,
103    remote,
104    port,
105    fd);
106}
107
108probe node_gc_start = process("node").mark("gc__start")
109{
110  scavenge = 1 << 0;
111  compact = 1 << 1;
112
113  if ($arg1 == scavenge)
114    type = "kGCTypeScavenge";
115  else if ($arg1 == compact)
116    type = "kGCTypeMarkSweepCompact";
117  else
118    type = "kGCTypeAll";
119
120  flags = $arg2;
121
122  probestr = sprintf("%s(type=%s,flags=%d)",
123    $$name,
124    type,
125    flags);
126}
127
128probe node_gc_stop = process("node").mark("gc__done")
129{
130  scavenge = 1 << 0;
131  compact = 1 << 1;
132
133  if ($arg1 == scavenge)
134    type = "kGCTypeScavenge";
135  else if ($arg1 == compact)
136    type = "kGCTypeMarkSweepCompact";
137  else
138    type = "kGCTypeAll";
139
140  flags = $arg2;
141
142  probestr = sprintf("%s(type=%s,flags=%d)",
143    $$name,
144    type,
145    flags);
146}
147