]> CyberLeo.Net >> Repos - FreeBSD/releng/7.2.git/blob - usr.bin/truss/truss.1
Create releng/7.2 from stable/7 in preparation for 7.2-RELEASE.
[FreeBSD/releng/7.2.git] / usr.bin / truss / truss.1
1 .\" $FreeBSD$
2 .\"
3 .Dd January 2, 2004
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 .Op Fl s Ar strsize
14 .Fl p Ar pid
15 .Nm
16 .Op Fl faedDS
17 .Op Fl o Ar file
18 .Op Fl s Ar strsize
19 .Ar command Op Ar args
20 .Sh DESCRIPTION
21 The
22 .Nm
23 utility traces the system calls called by the specified process or program.
24 Output is to the specified output file, or standard error by default.
25 It does this by stopping and restarting the process being monitored via
26 .Xr ptrace 2 .
27 .Pp
28 The options are as follows:
29 .Bl -tag -width indent
30 .It Fl f
31 Trace descendants of the original traced process created by
32 .Xr fork 2 ,
33 .Xr vfork 2 ,
34 etc.
35 .It Fl a
36 Show the argument strings that are passed in each
37 .Xr execve 2
38 system call.
39 .It Fl e
40 Show the environment strings that are passed in each
41 .Xr execve 2
42 system call.
43 .It Fl d
44 Include timestamps in the output showing the time elapsed
45 since the trace was started.
46 .It Fl D
47 Include timestamps in the output showing the time elapsed
48 since the last recorded event.
49 .It Fl S
50 Do not display information about signals received by the process.
51 (Normally,
52 .Nm
53 displays signal as well as system call events.)
54 .It Fl o Ar file
55 Print the output to the specified
56 .Ar file
57 instead of standard error.
58 .It Fl s Ar strsize
59 Display strings using at most
60 .Ar strsize
61 characters.
62 If the buffer is larger,
63 .Dq Li ...
64 will be displayed at the end of the string.
65 The default
66 .Ar strsize
67 is 32.
68 .It Fl p Ar pid
69 Follow the process specified by
70 .Ar pid
71 instead of a new command.
72 .It Ar command Op Ar args
73 Execute
74 .Ar command
75 and trace the system calls of it.
76 (The
77 .Fl p
78 and
79 .Ar command
80 options are mutually exclusive.)
81 .El
82 .Sh EXAMPLES
83 # Follow the system calls used in echoing "hello"
84 .Dl $ truss /bin/echo hello
85 # Do the same, but put the output into a file
86 .Dl $ truss -o /tmp/truss.out /bin/echo hello
87 # Follow an already-running process
88 .Dl $ truss -p 1
89 .Sh SEE ALSO
90 .Xr kdump 1 ,
91 .Xr ktrace 1 ,
92 .Xr ptrace 2
93 .Sh HISTORY
94 The
95 .Nm
96 command was written by
97 .An Sean Eric Fagan
98 for
99 .Fx .
100 It was modeled after
101 similar commands available for System V Release 4 and SunOS.