truss
[options
]arguments
Trace system calls, signals, and machine faults while executing
arguments
.
arguments
is either a UNIX command or, if
-p
is specified, a list of process IDs representing the processes to run. The options
-m
,
-t
,
-v
,
-x
,
-s
,
-r
, and
-w
accept a comma-separated list of arguments. A
!
reverses the sense of the list, telling
truss
to ignore those elements of the list during the trace. (In the C shell, use a backslash before
!
.) The optional
!
and corresponding description are shown in brackets.
Display parameters passed by each exec call.
Count the traced items rather than listing them.
Display values of environment variables passed by each exec call.
Follow child processes. Useful for tracing shell scripts.
List sleeping system calls only once, upon completion.
faults
Trace [exclude from trace] the list of machine
faults
.
faults
are names or numbers, as listed in
<sys/fault.h>
(default is
-mall -m!fltpage
).
outfile
Send trace output to
outfile
, not standard error.
Trace one or more process IDs instead of a command.
file_descriptors
Display [don't display] the I/O buffer of
read
system calls for
file_descriptors
(default is
-r!all
).
signals
Trace [exclude from trace] the list of
signals
.
signals
are names or numbers, as listed in
<sys/signal.h>
(default is
-sall
).
system_calls
Trace [exclude from trace] the list of
system_calls
.
system_calls
are names or numbers, as listed in Section 2, "System Calls," of the
UNIX Programmer's Reference Manual
(default is
-tall
).
system_calls
Verbose mode. Same as
-t
, but list also the contents of any structures passed to
system_calls
(default is
-v!all
).
file_descriptors
Display [don't display] the I/O buffer of
write
system calls for
file_descriptors
(default is
-w!all
).
system_calls
Same as -t , but display the system call arguments as raw code (hexadecimal) (default is -x!all ).
Trace system calls open and close for lp command:
truss -t open,close lp
files
> truss.out
Trace the make command, including its child processes, and store the output in make.trace :
truss -f -o make.trace make
target