dtrace Command Options
The dtrace command accepts the following options:
dtrace [-32 | -64] [-CeFGHhlqSvVwZ] [-b bufsz] [-c cmd] [-D name[=value]]
[-I path] [-L path] [-o output] [-p pid] [-s script] [-U name]
[-x opt[=val]] [-X a | c | s | t]
[-P provider [[predicate] action]]
[-m [provider:] module [[predicate] action]]
[-f [[provider:] module:] function [[predicate] action]]
[-n [[[provider:] module:] function:] name [[predicate] action]]
[-i probe-id [[predicate] action]]
where predicate is any D predicate inside slashes
// and action is any D
statement list inside braces {}, according to the D language
syntax.
The arguments accepted by the -P, -m,
-f, -n, and -i options can
include an optional D language predicate inside
slashes // and optional D language action
statement list inside braces {}. D program code specified on the
command line must be appropriately quoted to avoid interpretation of metacharacters
by the shell.
The following options are available:
-
-32 | -64 -
Sets whether to generate 32-bit or 64-bit D programs and ELF files. This option isn't usually required as
dtraceselects the native data model as the default. -
-b bufsz -
Set principal trace buffer size (
bufsz). The trace buffer size can include any of the size suffixesk,m,g, ort. If the buffer space can't be allocated,dtracetries to reduce the buffer size or exit depending on the setting of thebufresizeproperty. -
-c cmd -
Run the specified command
cmdand exit upon its completion. If more than one-coption is present on the command line,dtraceexits when all commands have exited, reporting the exit status for each child process as it ends. The process-ID of the first command is made available to any D programs specified on the command line or using the-soption through the$targetmacro variable. -
-C -
Run the C preprocessor (
cpp) over D programs before compiling them. You can pass options to the C preprocessor using the-D,-U,-I, and-Hoptions. You can select the degree of C standard conformance if you use the-Xoption. For a description of the set of tokens defined by the D compiler when invoking the C preprocessor, see-X. -
-D name[=value] -
Define name when invoking cpp (enabled using the
-Coption). If you specify the equals sign (=) and optional value, the name is assigned the corresponding value. This option passes the-Doption to eachcppinvocation. -
-e -
Exit after compiling any requests, but before enabling any probes. You can combine this option with D compiler options. This combination verifies that the programs compile without executing them and enabling the corresponding instrumentation.
-
-f [[provider:]module:]function[[predicate]action]] -
Specify function name to trace or list (
-loption). The corresponding argument can include any of the probe description formsprovider:module:function,module:function, orfunction. Unspecified probe description fields are blank and match any probes regardless of the values in those fields. If no qualifiers other thanfunctionare specified in the description, all probes with the correspondingfunctionare matched. The-fargument can be suffixed with an optional D probe clause. You can specify more than one-foption on the command line at a time. -
-F -
Coalesce trace output by identifying function entry and return. Function entry probe reports are indented and their output is prefixed with
->. Function return probe reports are unindented and their output is prefixed with<-. System call entry probe reports are indented and their output is prefixed with=>. System call return probe reports are unindented and their output is prefixed with<=. -
-G -
Generate an ELF file containing an embedded DTrace program. The DTrace probes specified in the program are saved inside a relocatable ELF object which can be linked into another program. If the
-ooption is present, the ELF file is saved using the path name specified as the argument for this operand. If the-ooption isn't present and the DTrace program is contained with a file whose name isfilename.d, then the ELF file is saved using the namefilename.o. Otherwise the ELF file is saved using the named.out. -
-H -
Print the path names of included files when invoking
cpp(enabled using the-Coption). This option passes the-Hoption to eachcppinvocation, causing it to display the list of path names, one for each line, tostderr. -
-h -
Generate a header file containing macros that correspond to probes in the specified provider definitions. This option can generate a header file that's included by other source files for later use with the
-Goption. If the-ooption is present, the header file is saved using the path name specified as the argument for that option. If the-ooption isn't present and the DTrace program is contained with a file whose name isfilename.d, then the header file is saved using the namefilename.h. -
-i probe-id [[predicate] action] -
Specify probe identifier (
probe-id) to trace or list (-loption). You can specify probe IDs using decimal integers as shown bydtrace-l. The-iargument can be suffixed with an optional D probe clause. You can specify more than one-ioption at a time. -
-I path -
Add the specified directory
pathto the search path for#includefiles when invokingcpp(enabled using the-Coption). This option passes the-Ioption to eachcppinvocation. The specifiedpathis inserted into the search path ahead of the default directory list. -
-l -
List probes instead of enabling them. If the
-loption is specified,dtraceproduces a report of the probes matching the descriptions provided using the-P,-m,-f,-n,-i, and-soptions. If none of these options are specified, this option lists all probes. -
-L -
Add the specified directory
pathto the search path for DTrace libraries. DTrace libraries are used to contain common definitions that can be used when writing D programs. The specifiedpathis added after the default library search path. If it exists, a subdirectory ofpathnamed after the minor version of the running kernel (for example, 3.8) is searched immediately beforepath. Dependency analysis is performed only within each directory, not across directories. -
-m [[provider:] module: [[predicate] action]] -
Specify module name to trace or list (
-loption). The corresponding argument can include any of the probe description formsprovider:moduleormodule. Unspecified probe description fields are blank and match any probes regardless of the values in those fields. If no qualifiers other thanmoduleare specified in the description, all probes with a correspondingmoduleare matched. The-margument can be suffixed with an optional D probe clause. More than one-moption can be specified on the command line at a time. -
-n [[[provider:] module:] function:] name [[predicate] action] -
Specify probe name to trace or list (
-loption). The corresponding argument can include any of the probe description formsprovider:module:function:name,module:function:name,function:name, orname. Unspecified probe description fields are blank and match any probes regardless of the values in those fields. If no qualifiers other thannameare specified in the description, all probes with a correspondingnameare matched. The-nargument can be suffixed with an optional D probe clause. More than one-noption can be specified on the command line at a time. -
-o output -
Specify the
outputfile for the-G,-h, and-loptions, or for the traced data itself. If the-Goption is present and the-soption's argument is of the formfilename.dand-oisn't present, the default output file isfilename.o. Otherwise the default output file isd.out. -
-p pid -
Grab the specified process-ID
pid, cache its symbol tables, and exit upon its completion. If more than one-poption is present on the command line,dtraceexits when all commands have exited, reporting the exit status for each process as it ends. The first process-ID is made available to any D programs specified on the command line or using the-soption through the$targetmacro variable. -
-P provider[[predicate]action] -
Specify provider name to trace or list (
-loption). The remaining probe description fields module, function, and name are blank and match any probes regardless of the values in those fields. The-Pargument can be suffixed with an optional D probe clause. You can specify more than one-Poption on the command line at a time. -
-q -
Set quiet mode.
dtracesuppresses messages such as the number of probes matched by the specified options and D programs and doesn't print column headers, the CPU ID, the probe ID, or insert newlines into the output. Only data traced and formatted by D program statements such astrace()andprintf()is displayed tostdout. -
-s -
Compile the specified D program source file. If the
-eoption is present, the program is compiled but instrumentation isn't enabled. If the-loption is present, the program is compiled and the set of probes matched by it, is listed but instrumentation isn't enabled. If none of-e,-l, or-Gare present, the instrumentation specified by the D program is enabled and tracing begins. -
-S -
Show D compiler intermediate code. The D compiler produces a report of the intermediate code generated for each D program to
stderr. -
-U name -
Undefine the specified
namewhen invokingcpp(enabled using the-Coption). This option passes the-Uoption to eachcppinvocation. -
-v -
Set verbose mode. If the
-voption is specified,dtraceproduces a program stability report showing the minimum interface stability and dependency level for the specified D programs. -
-V -
Report the highest D programming interface for
dtrace. The version information is printed tostdoutand thedtracecommand exits. When used with-v, also reports information on the version of thedtraceand associated library. -
-w -
Permit destructive actions in D programs specified using the
-s,-P,-m,-f,-n, or-ioptions. If the-woption isn't specified,dtracedoesn't permit the compilation or enabling of a D program that contains destructive actions. -
-x opt[=val] -
Enable or change a DTrace runtime option or D compiler option. Boolean options are enabled by specifying their name. Options with values are set by separating the option name and value with an equals sign (
=). See DTrace Runtime and Compile-time Options Reference. -
-X a | c | s | t -
Sets the ISO C conformance settings for the preprocessor. The options are:
-
a | c | t: Any of these options sets the conformance to-std=c99. This is the default. -
s: This option sets the conformance to-traditional-cpp.
-
-
-Z -
Permit probe descriptions that match zero probes. If the
-Zoption isn't specified,dtracereports an error and exits if any probe descriptions specified in D program files (-soption) or on the command line (-P,-m,-f,-n, or-ioptions) contain descriptions that don't match any known probes.