The data contained in this repository can be downloaded to your computer using one of several clients.
Please see the documentation of your version control software client for more information.

Please select the desired protocol below to get the URL.

This URL has Read-Only access.

Statistics
| Branch: | Revision:

main_repo / src / node_systemtap.d @ 06810b29

History | View | Annotate | Download (2.35 KB)

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

    
22
// Hints:
23
// This .d defines compiled in probes
24
//     probes are handles (untyped pointers)
25
//     v8 forward declared objs (dtrace_connection_t) are defined
26
//     in node_dtrace.cc which builds an InitDtrace object which
27
//     gets populated with the probes
28
//     The probes gather the following:
29
//     PROBE_REQUEST(req, fd, remote, port, buffered)
30
//     PROBE_OTHER(fd, remote, port, buffered)
31
// other notes:
32
//     using any PROBE_ENABLED() macros in dtrace.cc sdt broke it
33
//     can only pass strings/ints/primitives not dtrace_connection_t
34
//          conn or other structs
35
//     verify probe existence by using
36
//          $ stap -l 'process("out/Release/node").mark("*")'
37
// TODO: write .stp scripts (node.stp, node_v8ustack.stp + ???)
38

    
39

    
40
provider node {
41
    probe http__client__request(string, int, string, int, int);
42
    probe http__client__response(int, string, int, int);
43
    probe http__server__request(string, int, string, int, int);
44
    probe http__server__response(int, string, int, int);
45
    probe net__server__connection(int, string, int, int);
46
    probe net__socket__read(int, string, int, int);
47
    probe net__socket__write(int, string, int, int);
48
    probe net__stream__end(int, string, int, int);
49
    probe gc__done();
50
    probe gc__start();
51
};