1.\" $FreeBSD$ 2.\" 3.Dd November 23, 1997 4.Dt TRUSS 1 5.Os 6.Sh NAME 7.Nm truss 8.Nd trace system calls 9.Sh SYNOPSIS 10.Nm 11.Op Fl faedDS 12.Op Fl o Ar file 13.Fl p Ar pid 14.Nm 15.Op Fl faedDS 16.Op Fl o Ar file 17command 18.Op args 19.Sh DESCRIPTION 20The 21.Nm 22utility traces the system calls called by the specified process or program. 23Output is to the specified output file, or standard error by default. 24It does this by stopping and restarting the process being monitored via 25.Xr procfs 5 . 26.Pp 27The options are as follows: 28.Bl -tag -width indent 29.It Fl f 30Trace decendants of the original traced process created by 31.Xr fork 2 , 32.Xr vfork 2 , 33etc. 34.It Fl a 35Show the argument strings that are passed in each 36.Xr execve 2 37system call. 38.It Fl e 39Show the environment strings that are passed in each 40.Xr execve 2 41system call. 42.It Fl d 43Include timestamps in the output showing the time elapsed 44since the trace was started. 45.It Fl D 46Include timestamps in the output showing the time elapsed 47since the last recorded event. 48.It Fl S 49Do not display information about signals received by the process. 50(Normally, 51.Nm 52displays signal as well as system call events.) 53.It Fl o Ar file 54Print the output to the specified 55.Ar file 56instead of standard error. 57.It Fl p Ar pid 58Follow the process specified by 59.Ar pid 60instead of a new command. 61.It Ar command Op args 62Execute 63.Ar command 64and trace the system calls of it. 65(The 66.Fl p 67and 68.Ar command 69options are mutually exclusive.) 70.El 71.Sh EXAMPLES 72# Follow the system calls used in echoing "hello" 73.Dl $ truss /bin/echo hello 74# Do the same, but put the output into a file 75.Dl $ truss -o /tmp/truss.out /bin/echo hello 76# Follow an already-running process 77.Dl $ truss -p 1 78.Sh SEE ALSO 79.Xr kdump 1 , 80.Xr ktrace 1 , 81.Xr procfs 5 82.Sh HISTORY 83The 84.Nm 85command was written by 86.An Sean Eric Fagan 87for 88.Fx . 89It was modeled after 90similar commands available for System V Release 4 and SunOS. 91