xref: /freebsd/cddl/contrib/opensolaris/cmd/dtrace/dtrace.1 (revision 946497ec23fd22c9048a078a223fcfe3609ef9c7)
12be1a816SJohn Birrell'\" te
22be1a816SJohn Birrell.\" CDDL HEADER START
32be1a816SJohn Birrell.\"
42be1a816SJohn Birrell.\" The contents of this file are subject to the terms of the
52be1a816SJohn Birrell.\" Common Development and Distribution License (the "License").
62be1a816SJohn Birrell.\" You may not use this file except in compliance with the License.
72be1a816SJohn Birrell.\"
82be1a816SJohn Birrell.\" You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
92be1a816SJohn Birrell.\" or http://www.opensolaris.org/os/licensing.
102be1a816SJohn Birrell.\" See the License for the specific language governing permissions
112be1a816SJohn Birrell.\" and limitations under the License.
122be1a816SJohn Birrell.\"
132be1a816SJohn Birrell.\" When distributing Covered Code, include this CDDL HEADER in each
142be1a816SJohn Birrell.\" file and include the License file at usr/src/OPENSOLARIS.LICENSE.
152be1a816SJohn Birrell.\" If applicable, add the following below this CDDL HEADER, with the
162be1a816SJohn Birrell.\" fields enclosed by brackets "[]" replaced with your own identifying
172be1a816SJohn Birrell.\" information: Portions Copyright [yyyy] [name of copyright owner]
182be1a816SJohn Birrell.\"
192be1a816SJohn Birrell.\" CDDL HEADER END
202be1a816SJohn Birrell.\" Copyright (c) 2006, Sun Microsystems, Inc. All Rights Reserved.
213f3c4e0bSMark Johnston.\"
223f3c4e0bSMark Johnston.\" $FreeBSD$
233f3c4e0bSMark Johnston.\"
243f3c4e0bSMark Johnston.Dd October 5, 2013
253f3c4e0bSMark Johnston.Dt DTRACE 1
263f3c4e0bSMark Johnston.Os
273f3c4e0bSMark Johnston.Sh NAME
283f3c4e0bSMark Johnston.Nm dtrace
293f3c4e0bSMark Johnston.Nd dynamic tracing compiler and tracing utility
303f3c4e0bSMark Johnston.Sh SYNOPSIS
313f3c4e0bSMark Johnston.Nm
323f3c4e0bSMark Johnston.Op Fl 32 | Fl 64
333f3c4e0bSMark Johnston.Op Fl aACeFGhHlqSvVwZ
343f3c4e0bSMark Johnston.Op Fl b Ar bufsz
353f3c4e0bSMark Johnston.Op Fl c Ar cmd
363f3c4e0bSMark Johnston.Op Fl D Ar name Op Ns = Ns value
373f3c4e0bSMark Johnston.Op Fl I Ar path
383f3c4e0bSMark Johnston.Op Fl L Ar path
393f3c4e0bSMark Johnston.Op Fl o Ar output
403f3c4e0bSMark Johnston.Op Fl s Ar script
413f3c4e0bSMark Johnston.Op Fl U Ar name
423f3c4e0bSMark Johnston.Op Fl x Ar arg Op Ns = Ns value
433f3c4e0bSMark Johnston.Op Fl X Cm a | c | s | t
443f3c4e0bSMark Johnston.Op Fl p Ar pid
453f3c4e0bSMark Johnston.Op Fl P Ar provider Oo Oo Ar predicate Oc Ar action Oc
463f3c4e0bSMark Johnston.Op Fl m Oo Ar provider : Oc Ar module Oo Oo Ar predicate Oc Ar action Oc
473f3c4e0bSMark Johnston.Op Fl f Oo Oo Ar provider : Oc Ar module : Oc Ar function Oo Oo Ar predicate \
483f3c4e0bSMark Johnston    Oc Ar action Oc
493f3c4e0bSMark Johnston.Op Fl n Oo Oo Oo Ar provider : Oc Ar module : Oc Ar function : Oc Ar name \
503f3c4e0bSMark Johnston    Oo Oo Ar predicate Oc Ar action Oc
513f3c4e0bSMark Johnston.Op Fl i Ar probe-id Oo Oo Ar predicate Oc Ar action Oc
523f3c4e0bSMark Johnston.Sh DESCRIPTION
533f3c4e0bSMark JohnstonDTrace is a comprehensive dynamic tracing framework ported from Solaris.
543f3c4e0bSMark JohnstonDTrace provides a powerful infrastructure that permits administrators,
553f3c4e0bSMark Johnstondevelopers, and service personnel to concisely answer arbitrary questions about
563f3c4e0bSMark Johnstonthe behavior of the operating system and user programs.
573f3c4e0bSMark Johnston.Pp
583f3c4e0bSMark JohnstonThe
593f3c4e0bSMark Johnston.Nm
603f3c4e0bSMark Johnstoncommand provides a generic interface to the essential services provided by the
613f3c4e0bSMark JohnstonDTrace facility, including:
623f3c4e0bSMark Johnston.Bl -bullet -offset indent
633f3c4e0bSMark Johnston.It
642be1a816SJohn BirrellOptions that list the set of probes and providers currently published by DTrace
653f3c4e0bSMark Johnston.It
663f3c4e0bSMark JohnstonOptions that enable probes directly using any of the probe description
673f3c4e0bSMark Johnstonspecifiers (provider, module, function, name)
683f3c4e0bSMark Johnston.It
693f3c4e0bSMark JohnstonOptions that run the D compiler and compile one or more D program files or
703f3c4e0bSMark Johnstonprograms written directly on the command line
713f3c4e0bSMark Johnston.It
722be1a816SJohn BirrellOptions that generate anonymous tracing programs
733f3c4e0bSMark Johnston.It
742be1a816SJohn BirrellOptions that generate program stability reports
753f3c4e0bSMark Johnston.It
763f3c4e0bSMark JohnstonOptions that modify DTrace tracing and buffering behavior and enable
773f3c4e0bSMark Johnstonadditional D compiler features
783f3c4e0bSMark Johnston.El
793f3c4e0bSMark Johnston.Pp
803f3c4e0bSMark JohnstonYou can use
813f3c4e0bSMark Johnston.Nm
823f3c4e0bSMark Johnstonto create D scripts by using it in a shebang declaration to create an
833f3c4e0bSMark Johnstoninterpreter file.
843f3c4e0bSMark JohnstonYou can also use
853f3c4e0bSMark Johnston.Nm
863f3c4e0bSMark Johnstonto attempt to compile D programs and determine their properties without
873f3c4e0bSMark Johnstonactually enabling traces using the
883f3c4e0bSMark Johnston.Fl e
893f3c4e0bSMark Johnstonoption.
903f3c4e0bSMark Johnston.Sh OPTIONS
913f3c4e0bSMark JohnstonThe arguments accepted by the
923f3c4e0bSMark Johnston.Fl P ,
933f3c4e0bSMark Johnston.Fl m ,
943f3c4e0bSMark Johnston.Fl f ,
953f3c4e0bSMark Johnston.Fl n ,
963f3c4e0bSMark Johnstonand
973f3c4e0bSMark Johnston.Fl i
983f3c4e0bSMark Johnstonoptions can include an optional D language
993f3c4e0bSMark Johnston.Ar predicate
1003f3c4e0bSMark Johnstonenclosed in slashes and an optional D language
1013f3c4e0bSMark Johnston.Ar action
1023f3c4e0bSMark Johnstonstatement list enclosed in braces.
1033f3c4e0bSMark JohnstonD program code specified on the command line must be appropriately quoted to
1043f3c4e0bSMark Johnstonavoid interpretation of meta-characters by the shell.
1053f3c4e0bSMark Johnston.Pp
1062be1a816SJohn BirrellThe following options are supported:
1073f3c4e0bSMark Johnston.Bl -tag -width indent
1083f3c4e0bSMark Johnston.It Fl 32 | Fl 64
1093f3c4e0bSMark JohnstonThe D compiler produces programs using the native data model of the operating
1103f3c4e0bSMark Johnstonsystem kernel.
1113f3c4e0bSMark JohnstonIf the
1123f3c4e0bSMark Johnston.Fl 32
1133f3c4e0bSMark Johnstonoption is specified,
1143f3c4e0bSMark Johnston.Nm
1153f3c4e0bSMark Johnstonforces the D compiler to compile a D program using the 32-bit data model.
1163f3c4e0bSMark JohnstonIf the
1173f3c4e0bSMark Johnston.Fl 64
1183f3c4e0bSMark Johnstonoption is specified,
1193f3c4e0bSMark Johnston.Nm
1203f3c4e0bSMark Johnstonforces the D compiler to compile a D program using the 64-bit data model.
1213f3c4e0bSMark JohnstonThese options are typically not required as
1223f3c4e0bSMark Johnston.Nm
1233f3c4e0bSMark Johnstonselects the native data model as the default.
1243f3c4e0bSMark JohnstonThe data model affects the sizes of integer types and other language properties.
1253f3c4e0bSMark JohnstonD programs compiled for either data model can be executed on both 32-bit and
1263f3c4e0bSMark Johnston64-bit kernels.
1273f3c4e0bSMark JohnstonThe
1283f3c4e0bSMark Johnston.Fl 32
1293f3c4e0bSMark Johnstonand
1303f3c4e0bSMark Johnston.Fl 64
1313f3c4e0bSMark Johnstonoptions also determine the
1323f3c4e0bSMark Johnston.Xr elf 5
1333f3c4e0bSMark Johnstonfile format (ELF32 or ELF64) produced by the
1343f3c4e0bSMark Johnston.Fl G
1353f3c4e0bSMark Johnstonoption.
1363f3c4e0bSMark Johnston.It Fl a
1373f3c4e0bSMark JohnstonClaim anonymous tracing state and display the traced data.
1383f3c4e0bSMark JohnstonYou can combine the
1393f3c4e0bSMark Johnston.Fl a
1403f3c4e0bSMark Johnstonoption with the
1413f3c4e0bSMark Johnston.Fl e
1423f3c4e0bSMark Johnstonoption to force
1433f3c4e0bSMark Johnston.Nm
1443f3c4e0bSMark Johnstonto exit immediately after consuming the anonymous tracing state rather than
1453f3c4e0bSMark Johnstoncontinuing to wait for new data.
1463f3c4e0bSMark Johnston.It Fl A
1473f3c4e0bSMark JohnstonGenerate directives for anonymous tracing and write them to
1483f3c4e0bSMark Johnston.Pa /boot/dtrace.dof .
1493f3c4e0bSMark JohnstonThis option constructs a set of dtrace configuration file directives to enable
1503f3c4e0bSMark Johnstonthe specified probes for anonymous tracing and then exits.
1513f3c4e0bSMark JohnstonBy default,
1523f3c4e0bSMark Johnston.Nm
1533f3c4e0bSMark Johnstonattempts to store the directives to the file
1543f3c4e0bSMark Johnston.Pa /boot/dtrace.dof .
1553f3c4e0bSMark JohnstonThis behavior can be modified using the
1563f3c4e0bSMark Johnston.Fl o
1573f3c4e0bSMark Johnstonoption to specify an alternate output file.
1583f3c4e0bSMark Johnston.It Fl b Ar bufsz
1593f3c4e0bSMark JohnstonSet the principal trace buffer size to
1603f3c4e0bSMark Johnston.Ar bufsz .
1613f3c4e0bSMark JohnstonThe trace buffer size can include any of the size suffixes k, m, g, or t.
1623f3c4e0bSMark JohnstonIf the buffer space cannot be allocated,
1633f3c4e0bSMark Johnston.Nm dtrace
1643f3c4e0bSMark Johnstonattempts to reduce the buffer size or exit depending on the setting of the
1653f3c4e0bSMark Johnstonbufresize property.
1663f3c4e0bSMark Johnston.It Fl c Ar cmd
1673f3c4e0bSMark JohnstonRun the specified command
1683f3c4e0bSMark Johnston.Ar cmd
1693f3c4e0bSMark Johnstonand exit upon its completion.
1703f3c4e0bSMark JohnstonIf more than one
1713f3c4e0bSMark Johnston.Fl c
1723f3c4e0bSMark Johnstonoption is present on the command line,
1733f3c4e0bSMark Johnston.Nm dtrace
1743f3c4e0bSMark Johnstonexits when all commands have exited, reporting the exit status for each child
1753f3c4e0bSMark Johnstonprocess as it terminates.
1763f3c4e0bSMark JohnstonThe process ID of the first command is made available to any D programs
1773f3c4e0bSMark Johnstonspecified on the command line or using the
1783f3c4e0bSMark Johnston.Fl s
1793f3c4e0bSMark Johnstonoption through the
1803f3c4e0bSMark Johnston.Li $target
1813f3c4e0bSMark Johnstonmacro variable.
1823f3c4e0bSMark Johnston.It Fl C
1833f3c4e0bSMark JohnstonRun the C preprocessor
1843f3c4e0bSMark Johnston.Xr cpp 1
1853f3c4e0bSMark Johnstonover D programs before compiling them.
1863f3c4e0bSMark JohnstonYou can pass options to the C preprocessor using the
1873f3c4e0bSMark Johnston.Fl D ,
1883f3c4e0bSMark Johnston.Fl U ,
1893f3c4e0bSMark Johnston.Fl I ,
1903f3c4e0bSMark Johnstonand
1913f3c4e0bSMark Johnston.Fl H
1923f3c4e0bSMark Johnstonoptions.
1933f3c4e0bSMark JohnstonYou can select the degree of C standard conformance if you use the
1943f3c4e0bSMark Johnston.Fl X
1953f3c4e0bSMark Johnstonoption.
1963f3c4e0bSMark JohnstonFor a description of the set of tokens defined by the D compiler when invoking
1973f3c4e0bSMark Johnstonthe C preprocessor, see
1983f3c4e0bSMark Johnston.Fl X .
1993f3c4e0bSMark Johnston.It Fl D Ar name Op Ns = Ns value
2003f3c4e0bSMark JohnstonDefine
2013f3c4e0bSMark Johnston.Ar name
2023f3c4e0bSMark Johnstonwhen invoking
2033f3c4e0bSMark Johnston.Xr cpp 1
2043f3c4e0bSMark Johnston(enabled using the
2053f3c4e0bSMark Johnston.Fl C
2063f3c4e0bSMark Johnstonoption).
2073f3c4e0bSMark JohnstonIf you specify an additional
2083f3c4e0bSMark Johnston.Ar value ,
2093f3c4e0bSMark Johnstonthe name is assigned the corresponding value.
2103f3c4e0bSMark JohnstonThis option passes the
2113f3c4e0bSMark Johnston.Fl D
2123f3c4e0bSMark Johnstonoption to each
2133f3c4e0bSMark Johnston.Xr cpp 1
2143f3c4e0bSMark Johnstoninvocation.
2153f3c4e0bSMark Johnston.It Fl e
2163f3c4e0bSMark JohnstonExit after compiling any requests and consuming anonymous tracing state
2173f3c4e0bSMark Johnston.Fl ( a
2183f3c4e0bSMark Johnstonoption) but prior to enabling any probes.
2193f3c4e0bSMark JohnstonYou can combine this option with the
2203f3c4e0bSMark Johnston.Fl a
2213f3c4e0bSMark Johnstonoption to print anonymous tracing data and exit.
2223f3c4e0bSMark JohnstonYou can also combine this option with D compiler options.
2233f3c4e0bSMark JohnstonThis combination verifies that the programs compile without actually executing
2243f3c4e0bSMark Johnstonthem and enabling the corresponding instrumentation.
2253f3c4e0bSMark Johnston.It Fl f Oo Oo Ar provider : Oc Ar module : Oc Ar function Oo Oo Ar predicate \
2263f3c4e0bSMark Johnston    Oc Ar action Oc
2273f3c4e0bSMark JohnstonSpecify function name to trace or list
2283f3c4e0bSMark Johnston.Fl ( l
2293f3c4e0bSMark Johnstonoption).
2303f3c4e0bSMark JohnstonThe corresponding argument can include any of the probe description forms
2313f3c4e0bSMark Johnston.Ar provider:module:function ,
2323f3c4e0bSMark Johnston.Ar module:function ,
2333f3c4e0bSMark Johnstonor
2343f3c4e0bSMark Johnston.Ar function .
2353f3c4e0bSMark JohnstonUnspecified probe description fields are left blank and match any probes
2363f3c4e0bSMark Johnstonregardless of the values in those fields.
2373f3c4e0bSMark JohnstonIf no qualifiers other than
2383f3c4e0bSMark Johnston.Ar function
2393f3c4e0bSMark Johnstonare specified in the description, all probes with the corresponding
2403f3c4e0bSMark Johnston.Ar function
2413f3c4e0bSMark Johnstonare matched.
2423f3c4e0bSMark JohnstonThe
2433f3c4e0bSMark Johnston.Fl f
2443f3c4e0bSMark Johnstonargument can be suffixed with an optional D probe clause.
2453f3c4e0bSMark JohnstonYou can specify more than one
2463f3c4e0bSMark Johnston.Fl f
2473f3c4e0bSMark Johnstonoption on the command line at a time.
2483f3c4e0bSMark Johnston.It Fl F
2493f3c4e0bSMark JohnstonCoalesce trace output by identifying function entry and return.
2503f3c4e0bSMark JohnstonFunction entry probe reports are indented and their output is prefixed with
2513f3c4e0bSMark Johnston.Ql -> .
2523f3c4e0bSMark JohnstonFunction return probe reports are unindented and their output is prefixed with
2533f3c4e0bSMark Johnston.Ql <- .
2543f3c4e0bSMark JohnstonSystem call entry probe reports are indented and their output is prefixed with
2553f3c4e0bSMark Johnston.Ql => .
2563f3c4e0bSMark JohnstonSystem call return probe reports are unindented and their output is prefixed
2573f3c4e0bSMark Johnstonwith
2583f3c4e0bSMark Johnston.Ql <= .
2593f3c4e0bSMark Johnston.It Fl G
2603f3c4e0bSMark JohnstonGenerate an ELF file containing an embedded DTrace program.
2613f3c4e0bSMark JohnstonThe DTrace probes specified in the program are saved inside of a relocatable ELF
2623f3c4e0bSMark Johnstonobject which can be linked into another program.
2633f3c4e0bSMark JohnstonIf the
2643f3c4e0bSMark Johnston.Fl o
2653f3c4e0bSMark Johnstonoption is present, the ELF file is saved using the pathname specified as the
2663f3c4e0bSMark Johnstonargument for this operand.
2673f3c4e0bSMark JohnstonIf the
2683f3c4e0bSMark Johnston.Fl o
2693f3c4e0bSMark Johnstonoption is not present and the DTrace program is contained with a file whose name
2703f3c4e0bSMark Johnstonis
2713f3c4e0bSMark Johnston.Ar filename.d ,
2723f3c4e0bSMark Johnstonthen the ELF file is saved using the name
2733f3c4e0bSMark Johnston.Ar filename.o .
2743f3c4e0bSMark JohnstonOtherwise the ELF file is saved using the name d.out.
2753f3c4e0bSMark Johnston.It Fl h
2763f3c4e0bSMark JohnstonGenerate a header file containing macros that correspond to probes in the
2773f3c4e0bSMark Johnstonspecified provider definitions.
2783f3c4e0bSMark JohnstonThis option should be used to generate a header file that is included by other
2793f3c4e0bSMark Johnstonsource files for later use with the
280*946497ecSMark Johnston.Fl G
281*946497ecSMark Johnstonoption.
282*946497ecSMark JohnstonIf the
283*946497ecSMark Johnston.Fl o
284*946497ecSMark Johnstonoption is present, the header file is saved using the pathname specified as the
285*946497ecSMark Johnstonargument for that option.
286*946497ecSMark JohnstonIf the
287*946497ecSMark Johnston.Fl o
288*946497ecSMark Johnstonoption is not present and the DTrace program is contained within a file whose
289*946497ecSMark Johnstonname is
290*946497ecSMark Johnston.Ar filename.d ,
291*946497ecSMark Johnstonthen the header file is saved using the name
292*946497ecSMark Johnston.Ar filename.h .
2933f3c4e0bSMark Johnston.It Fl H
2943f3c4e0bSMark JohnstonPrint the pathnames of included files when invoking
2953f3c4e0bSMark Johnston.Xr cpp 1
2963f3c4e0bSMark Johnston(enabled using the
2973f3c4e0bSMark Johnston.Fl C
2983f3c4e0bSMark Johnstonoption).
2993f3c4e0bSMark JohnstonThis option passes the
3003f3c4e0bSMark Johnston.Fl H
3013f3c4e0bSMark Johnstonoption to each
3023f3c4e0bSMark Johnston.Xr cpp 1
3033f3c4e0bSMark Johnstoninvocation, causing it to display the list of pathnames, one for each line, to
3043f3c4e0bSMark Johnstonstandard error.
3053f3c4e0bSMark Johnston.It Fl i Ar probe-id Op Oo Ar predicate Oc Ar action
3063f3c4e0bSMark JohnstonSpecify probe identifier
3073f3c4e0bSMark Johnston.Ar ( probe-id )
3083f3c4e0bSMark Johnstonto trace or list
3093f3c4e0bSMark Johnston.Ar ( l
3103f3c4e0bSMark Johnstonoption).
3113f3c4e0bSMark JohnstonYou can specify probe IDs using decimal integers as shown by `dtrace -l`.
3123f3c4e0bSMark JohnstonThe
3133f3c4e0bSMark Johnston.Fl i
3143f3c4e0bSMark Johnstonargument can be suffixed with an optional D probe clause.
3153f3c4e0bSMark JohnstonYou can specify more than one
3163f3c4e0bSMark Johnston.Fl i
3173f3c4e0bSMark Johnstonoption at a time.
3183f3c4e0bSMark Johnston.It Fl I Ar path
3193f3c4e0bSMark JohnstonAdd the specified directory
3203f3c4e0bSMark Johnston.Ar path
3213f3c4e0bSMark Johnstonto the search path for #include files when invoking
3223f3c4e0bSMark Johnston.Xr cpp 1
3233f3c4e0bSMark Johnston(enabled using the
3243f3c4e0bSMark Johnston.Fl C
3253f3c4e0bSMark Johnstonoption).
3263f3c4e0bSMark JohnstonThis option passes the
3273f3c4e0bSMark Johnston.Fl I
3283f3c4e0bSMark Johnstonoption to each
3293f3c4e0bSMark Johnston.Xr cpp 1
3303f3c4e0bSMark Johnstoninvocation.
3313f3c4e0bSMark JohnstonThe specified
3323f3c4e0bSMark Johnston.Ar path
3333f3c4e0bSMark Johnstonis inserted into the search path ahead of the default directory list.
3343f3c4e0bSMark Johnston.It Fl l
3353f3c4e0bSMark JohnstonList probes instead of enabling them.
3363f3c4e0bSMark JohnstonIf the
3373f3c4e0bSMark Johnston.Fl l
3383f3c4e0bSMark Johnstonoption is specified,
3393f3c4e0bSMark Johnston.Nm
3403f3c4e0bSMark Johnstonproduces a report of the probes matching the descriptions given using the
3413f3c4e0bSMark Johnston.Fl P , m , f , n , i ,
3423f3c4e0bSMark Johnstonand
3433f3c4e0bSMark Johnston.Fl s
3443f3c4e0bSMark Johnstonoptions.
3453f3c4e0bSMark JohnstonIf none of these options are specified, this option lists all probes.
3463f3c4e0bSMark Johnston.It Fl L Ar path
3473f3c4e0bSMark JohnstonAdd the specified directory
3483f3c4e0bSMark Johnston.Ar path
3493f3c4e0bSMark Johnstonto the search path for DTrace libraries.
3503f3c4e0bSMark JohnstonDTrace libraries are used to contain common definitions that can be used when
3513f3c4e0bSMark Johnstonwriting D programs.
3523f3c4e0bSMark JohnstonThe specified
3533f3c4e0bSMark Johnston.Ar path
3543f3c4e0bSMark Johnstonis added after the default library search path.
3553f3c4e0bSMark Johnston.It Fl m Oo Ar provider : Oc Ar module Oo Oo Ar predicate Oc Ar action Oc
3563f3c4e0bSMark JohnstonSpecify module name to trace or list
3573f3c4e0bSMark Johnston.Fl ( l
3583f3c4e0bSMark Johnstonoption).
3593f3c4e0bSMark JohnstonThe corresponding argument can include any of the probe description forms
3603f3c4e0bSMark Johnston.Ar provider:module
3613f3c4e0bSMark Johnstonor
3623f3c4e0bSMark Johnston.Ar module .
3633f3c4e0bSMark JohnstonUnspecified probe description fields are left blank and match any probes
3643f3c4e0bSMark Johnstonregardless of the values in those fields.
3653f3c4e0bSMark JohnstonIf no qualifiers other than
3663f3c4e0bSMark Johnston.Ar module
3673f3c4e0bSMark Johnstonare specified in the description, all probes with a corresponding
3683f3c4e0bSMark Johnston.Ar module
3693f3c4e0bSMark Johnstonare matched.
3703f3c4e0bSMark JohnstonThe
3713f3c4e0bSMark Johnston.Fl m
3723f3c4e0bSMark Johnstonargument can be suffixed with an optional D probe clause.
3733f3c4e0bSMark JohnstonMore than one
3743f3c4e0bSMark Johnston.Fl m
3753f3c4e0bSMark Johnstonoption can be specified on the command line at a time.
3763f3c4e0bSMark Johnston.It Fl n Oo Oo Oo Ar provider : Oc Ar module : Oc Ar function : Oc Ar name \
3773f3c4e0bSMark Johnston    Oo Oo Ar predicate Oc Ar action Oc
3783f3c4e0bSMark JohnstonSpecify probe name to trace or list
3793f3c4e0bSMark Johnston.Fl ( l
3803f3c4e0bSMark Johnstonoption).
3813f3c4e0bSMark JohnstonThe corresponding argument can include any of the probe description forms
3823f3c4e0bSMark Johnston.Ar provider:module:function:name , module:function:name , function:name ,
3833f3c4e0bSMark Johnstonor
3843f3c4e0bSMark Johnston.Ar name .
3853f3c4e0bSMark JohnstonUnspecified probe description fields are left blank and match any probes
3863f3c4e0bSMark Johnstonregardless of the values in those fields.
3873f3c4e0bSMark JohnstonIf no qualifiers other than
3883f3c4e0bSMark Johnston.Ar name
3893f3c4e0bSMark Johnstonare specified in the description, all probes with a corresponding
3903f3c4e0bSMark Johnston.Ar name
3913f3c4e0bSMark Johnstonare matched.
3923f3c4e0bSMark JohnstonThe
3933f3c4e0bSMark Johnston.Fl n
3943f3c4e0bSMark Johnstonargument can be suffixed with an optional D probe clause.
3953f3c4e0bSMark JohnstonMore than one
3963f3c4e0bSMark Johnston.Fl n
3973f3c4e0bSMark Johnstonoption can be specified on the command line at a time.
3983f3c4e0bSMark Johnston.It Fl o Ar output
3993f3c4e0bSMark JohnstonSpecify the
4003f3c4e0bSMark Johnston.Ar output
4013f3c4e0bSMark Johnstonfile for the
4023f3c4e0bSMark Johnston.Fl A , G ,
4033f3c4e0bSMark Johnstonand
4043f3c4e0bSMark Johnston.Fl l
4053f3c4e0bSMark Johnstonoptions, or for the traced data itself.
4063f3c4e0bSMark JohnstonIf the
4073f3c4e0bSMark Johnston.Fl A
4083f3c4e0bSMark Johnstonoption is present and
4093f3c4e0bSMark Johnston.Fl o
4103f3c4e0bSMark Johnstonis not present, the default output file is
4113f3c4e0bSMark Johnston.Pa /boot/dtrace.dof .
4123f3c4e0bSMark JohnstonIf the
4133f3c4e0bSMark Johnston.Fl G
4143f3c4e0bSMark Johnstonoption is present and the
4153f3c4e0bSMark Johnston.Fl s
4163f3c4e0bSMark Johnstonoption's argument is of the form
4173f3c4e0bSMark Johnston.Ar filename.d
4183f3c4e0bSMark Johnstonand
4193f3c4e0bSMark Johnston.Fl o
4203f3c4e0bSMark Johnstonis not present, the default output file is
4213f3c4e0bSMark Johnston.Ar filename.o .
4223f3c4e0bSMark JohnstonOtherwise the default output file is
4233f3c4e0bSMark Johnston.Ar d.out .
4243f3c4e0bSMark Johnston.It Fl p Ar pid
4253f3c4e0bSMark JohnstonGrab the specified process-ID
4263f3c4e0bSMark Johnston.Ar pid ,
4273f3c4e0bSMark Johnstoncache its symbol tables, and exit upon its completion.
4283f3c4e0bSMark JohnstonIf more than one
4293f3c4e0bSMark Johnston.Fl p
4303f3c4e0bSMark Johnstonoption is present on the command line,
4313f3c4e0bSMark Johnston.Nm
4323f3c4e0bSMark Johnstonexits when all commands have exited, reporting the exit status for each process
4333f3c4e0bSMark Johnstonas it terminates.
4343f3c4e0bSMark JohnstonThe first process-ID is made available to any D programs specified on the
4353f3c4e0bSMark Johnstoncommand line or using the
4363f3c4e0bSMark Johnston.Fl s
4373f3c4e0bSMark Johnstonoption through the
4383f3c4e0bSMark Johnston.Li $target
4393f3c4e0bSMark Johnstonmacro variable.
4403f3c4e0bSMark Johnston.It Fl P Ar provider Oo Oo Ar predicate Oc Ar action Oc
4413f3c4e0bSMark JohnstonSpecify provider name to trace or list
4423f3c4e0bSMark Johnston.Fl ( l
4433f3c4e0bSMark Johnstonoption).
4443f3c4e0bSMark JohnstonThe remaining probe description fields module, function, and name are left
4453f3c4e0bSMark Johnstonblank and match any probes regardless of the values in those fields.
4463f3c4e0bSMark JohnstonThe
4473f3c4e0bSMark Johnston.Fl P
4483f3c4e0bSMark Johnstonargument can be suffixed with an optional D probe clause.
4493f3c4e0bSMark JohnstonYou can specify more than one
4503f3c4e0bSMark Johnston.Fl P
4513f3c4e0bSMark Johnstonoption on the command line at a time.
4523f3c4e0bSMark Johnston.It Fl q
4533f3c4e0bSMark JohnstonSet quiet mode.
4543f3c4e0bSMark Johnston.Nm
4553f3c4e0bSMark Johnstonsuppresses messages such as the number of probes matched by the specified
4563f3c4e0bSMark Johnstonoptions and D programs and does not print column headers, the CPU ID, the probe
4573f3c4e0bSMark JohnstonID, or insert newlines into the output.
4583f3c4e0bSMark JohnstonOnly data traced and formatted by D program statements such as
4593f3c4e0bSMark Johnston.Ql dtrace()
4603f3c4e0bSMark Johnstonand
4613f3c4e0bSMark Johnston.Ql printf()
4623f3c4e0bSMark Johnstonis displayed to standard output.
4633f3c4e0bSMark Johnston.It Fl s Ar script
4643f3c4e0bSMark JohnstonCompile the specified D program source file.
4653f3c4e0bSMark JohnstonIf the
4663f3c4e0bSMark Johnston.Fl e
4673f3c4e0bSMark Johnstonoption is present, the program is compiled but instrumentation is not enabled.
4683f3c4e0bSMark JohnstonIf the
4693f3c4e0bSMark Johnston.Fl l
4703f3c4e0bSMark Johnstonoption is present, the program is compiled and the set of probes matched by it
4713f3c4e0bSMark Johnstonis listed, but instrumentation is not enabled.
4723f3c4e0bSMark JohnstonIf none of
4733f3c4e0bSMark Johnston.Fl e , l , G ,
4743f3c4e0bSMark Johnstonor
4753f3c4e0bSMark Johnston.Fl A
4763f3c4e0bSMark Johnstonare present, the instrumentation specified by the D program is enabled and
4773f3c4e0bSMark Johnstontracing begins.
4783f3c4e0bSMark Johnston.It Fl S
4793f3c4e0bSMark JohnstonShow D compiler intermediate code.
4803f3c4e0bSMark JohnstonThe D compiler produces a report of the intermediate code generated for each D
4813f3c4e0bSMark Johnstonprogram to standard error.
4823f3c4e0bSMark Johnston.It Fl U Ar name
4833f3c4e0bSMark JohnstonUndefine the specified
4843f3c4e0bSMark Johnston.Ar name
4853f3c4e0bSMark Johnstonwhen invoking
4863f3c4e0bSMark Johnston.Xr cpp 1
4873f3c4e0bSMark Johnston(enabled using the
4883f3c4e0bSMark Johnston.Fl C
4893f3c4e0bSMark Johnstonoption).
4903f3c4e0bSMark JohnstonThis option passes the
4913f3c4e0bSMark Johnston.Fl U
4923f3c4e0bSMark Johnstonoption to each
4933f3c4e0bSMark Johnston.Xr cpp 1
4943f3c4e0bSMark Johnstoninvocation.
4953f3c4e0bSMark Johnston.It Fl v
4963f3c4e0bSMark JohnstonSet verbose mode.
4973f3c4e0bSMark JohnstonIf the
4983f3c4e0bSMark Johnston.Fl v
4993f3c4e0bSMark Johnstonoption is specified,
5003f3c4e0bSMark Johnston.Nm
5013f3c4e0bSMark Johnstonproduces a program stability report showing the minimum interface stability and
5023f3c4e0bSMark Johnstondependency level for the specified D programs.
5033f3c4e0bSMark Johnston.It Fl V
5043f3c4e0bSMark JohnstonReport the highest D programming interface version supported by
5053f3c4e0bSMark Johnston.Nm .
5063f3c4e0bSMark JohnstonThe version information is printed to standard output and the
5073f3c4e0bSMark Johnston.Nm
5083f3c4e0bSMark Johnstoncommand exits.
5093f3c4e0bSMark Johnston.It Fl w
5103f3c4e0bSMark JohnstonPermit destructive actions in D programs specified using the
5113f3c4e0bSMark Johnston.Fl s , P , m , f , n ,
5123f3c4e0bSMark Johnstonor
5133f3c4e0bSMark Johnston.Fl i
5143f3c4e0bSMark Johnstonoptions.
5153f3c4e0bSMark JohnstonIf the
5163f3c4e0bSMark Johnston.Fl w
5173f3c4e0bSMark Johnstonoption is not specified,
5183f3c4e0bSMark Johnston.Nm
5193f3c4e0bSMark Johnstondoes not permit the compilation or enabling of a D program that contains
5203f3c4e0bSMark Johnstondestructive actions.
5213f3c4e0bSMark Johnston.It Fl x Ar arg Op Ns = Ns value
5223f3c4e0bSMark JohnstonEnable or modify a DTrace runtime option or D compiler option.
5233f3c4e0bSMark JohnstonBoolean options are enabled by specifying their name.
5243f3c4e0bSMark JohnstonOptions with values are set by separating the option name and value with an
5253f3c4e0bSMark Johnstonequals sign (=).
5263f3c4e0bSMark Johnston.It Fl X Cm a | c | s | t
5273f3c4e0bSMark JohnstonSpecify the degree of conformance to the ISO C standard that should be selected
5283f3c4e0bSMark Johnstonwhen invoking
5293f3c4e0bSMark Johnston.Xr cpp 1
5303f3c4e0bSMark Johnston(enabled using the
5313f3c4e0bSMark Johnston.Fl C
5323f3c4e0bSMark Johnstonoption).
5333f3c4e0bSMark JohnstonThe
5343f3c4e0bSMark Johnston.Fl X
5353f3c4e0bSMark Johnstonoption argument affects the value and presence of the __STDC__ macro depending
5363f3c4e0bSMark Johnstonupon the value of the argument letter.
5372be1a816SJohn Birrell.sp
5383f3c4e0bSMark JohnstonThe
5393f3c4e0bSMark Johnston.Fl X
5403f3c4e0bSMark Johnstonoption supports the following arguments:
5413f3c4e0bSMark Johnston.Bl -tag -width indent
5423f3c4e0bSMark Johnston.It a
5433f3c4e0bSMark JohnstonDefault.
5443f3c4e0bSMark JohnstonISO C plus K&R compatibility extensions, with semantic changes required by ISO
5453f3c4e0bSMark JohnstonC.
5463f3c4e0bSMark JohnstonThis is the default mode if
5473f3c4e0bSMark Johnston.Fl X
5483f3c4e0bSMark Johnstonis not specified.
5493f3c4e0bSMark JohnstonThe predefined macro __STDC__ has a value of 0 when
5503f3c4e0bSMark Johnston.Xr cpp 1
5513f3c4e0bSMark Johnstonis invoked in conjunction with the
5523f3c4e0bSMark Johnston.Fl Xa
5533f3c4e0bSMark Johnstonoption.
5543f3c4e0bSMark Johnston.It c
5553f3c4e0bSMark JohnstonConformance.
5563f3c4e0bSMark JohnstonStrictly conformant ISO C, without K&R C compatibility extensions.
5573f3c4e0bSMark JohnstonThe predefined macro __STDC__ has a value of 1 when
5583f3c4e0bSMark Johnston.Xr cpp 1
5593f3c4e0bSMark Johnstonis invoked in conjunction with the
5603f3c4e0bSMark Johnston.Fl \&Xc
5613f3c4e0bSMark Johnstonoption.
5623f3c4e0bSMark Johnston.It s
5633f3c4e0bSMark JohnstonK&R C only.
5643f3c4e0bSMark JohnstonThe macro __STDC__ is not defined when
5653f3c4e0bSMark Johnston.Xr cpp 1
5663f3c4e0bSMark Johnstonis invoked in conjunction with the
5673f3c4e0bSMark Johnston.Fl Xs
5683f3c4e0bSMark Johnstonoption.
5693f3c4e0bSMark Johnston.It t
5703f3c4e0bSMark JohnstonTransition.
5713f3c4e0bSMark JohnstonISO C plus K&R C compatibility extensions, without semantic changes required by
5723f3c4e0bSMark JohnstonISO C.
5733f3c4e0bSMark JohnstonThe predefined macro __STDC__ has a value of 0 when
5743f3c4e0bSMark Johnston.Xr cpp 1
5753f3c4e0bSMark Johnstonis invoked in conjunction with the
5763f3c4e0bSMark Johnston.Fl Xt
5773f3c4e0bSMark Johnstonoption.
5783f3c4e0bSMark Johnston.El
5793f3c4e0bSMark Johnston.Pp
5803f3c4e0bSMark JohnstonAs the
5813f3c4e0bSMark Johnston.Fl X
5823f3c4e0bSMark Johnstonoption only affects how the D compiler invokes the C preprocessor, the
5833f3c4e0bSMark Johnston.Fl Xa
5843f3c4e0bSMark Johnstonand
5853f3c4e0bSMark Johnston.Fl Xt
5863f3c4e0bSMark Johnstonoptions are equivalent from the perspective of D and both are provided only to
5873f3c4e0bSMark Johnstonease re-use of settings from a C build environment.
5883f3c4e0bSMark Johnston.Pp
5893f3c4e0bSMark JohnstonRegardless of the
5903f3c4e0bSMark Johnston.Fl X
5913f3c4e0bSMark Johnstonmode, the following additional C preprocessor definitions are always specified
5923f3c4e0bSMark Johnstonand valid in all modes:
5933f3c4e0bSMark Johnston.Bl -bullet -offset indent
5943f3c4e0bSMark Johnston.It
5953f3c4e0bSMark Johnston__sun
5963f3c4e0bSMark Johnston.It
5973f3c4e0bSMark Johnston__unix
5983f3c4e0bSMark Johnston.It
5993f3c4e0bSMark Johnston__SVR4
6003f3c4e0bSMark Johnston.It
6013f3c4e0bSMark Johnston__sparc (on SPARC systems only)
6023f3c4e0bSMark Johnston.It
6033f3c4e0bSMark Johnston__sparcv9 (on SPARC systems only when 64-bit programs are compiled)
6043f3c4e0bSMark Johnston.It
6053f3c4e0bSMark Johnston__i386 (on x86 systems only when 32-bit programs are compiled)
6063f3c4e0bSMark Johnston.It
6073f3c4e0bSMark Johnston__amd64 (on x86 systems only when 64-bit programs are compiled)
6083f3c4e0bSMark Johnston.It
6093f3c4e0bSMark Johnston__`uname -s`_`uname -r` (for example,
6103f3c4e0bSMark Johnston.Ql FreeBSD_9.2-RELEASE .
6113f3c4e0bSMark Johnston.It
6123f3c4e0bSMark Johnston__SUNW_D=1
6133f3c4e0bSMark Johnston.It
6143f3c4e0bSMark Johnston.No __SUNW_D_VERSION=0x Ns Ar MMmmmuuu
6153f3c4e0bSMark Johnston.Pp
6163f3c4e0bSMark JohnstonWhere
6173f3c4e0bSMark Johnston.Ar MM
6183f3c4e0bSMark Johnstonis the major release value in hexadecimal,
6193f3c4e0bSMark Johnston.Ar mmm
6203f3c4e0bSMark Johnstonis the minor release value in hexadecimal, and
6213f3c4e0bSMark Johnston.Ar uuu
6223f3c4e0bSMark Johnstonis the micro release value in hexadecimal.
6233f3c4e0bSMark Johnston.El
6243f3c4e0bSMark Johnston.It Fl Z
6253f3c4e0bSMark JohnstonPermit probe descriptions that match zero probes.
6263f3c4e0bSMark JohnstonIf the
6273f3c4e0bSMark Johnston.Fl Z
6283f3c4e0bSMark Johnstonoption is not specified,
6293f3c4e0bSMark Johnston.Nm
6303f3c4e0bSMark Johnstonreports an error and exits if any probe descriptions specified in D program
6313f3c4e0bSMark Johnstonfiles
6323f3c4e0bSMark Johnston.Fl ( s
6333f3c4e0bSMark Johnstonoption) or on the command line
6343f3c4e0bSMark Johnston.Fl ( P , m , f , n ,
6353f3c4e0bSMark Johnstonor
6363f3c4e0bSMark Johnston.Fl i
6373f3c4e0bSMark Johnstonoptions) contain descriptions that do not match any known probes.
6383f3c4e0bSMark Johnston.El
6393f3c4e0bSMark Johnston.Sh OPERANDS
6403f3c4e0bSMark JohnstonYou can specify zero or more additional arguments on the
6413f3c4e0bSMark Johnston.Nm
6423f3c4e0bSMark Johnstoncommand line to define a set of macro variables and so forth).
6433f3c4e0bSMark JohnstonThe additional arguments can be used in D programs specified using the
6443f3c4e0bSMark Johnston.Fl s
6453f3c4e0bSMark Johnstonoption or on the command line.
6463f3c4e0bSMark Johnston.Sh FILES
6473f3c4e0bSMark Johnston.Bl -tag -width /boot/dtrace.dof -compact
6483f3c4e0bSMark Johnston.It Pa /boot/dtrace.dof
6493f3c4e0bSMark JohnstonFile for anonymous tracing directives.
6503f3c4e0bSMark Johnston.El
6513f3c4e0bSMark Johnston.Sh EXIT STATUS
6523f3c4e0bSMark JohnstonThe following exit statuses are returned:
6533f3c4e0bSMark Johnston.Bl -tag -width indent
6543f3c4e0bSMark Johnston.It 0
6552be1a816SJohn BirrellSuccessful completion.
6563f3c4e0bSMark Johnston.Pp
6573f3c4e0bSMark JohnstonFor D program requests, an exit status of 0 indicates that programs were
6583f3c4e0bSMark Johnstonsuccessfully compiled, probes were successfully enabled, or anonymous state
6593f3c4e0bSMark Johnstonwas successfully retrieved.
6603f3c4e0bSMark Johnston.Nm
6613f3c4e0bSMark Johnstonreturns 0 even if the specified tracing requests encountered errors or drops.
6623f3c4e0bSMark Johnston.It 1
6632be1a816SJohn BirrellAn error occurred.
6643f3c4e0bSMark Johnston.Pp
6653f3c4e0bSMark JohnstonFor D program requests, an exit status of 1 indicates that program compilation
6663f3c4e0bSMark Johnstonfailed or that the specified request could not be satisfied.
6673f3c4e0bSMark Johnston.It 2
6682be1a816SJohn BirrellInvalid command line options or arguments were specified.
6693f3c4e0bSMark Johnston.El
6703f3c4e0bSMark Johnston.Sh SEE ALSO
6713f3c4e0bSMark Johnston.Xr cpp 1 ,
6723f3c4e0bSMark Johnston.Xr dtruss 1 ,
6733f3c4e0bSMark Johnston.Xr elf 5
6743f3c4e0bSMark Johnston.Rs
6753f3c4e0bSMark Johnston.%T Solaris Dynamic Tracing Guide
6763f3c4e0bSMark Johnston.Re
677