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 fork(), 31vfork, etc. 32.It Fl a 33Show the argument strings that are passed in each execve() system call. 34.It Fl e 35Show the environment strings that are passed in each execve() system call. 36.It Fl d 37Include timestamps in the output showing the time elapsed 38since the trace was started. 39.It Fl D 40Include timestamps in the output showing the time elapsed 41since the last recorded event. 42.It Fl S 43Do not display information about signals received by the process. 44(Normally, 45.Nm 46displays signal as well as system call events.) 47.It Fl o Ar file 48Print the output to the specified 49.Ar file 50instead of standard error. 51.It Fl p Ar pid 52Follow the process specified by 53.Ar pid 54instead of a new command. 55.It Ar command Op args 56Execute 57.Ar command 58and trace the system calls of it. 59(The 60.Fl p 61and 62.Ar command 63options are mutually exclusive.) 64.El 65.Sh EXAMPLES 66# Follow the system calls used in echoing "hello" 67.Dl $ truss /bin/echo hello 68# Do the same, but put the output into a file 69.Dl $ truss -o /tmp/truss.out /bin/echo hello 70# Follow an already-running process 71.Dl $ truss -p 1 72.Sh SEE ALSO 73.Xr kdump 1 , 74.Xr ktrace 1 , 75.Xr procfs 5 76.Sh HISTORY 77The 78.Nm 79command was written by 80.An Sean Eric Fagan 81for 82.Fx . 83It was modeled after 84similar commands available for System V Release 4 and SunOS. 85