]> git.saurik.com Git - apple/system_cmds.git/blob - system_cmds-597.1.1/fs_usage.tproj/fs_usage.1
system_cmds-597.90.1.tar.gz
[apple/system_cmds.git] / system_cmds-597.1.1 / fs_usage.tproj / fs_usage.1
1 .\" Copyright (c) 2000, Apple Computer, Inc. All rights reserved.
2 .\"
3 .Dd November 7, 2002
4 .Dt FS_USAGE 1
5 .Os "Mac OS X"
6 .Sh NAME
7 .Nm fs_usage
8 .Nd report system calls and page faults related to filesystem activity in
9 real-time
10 .Sh SYNOPSIS
11 .Nm fs_usage [-e] [-w] [-f mode] [-b] [-t seconds] [-R rawfile [-S start_time] [-E end_time]] [pid | cmd [pid | cmd] ...]
12 .Sh DESCRIPTION
13 The
14 .Nm fs_usage
15 utility presents an ongoing display of system call usage information
16 pertaining to filesystem activity.
17 It requires root privileges due to the kernel tracing facility it uses to
18 operate.
19 By default, the activity monitored includes all system processes except the
20 running
21 .Nm fs_usage
22 process, Terminal, telnetd, sshd, rlogind, tcsh, csh and sh.
23 These defaults can be overridden such that output is limited to include or
24 exclude a list of processes specified by the user.
25 .Pp
26 The output presented by
27 .Nm fs_usage
28 is formatted according to the size of your window.
29 A narrow window will display fewer columns of data.
30 Use a wide window for maximum data display.
31 You may override the window formatting restrictions
32 by forcing a wide display with the
33 .Fl w
34 option.
35 In this case, the data displayed will wrap
36 when the window is not wide enough.
37 .Pp
38 The options are as follows:
39 .Bl -tag -width Ds
40 .\" ==========
41 .It Fl e
42 Specifying the
43 .Fl e
44 option generates output that excludes sampling
45 of the running fs_usage tool.
46 If a list of process IDs or commands is also given,
47 then those processes are also excluded from the sampled output.
48 .\" ==========
49 .It Fl w
50 Specifying the
51 .Fl w
52 option forces a wider, more detailed output,
53 regardless of the window size.
54 .\" ==========
55 .It Fl f
56 Specifying the
57 .Fl f
58 option turns on output filtering based on the
59 .Pa mode
60 provided.
61 Multiple filtering options can be specified.
62 By default, no output filtering occurs.
63 The supported modes are:
64 .Pp
65 .Pa network
66 Network-related events are displayed.
67 .Pp
68 .Pa filesys
69 Filesystem-related events are displayed.
70 .Pp
71 .Pa pathname
72 Pathname-related events are displayed.
73 .Pp
74 .Pa exec
75 Exec and spawn events are displayed.
76 .Pp
77 .Pa diskio
78 Disk I/O events are displayed.
79 .Pp
80 .Pa cachehit
81 In addition, show cache hits.
82 .\" ==========
83 .It Fl b
84 Specifying the
85 .Fl b
86 option annotates disk I/O events with BootCache info (if available).
87 .\" ==========
88 .It Fl t Ar seconds
89 Specifies a run timeout in seconds.
90 .Nm fs_usage
91 will run for no longer than the timeout specified.
92 .\" ==========
93 .It Fl R Ar raw_file
94 Specifies a raw trace file to process.
95 .\" ==========
96 .It Fl S Ar start_time
97 If
98 .Fl R
99 is selected, specifies the start time in microseconds to
100 begin processing entries from the raw trace file. Entries
101 with timestamps before the specified start time will be
102 skipped.
103 .\" ==========
104 .It Fl E Ar end_time
105 If
106 .Fl R
107 is selected, specifies the ending time in microseconds to
108 stop processing entries from the raw trace file. Entries
109 with timestamps beyond the specified ending time will be
110 skipped.
111 .\" ==========
112 .It pid | cmd
113 The sampled data can be limited to a list of process IDs or commands.
114 When a command name is given, all processes with that name will be sampled.
115 Using the
116 .Fl e
117 option has the opposite effect,
118 excluding sampled data relating to the given list
119 of process IDs or commands.
120 .El
121 .Pp
122 If you set the DYLD_IMAGE_SUFFIX environment variable to
123 .Dq Li _debug ,
124 then an application will use the debug version of all libraries,
125 including the Carbon FileManager.
126 See
127 .Xr dyld 1 .
128 When
129 .Nm fs_usage
130 is run against a Carbon Application launched in this environment,
131 then the high-level Carbon FileManager calls
132 will be displayed bracketing the system calls that they are built on.
133 .Pp
134 The data columns displayed are as follows:
135 .Bl -tag -width Ds
136 .Pp
137 .It TIMESTAMP
138 TOD when call occurred.
139 Wide mode will have microsecond granularity.
140 .It CALL
141 The name of the network or filesystem related call, page-in, page-out,
142 or physical disk access.
143 .It FILE DESCRIPTOR
144 Of the form F=x, x is a file descriptor.
145 Depending on the type of system call,
146 this will be either an input value or a return value.
147 .It BYTE COUNT
148 Of the form B=x, x is the number of bytes requested by the call.
149 .It [ERRNO]
150 On error, the errno is displayed in brackets.
151 .It PATHNAME
152 Pathname of the file accessed (up to the last 28 bytes).
153 .It FAULT ADDRESS
154 Of the form A=0xnnnnnnnn,
155 where 0xnnnnnnnn is the address being faulted.
156 .It DISK BLOCK NUMBER
157 Of the form D=0xnnnnnnnn,
158 where 0xnnnnnnnn is the block number
159 of the physical disk block being read or written.
160 .It OFFSET
161 Of the form O=0xnnnnnnnn, where 0xnnnnnnnn is a file offset.
162 .It SELECT RETURN
163 Of the form S=x, x is the number of ready descriptors returned
164 by the select() system call.
165 If S=0, the time limit expired.
166 .It TIME INTERVAL(W)
167 The elapsed time spent in the system call.
168 A
169 .Sq Li W
170 after the elapsed time indicates the process was scheduled out
171 during this file activity.
172 In this case, the elapsed time includes the wait time.
173 .It PROCESS NAME
174 The process that made the system call. Wide mode will append the
175 thread id to the process name (i.e Mail.nnn).
176 .El
177 .Pp
178 .Sh SAMPLE USAGE
179 .Pp
180 fs_usage -w -f filesys Mail
181 .Pp
182 .Nm fs_usage
183 will display file system related data
184 for all instances of processes named Mail.
185 Maximum data output will be displayed in the window.
186 .Sh SEE ALSO
187 .Xr dyld 1 ,
188 .Xr latency 1 ,
189 .Xr sc_usage 1 ,
190 .Xr top 1