truss.1 revision 134714
$FreeBSD: head/usr.bin/truss/truss.1 134714 2004-09-03 17:52:55Z alfred $

.Dd November 23, 1997 .Dt TRUSS 1 .Os .Sh NAME .Nm truss .Nd trace system calls .Sh SYNOPSIS .Nm .Op Fl faedDS .Op Fl o Ar file .Fl p Ar pid .Nm .Op Fl faedDS .Op Fl o Ar file command .Op args .Sh DESCRIPTION The .Nm utility traces the system calls called by the specified process or program. Output is to the specified output file, or standard error by default. It does this by stopping and restarting the process being monitored via .Xr procfs 5 .

p The options are as follows: l -tag -width indent t Fl f Trace decendants of the original traced process created by .Xr fork 2 , .Xr vfork 2 , etc. t Fl a Show the argument strings that are passed in each .Xr execve 2 system call. t Fl e Show the environment strings that are passed in each .Xr execve 2 system call. t Fl d Include timestamps in the output showing the time elapsed since the trace was started. t Fl D Include timestamps in the output showing the time elapsed since the last recorded event. t Fl S Do not display information about signals received by the process. (Normally, .Nm displays signal as well as system call events.) t Fl o Ar file Print the output to the specified .Ar file instead of standard error. t Fl p Ar pid Follow the process specified by .Ar pid instead of a new command. t Ar command Op args Execute .Ar command and trace the system calls of it. (The .Fl p and .Ar command options are mutually exclusive.) .El

p The .Xr procctl 8 utility can be used to clear tracepoints in a stuck process left behind if truss abnormally terminates. .Sh EXAMPLES # Follow the system calls used in echoing "hello" .Dl $ truss /bin/echo hello # Do the same, but put the output into a file .Dl $ truss -o /tmp/truss.out /bin/echo hello # Follow an already-running process .Dl $ truss -p 1 .Sh SEE ALSO .Xr kdump 1 , .Xr ktrace 1 , .Xr procfs 5 , .Xr procctl 8 .Sh HISTORY The .Nm command was written by .An Sean Eric Fagan for .Fx . It was modeled after similar commands available for System V Release 4 and SunOS.