]> CyberLeo.Net >> Repos - FreeBSD/stable/10.git/blob - cddl/contrib/dtracetoolkit/Man/man1m/opensnoop.1m
Copy head (r256279) to stable/10 as part of the 10.0-RELEASE cycle.
[FreeBSD/stable/10.git] / cddl / contrib / dtracetoolkit / Man / man1m / opensnoop.1m
1 .TH opensnoop 1m  "$Date:: 2007-08-05 #$" "USER COMMANDS"
2 .SH NAME
3 opensnoop \- snoop file opens as they occur. Uses DTrace.
4 .SH SYNOPSIS
5 .B opensnoop
6 [\-a|\-A|\-ceghsvxZ] [\-f pathname] [\-n name] [\-p PID]
7 .SH DESCRIPTION
8 opensnoop tracks file opens. As a process issues a file open, details
9 such as UID, PID and pathname are printed out. 
10
11 The returned file descriptor is printed,
12 a value of -1 indicates an error. This can be useful
13 for troubleshooting to determine if appliacions are attempting to
14 open files that do not exist. 
15
16 Since this uses DTrace, only the root user or users with the
17 dtrace_kernel privilege can run this command.
18 .SH OS
19 Solaris
20 .SH STABILITY
21 stable - needs the syscall provider.
22 .SH OPTIONS
23 .TP
24 \-a
25 print all data
26 .TP
27 \-A
28 dump all data, space delimited
29 .TP
30 \-c
31 print current working directory of process
32 .TP
33 \-e
34 print errno value
35 .TP
36 \-g
37 print full command arguments
38 .TP
39 \-s
40 print start time, us
41 .TP
42 \-v
43 print start time, string
44 .TP
45 \-x
46 only print failed opens
47 .TP
48 \-Z
49 print zonename
50 .TP
51 \-f pathname
52 file pathname to snoop
53 .TP
54 \-n name
55 process name to snoop
56 .TP
57 \-p PID
58 process ID to snoop
59 .PP
60 .SH EXAMPLES
61 .TP
62 Default output, print file opens by process as they occur,
63
64 .B opensnoop
65 .PP
66 .TP
67 Print human readable timestamps,
68
69 .B opensnoop
70 \-v 
71 .PP
72 .TP
73 See error codes,
74 #
75 .B opensnoop
76 \-e
77 .PP
78 .TP
79 Snoop this file only,
80 #
81 .B opensnoop
82 \-f /etc/passwd
83 .PP
84 .SH FIELDS
85 .TP
86 ZONE
87 Zone name
88 .TP
89 UID
90 User ID
91 .TP
92 PID
93 Process ID
94 .TP
95 PPID
96 Parent Process ID
97 .TP
98 FD
99 File Descriptor (-1 is error)
100 .TP
101 ERR
102 errno value (see /usr/include/sys/errno.h)
103 .TP
104 CWD
105 current working directory of process
106 .TP
107 PATH
108 pathname for file open
109 .TP
110 COMM
111 command name for the process
112 .TP
113 ARGS
114 argument listing for the process
115 .TP
116 TIME
117 timestamp for the open event, us
118 .TP
119 STRTIME
120 timestamp for the open event, string
121 .SH DOCUMENTATION
122 See the DTraceToolkit for further documentation under the 
123 Docs directory. The DTraceToolkit docs may include full worked
124 examples with verbose descriptions explaining the output.
125 .SH EXIT
126 opensnoop will run forever until Ctrl\-C is hit. 
127 .SH BUGS
128 occasionally the pathname for the file open cannot be read
129 and the following error will be seen,
130
131 dtrace: error on enabled probe ID 6 (...): invalid address
132
133 this is normal behaviour.
134 .SH AUTHOR
135 Brendan Gregg
136 [Sydney, Australia]
137 .SH SEE ALSO
138 dtrace(1M), truss(1)
139