summaryrefslogtreecommitdiffstats
path: root/usr.bin/truss/truss.1
blob: b7446919651db60424f4af64fb9e1b77930b47a7 (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
58
59
60
61
62
63
64
65
66
67
68
69
70
.\" $FreeBSD$
.\"
.Dd November 23, 1997
.Dt TRUSS 1
.Os FreeBSD
.Sh NAME
.Nm truss
.Nd trace system calls
.Sh SYNOPSIS
.Nm
.Op Fl S
.Op Fl o Ar file
.Fl p Ar pid
.Nm
.Op Fl S
.Op Fl o Ar file
command
.Op args
.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 indent
.It Fl S
Do not display information about signals received by the process.
(Normally,
.Nm
displays signal as well as system call events.)
.It Fl o Ar file
Print the output to the specified
.Ar file
instead of standard error.
.It Fl p Ar pid
Follow the process specified by 
.Ar pid
instead of a new command.
.It Ar command Op args
Execute
.Ar command
and trace the system calls of it.
(The
.Fl p
and
.Ar command
options are mutually exclusive.)
.El
.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 kdump 1 ,
.Xr ktrace 1 ,
.Xr procfs 5
.Sh HISTORY
The
.Nm
command was written by
.An Sean Eric Fagan
for
.Fx .
It was modeled after
similar commands available for System V Release 4 and SunOS.
OpenPOWER on IntegriCloud