summaryrefslogtreecommitdiffstats
path: root/usr.bin/truss/truss.1
blob: e3cdb5fde53418fa5595be5829de01d6e785f86f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
.Dd Nov 23, 1997
.Dt TRUSS 1
.Os FreeBSD
.Sh NAME
.Nm \&truss
.Nd trace system calls
.Sh Synopsis
.Nm \&truss
.Op Fl S
.Op Fl p Ar pid
.Op Fl o Ar file
command
.Sh DESCRIPTION
.Nm \&truss
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 .
.Pp
The options are as follows:
.Bl -tag -width command
.It Fl S
Do not display information about signals received by the process.
(Normally,
.Nm \&truss
displays signal as well as system call events.)
.It Fl p
Follow the process specified by 
.Ar pid
instead of a new command.
.It Fl o
Print the output to the specified file instead of standard error.
.It Ar command
Execute
.Ar command
and trace the system calls of it.
(The
.Fl p
and
.Ar command
options are mutually exclusive.)
.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 procfs 5 ,
.Xr ktrace 1 ,
.Xr kdump 1
.Sh HISTORY
The
.Nm truss
command was written by Sean Eric Fagan for FreeBSD; it was modeled after
similar commands available for System V Release 4 and SunOS.
OpenPOWER on IntegriCloud