]> git.saurik.com Git - apple/system_cmds.git/blame - fs_usage.tproj/fs_usage.1
system_cmds-498.2.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
83f6dbe8 11.Nm fs_usage [-e] [-w] [-f mode [-f mode] ...] [ 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.
19By default the activity monitored includes all system processes except the
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.
34d340d7
A
46If a list of process ids or commands is also given,
47then those processes are also excluded from the sampled output.
48.\" ==========
20e66415
A
49.It Fl f
50Specifying the
51.Fl f
52option turns on output filtering based on the
53.Pa mode
54provided.
83f6dbe8
A
55Multiple filtering options can be specified.
56By default no output filtering occurs.
20e66415
A
57The supported modes are:
58.Pp
59.Pa network
60Only network related output is displayed.
61.Pp
62.Pa filesys
63Only file system related output is displayed.
83f6dbe8
A
64.Pp
65.Pa cachehit
2fc1e207 66In addition, display CACHE_HIT output.
34d340d7
A
67.\" ==========
68.It Fl w
69Specifying the
70.Fl w
71option forces a wider, more detailed output,
72regardless of the window size.
73.\" ==========
1815bff5 74.It pid | cmd
20e66415
A
75The sampled data can be limited to a list of process ids or commands.
76When a command name is given, all processes with that name will be sampled.
77Using the
1815bff5 78.Fl e
34d340d7
A
79option has the opposite effect,
80excluding sampled data relating to the given list
81of process ids or commands.
1815bff5
A
82.El
83.Pp
20e66415
A
84If you set the DYLD_IMAGE_SUFFIX environment variable to
85.Dq Li _debug ,
34d340d7
A
86then an application will use the debug version of all libraries,
87including the Carbon FileManager.
20e66415
A
88See
89.Xr dyld 1 .
90When
91.Nm fs_usage
34d340d7
A
92is run against a Carbon Application launched in this environment,
93then the high-level Carbon FileManager calls
94will be displayed bracketing the system calls that they are built on.
1815bff5
A
95.Pp
96The data columns displayed are as follows:
20e66415 97.Bl -tag -width Ds
1815bff5
A
98.Pp
99.It TIMESTAMP
20e66415
A
100TOD when call occurred.
101Wide mode will have millisecond granularity.
1815bff5 102.It CALL
34d340d7
A
103The name of the network or filesystem related call, page-in, page-out,
104or physical disk access.
1815bff5 105.It FILE DESCRIPTOR
20e66415 106Of the form F=x, x is a file descriptor.
34d340d7
A
107Depending on the type of system call,
108this will be either an input value or a return value.
1815bff5
A
109.It BYTE COUNT
110Of the form B=x, x is the number of bytes requested by the call.
111.It [ERRNO]
112On error, the errno is displayed in brackets.
113.It PATHNAME
114Pathname of the file accessed (up to the last 28 bytes).
115.It FAULT ADDRESS
34d340d7
A
116Of the form A=0xnnnnnnnn,
117where 0xnnnnnnnn is the address being faulted.
b51d5b5f 118.It DISK BLOCK NUMBER
34d340d7
A
119Of the form D=0xnnnnnnnn,
120where 0xnnnnnnnn is the block number
121of the physical disk block being read or written.
c3a08f59
A
122.It OFFSET
123Of the form O=0xnnnnnnnn, where 0xnnnnnnnn is a file offset.
20e66415 124.It SELECT RETURN
34d340d7
A
125Of the form S=x, x is the number of ready descriptors returned
126by the select() system call.
20e66415 127If S=0, the time limit expired.
1815bff5
A
128.It TIME INTERVAL(W)
129The elapsed time spent in the system call.
20e66415
A
130A
131.Sq Li W
34d340d7
A
132after the elapsed time indicates the process was scheduled out
133during this file activity.
20e66415 134In this case, the elapsed time includes the wait time.
1815bff5
A
135.It PROCESS NAME
136The process that made the system call.
137.El
138.Pp
139.Sh SAMPLE USAGE
140.Pp
20e66415 141fs_usage -w -f filesys Mail
1815bff5
A
142.Pp
143.Nm fs_usage
34d340d7
A
144will display file system related data
145for all instances of processes named Mail.
20e66415 146Maximum data output will be displayed in the window.
1815bff5 147.Sh SEE ALSO
34d340d7 148.Xr dyld 1 ,
20e66415 149.Xr latency 1 ,
34d340d7
A
150.Xr sc_usage 1 ,
151.Xr top 1