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