Name
truss
Synopsis
truss [options
]arguments
Trace system calls, signals, and machine faults while
executing arguments.
arguments is either a Unix command to run or,
if -p
is specified, a list of process IDs
representing the already running processes to trace. The options
-m
, -r
, -s
,
-t
, -v
, -w
, and
-x
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
keyword all
can include/exclude
all possible elements for the list. The optional !
and corresponding description are
shown in brackets. truss also
provides tracing of user-level function calls in dynamically
loaded shared libraries. See also sotruss and whocalls.
This command is particularly useful for finding missing
files when a third-party application fails. By watching the
access
and open
system calls, you can find where,
and which, files the application program expected to find, but did
not.
Many systems have similar programs named trace or strace. These programs are worth learning how to use.
Options
-
-a
Display parameters passed by each exec(2) call.
-
-c
Count the traced items and print a summary rather than listing them as they happen.
-
-d
Print a timestamp in the output, of the form seconds.fraction, indicating the time relative to the start of the trace. Times are when the system call completes, not starts.
-
-D
Print a delta timestamp in the output, of the form seconds.fraction, indicating ...
Get Unix in a Nutshell, 4th Edition now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.