1999-08-28 23:23:38 +00:00
|
|
|
.\" $FreeBSD$
|
|
|
|
.\"
|
2000-12-11 15:47:53 +00:00
|
|
|
.Dd November 23, 1997
|
1997-12-06 05:23:12 +00:00
|
|
|
.Dt TRUSS 1
|
2001-07-10 14:16:33 +00:00
|
|
|
.Os
|
1997-12-06 05:23:12 +00:00
|
|
|
.Sh NAME
|
1998-01-05 07:30:26 +00:00
|
|
|
.Nm truss
|
1997-12-06 05:23:12 +00:00
|
|
|
.Nd trace system calls
|
1998-01-05 07:30:26 +00:00
|
|
|
.Sh SYNOPSIS
|
2000-11-20 19:21:22 +00:00
|
|
|
.Nm
|
2002-08-04 01:02:52 +00:00
|
|
|
.Op Fl fS
|
1998-01-05 07:30:26 +00:00
|
|
|
.Op Fl o Ar file
|
|
|
|
.Fl p Ar pid
|
2000-11-20 19:21:22 +00:00
|
|
|
.Nm
|
2002-08-04 01:02:52 +00:00
|
|
|
.Op Fl fS
|
1997-12-06 05:23:12 +00:00
|
|
|
.Op Fl o Ar file
|
|
|
|
command
|
1998-01-05 07:30:26 +00:00
|
|
|
.Op args
|
1997-12-06 05:23:12 +00:00
|
|
|
.Sh DESCRIPTION
|
2002-04-20 12:18:28 +00:00
|
|
|
The
|
|
|
|
.Nm
|
|
|
|
utility traces the system calls called by the specified process or program.
|
1997-12-06 05:23:12 +00:00
|
|
|
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 .
|
|
|
|
.Pp
|
|
|
|
The options are as follows:
|
1998-01-05 07:30:26 +00:00
|
|
|
.Bl -tag -width indent
|
2002-08-04 01:02:52 +00:00
|
|
|
.It Fl f
|
|
|
|
Trace decendants of the original traced process created by fork(),
|
|
|
|
vfork, etc.
|
1997-12-06 05:23:12 +00:00
|
|
|
.It Fl S
|
|
|
|
Do not display information about signals received by the process.
|
|
|
|
(Normally,
|
1998-01-05 07:30:26 +00:00
|
|
|
.Nm
|
1997-12-06 05:23:12 +00:00
|
|
|
displays signal as well as system call events.)
|
1998-01-05 07:30:26 +00:00
|
|
|
.It Fl o Ar file
|
|
|
|
Print the output to the specified
|
|
|
|
.Ar file
|
|
|
|
instead of standard error.
|
|
|
|
.It Fl p Ar pid
|
2001-07-15 08:06:20 +00:00
|
|
|
Follow the process specified by
|
1997-12-06 05:23:12 +00:00
|
|
|
.Ar pid
|
|
|
|
instead of a new command.
|
1998-01-05 07:30:26 +00:00
|
|
|
.It Ar command Op args
|
1997-12-06 05:23:12 +00:00
|
|
|
Execute
|
|
|
|
.Ar command
|
|
|
|
and trace the system calls of it.
|
|
|
|
(The
|
|
|
|
.Fl p
|
|
|
|
and
|
|
|
|
.Ar command
|
|
|
|
options are mutually exclusive.)
|
2000-12-19 16:00:12 +00:00
|
|
|
.El
|
1997-12-06 05:23:12 +00:00
|
|
|
.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
|
1998-01-05 07:30:26 +00:00
|
|
|
.Xr kdump 1 ,
|
1997-12-06 05:23:12 +00:00
|
|
|
.Xr ktrace 1 ,
|
1998-01-05 07:30:26 +00:00
|
|
|
.Xr procfs 5
|
1997-12-06 05:23:12 +00:00
|
|
|
.Sh HISTORY
|
|
|
|
The
|
1998-01-05 07:30:26 +00:00
|
|
|
.Nm
|
|
|
|
command was written by
|
|
|
|
.An Sean Eric Fagan
|
|
|
|
for
|
2000-01-23 01:48:16 +00:00
|
|
|
.Fx .
|
|
|
|
It was modeled after
|
1997-12-06 05:23:12 +00:00
|
|
|
similar commands available for System V Release 4 and SunOS.
|