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