]>
Commit | Line | Data |
---|---|---|
4e6d866f | 1 | .\" -*- nroff -*- |
ec1a2239 | 2 | .TH DTRACE 1 |
4e6d866f SC |
3 | .SH NAME |
4 | dtrace \- Dtrace compatibile user application static probe generation tool. | |
5 | ||
6 | .SH SYNOPSIS | |
7 | ||
8 | .br | |
9 | .B dtrace \-s \fIfile\fR [\fBOPTIONS\fR] | |
10 | ||
11 | .SH DESCRIPTION | |
12 | ||
13 | The dtrace command converts probe descriptions defined in \fIfile.d\fR | |
14 | into a probe header | |
f7470174 JS |
15 | file via the \fB\-h\fR option |
16 | or a probe description file via the \fB\-G\fR option. | |
4e6d866f SC |
17 | |
18 | .SH OPTIONS | |
19 | .PP | |
20 | .TP | |
21 | .B \-h | |
22 | generate a systemtap header file. | |
23 | ||
24 | .TP | |
25 | .B \-G | |
26 | generate a systemtap probe definition object file. | |
27 | ||
28 | .TP | |
29 | .B \-o \fIfile\fR | |
30 | is the name of the output file. If the \fB\-G\fR option is given then | |
f7470174 | 31 | the output file will be called \fIfile.o\fR; if the \fB\-h\fR option is |
4e6d866f SC |
32 | given then the output file will be called \fIfile.h\fR. |
33 | ||
34 | .TP | |
35 | .B \-C | |
36 | run the cpp preprocessor on the input file when the \fB\-h\fR option | |
37 | is given. | |
38 | ||
39 | .TP | |
40 | .B \-I \fIfile\fR | |
41 | give this include path to cpp when the \fB\-C\fR option is given. | |
42 | ||
43 | .TP | |
44 | .B \-k | |
45 | keep temporary files, for example the C language source for the | |
46 | \fB\-G\fR option. | |
47 | ||
48 | .TP | |
49 | .B \-\-types | |
50 | generate probe argument typedef information when the \fB\-h\fR | |
51 | option is given. | |
52 | ||
53 | .SH EXAMPLES | |
54 | ||
55 | Systemtap is source compatible with dtrace user application static | |
56 | probe support. | |
57 | Given a file \fItest.d\fR containing: | |
58 | .RS | |
59 | .in +2 | |
60 | .nf | |
61 | provider sdt_probes | |
62 | { | |
63 | probe test_0 (int type); | |
64 | probe test_1 (struct astruct node); | |
65 | }; | |
66 | struct astruct {int a; int b;}; | |
67 | .fi | |
68 | .in | |
69 | .RE | |
f7470174 | 70 | Then the command \fI"dtrace\ \-s\ test.d\ \-G"\fR |
4e6d866f | 71 | will create the probe definition file \fItest.o\fR |
f7470174 | 72 | and the command \fI"dtrace\ \-s\ test.d\ \-h"\fR |
4e6d866f SC |
73 | will create the probe header file \fItest.h\fR |
74 | Subsequently the application can define probes using | |
75 | .in +2 | |
76 | .nf | |
77 | #include "test.h" | |
78 | \.\.\. | |
79 | struct astruct s; | |
80 | \.\.\. | |
81 | SDT_PROBES_TEST_0(value); | |
82 | \.\.\. | |
83 | SDT_PROBES_TEST_1(s); | |
84 | .fi | |
85 | .in | |
86 | ||
87 | The application is linked with \fI"test.o"\fR when it is built. | |
88 | ||
89 | .SH SEE ALSO | |
90 | ||
91 | \fBstap(1)\fR | |
ec1a2239 | 92 | \fBstappaths(7)\fR |
4e6d866f | 93 |