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
|
.\" -*- nroff -*-
.TH DTRACE 1
.SH NAME
dtrace \- Dtrace compatibile user application static probe generation tool.
.SH SYNOPSIS
.br
.B dtrace \-s \fIfile\fR [\fBOPTIONS\fR]
.SH DESCRIPTION
The dtrace command converts probe descriptions defined in \fIfile.d\fR
into a probe header
file via the \fB\-h\fR option
or a probe description file via the \fB\-G\fR option.
.SH OPTIONS
.PP
.TP
.B \-h
generate a systemtap header file.
.TP
.B \-G
generate a systemtap probe definition object file.
.TP
.B \-o \fIfile\fR
is the name of the output file. If the \fB\-G\fR option is given then
the output file will be called \fIfile.o\fR; if the \fB\-h\fR option is
given then the output file will be called \fIfile.h\fR.
.TP
.B \-C
run the cpp preprocessor on the input file when the \fB\-h\fR option
is given.
.TP
.B \-I \fIfile\fR
give this include path to cpp when the \fB\-C\fR option is given.
.TP
.B \-k
keep temporary files, for example the C language source for the
\fB\-G\fR option.
.TP
.B \-\-types
generate probe argument typedef information when the \fB\-h\fR
option is given.
.SH EXAMPLES
Systemtap is source compatible with dtrace user application static
probe support.
Given a file \fItest.d\fR containing:
.RS
.in +2
.nf
provider sdt_probes
{
probe test_0 (int type);
probe test_1 (struct astruct node);
};
struct astruct {int a; int b;};
.fi
.in
.RE
Then the command \fI"dtrace\ \-s\ test.d\ \-G"\fR
will create the probe definition file \fItest.o\fR
and the command \fI"dtrace\ \-s\ test.d\ \-h"\fR
will create the probe header file \fItest.h\fR
Subsequently the application can define probes using
.in +2
.nf
#include "test.h"
\.\.\.
struct astruct s;
\.\.\.
SDT_PROBES_TEST_0(value);
\.\.\.
SDT_PROBES_TEST_1(s);
.fi
.in
The application is linked with \fI"test.o"\fR when it is built.
.SH SEE ALSO
\fBstap(1)\fR
\fBstappaths(7)\fR
|