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