summaryrefslogtreecommitdiff
path: root/src/node.stp
blob: 466f892de265cd549adb33369456356373fba21b (plain)
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
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
probe node_net_server_connection = process("node").mark("net__server__connection")
{
  remote = user_string($arg2);
  port = $arg3;
  fd = $arg4;

  probestr = sprintf("%s(remote=%s, port=%d, fd=%d)",
    $$name,
    remote,
    port,
    fd);
}

probe node_net_stream_end = process("node").mark("net__stream__end")
{
  remote = user_string($arg2);
  port = $arg3;
  fd = $arg4;

  probestr = sprintf("%s(remote=%s, port=%d, fd=%d)",
    $$name,
    remote,
    port,
    fd);
}

probe node_http_server_request = process("node").mark("http__server__request")
{
  remote = user_string($arg3);
  port = $arg4;
  method = user_string($arg5);
  url = user_string($arg6);
  fd = $arg7;

  probestr = sprintf("%s(remote=%s, port=%d, method=%s, url=%s, fd=%d)",
    $$name,
    remote,
    port,
    method,
    url,
    fd);
}

probe node_http_server_response = process("node").mark("http__server__response")
{
  remote = user_string($arg2);
  port = $arg3;
  fd = $arg4;

  probestr = sprintf("%s(remote=%s, port=%d, fd=%d)",
    $$name,
    remote,
    port,
    fd);
}

probe node_http_client_request = process("node").mark("http__client__request")
{
  remote = user_string($arg3);
  port = $arg4;
  method = user_string($arg5);
  url = user_string($arg6);
  fd = $arg7;

  probestr = sprintf("%s(remote=%s, port=%d, method=%s, url=%s, fd=%d)",
    $$name,
    remote,
    port,
    method,
    url,
    fd);
}

probe node_http_client_response = process("node").mark("http__client__response")
{
  remote = user_string($arg2);
  port = $arg3;
  fd = $arg4;

  probestr = sprintf("%s(remote=%s, port=%d, fd=%d)",
    $$name,
    remote,
    port,
    fd);
}

probe node_gc_start = process("node").mark("gc__start")
{
  scavenge = 1 << 0;
  compact = 1 << 1;

  if ($arg1 == scavenge)
    type = "kGCTypeScavenge";
  else if ($arg1 == compact)
    type = "kGCTypeMarkSweepCompact";
  else
    type = "kGCTypeAll";

  flags = $arg2;

  probestr = sprintf("%s(type=%s,flags=%d)",
    $$name,
    type,
    flags);
}

probe node_gc_stop = process("node").mark("gc__stop")
{
  scavenge = 1 << 0;
  compact = 1 << 1;

  if ($arg1 == scavenge)
    type = "kGCTypeScavenge";
  else if ($arg1 == compact)
    type = "kGCTypeMarkSweepCompact";
  else
    type = "kGCTypeAll";

  flags = $arg2;

  probestr = sprintf("%s(type=%s,flags=%d)",
    $$name,
    type,
    flags);
}