xref: /freebsd/usr.bin/truss/truss.1 (revision 6990ffd8a95caaba6858ad44ff1b3157d1efba8f)
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 S
12.Op Fl o Ar file
13.Fl p Ar pid
14.Nm
15.Op Fl S
16.Op Fl o Ar file
17command
18.Op args
19.Sh DESCRIPTION
20.Nm Truss
21traces the system calls called by the specified process or program.
22Output is to the specified output file, or standard error by default.
23It does this by stopping and restarting the process being monitored via
24.Xr procfs 5 .
25.Pp
26The options are as follows:
27.Bl -tag -width indent
28.It Fl S
29Do not display information about signals received by the process.
30(Normally,
31.Nm
32displays signal as well as system call events.)
33.It Fl o Ar file
34Print the output to the specified
35.Ar file
36instead of standard error.
37.It Fl p Ar pid
38Follow the process specified by
39.Ar pid
40instead of a new command.
41.It Ar command Op args
42Execute
43.Ar command
44and trace the system calls of it.
45(The
46.Fl p
47and
48.Ar command
49options are mutually exclusive.)
50.El
51.Sh EXAMPLES
52# Follow the system calls used in echoing "hello"
53.Dl $ truss /bin/echo hello
54# Do the same, but put the output into a file
55.Dl $ truss -o /tmp/truss.out /bin/echo hello
56# Follow an already-running process
57.Dl $ truss -p 1
58.Sh SEE ALSO
59.Xr kdump 1 ,
60.Xr ktrace 1 ,
61.Xr procfs 5
62.Sh HISTORY
63The
64.Nm
65command was written by
66.An Sean Eric Fagan
67for
68.Fx .
69It was modeled after
70similar commands available for System V Release 4 and SunOS.
71