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