2 .\" Copyright (c) 2007, Sun Microsystems, Inc. All Rights Reserved.
3 .\" The contents of this file are subject to the terms of the Common Development and Distribution License (the "License"). You may not use this file except in compliance with the License.
4 .\" You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE or http://www.opensolaris.org/os/licensing. See the License for the specific language governing permissions and limitations under the License.
5 .\" When distributing Covered Code, include this CDDL HEADER in each file and include the License file at usr/src/OPENSOLARIS.LICENSE. If applicable, add the following below this CDDL HEADER, with the fields enclosed by brackets "[]" replaced with your own identifying information: Portions Copyright [yyyy] [name of copyright owner]
6 .TH FSSTAT 8 "Jan 5, 2007"
8 fsstat \- report file system statistics
12 \fBfsstat\fR [\fB-a|f|i|n|v\fR] [\fB-T\fR | u|d] {\fB-F\fR | {\fIfstype\fR|\fIpath\fR}...}
13 [\fIinterval\fR [\fIcount\fR]]
19 \fBfsstat\fR reports kernel file operation activity by the file system type
20 (\fIfstype\fR) or by the path name, which is converted to a mount point. The
21 first set of lines of output reports all activity since:
26 The file system module was loaded (in the case of \fIfstype\fR)
32 The file system was mounted (in the case of mount point)
36 Statistics are gathered at the file system independent layer at both the
37 \fIfstype\fR and the mount point levels. However, not all file system types are
38 represented in the gathering of statistics. (See the NOTES section of this man
42 The output of \fBfsstat\fR is dependent on the mode (option) requested. All
43 statistic fields are displayed using "smart numbers" which automatically scale
44 the units in a human readable form that fits in a maximum of 5 characters. For
75 The unit modifiers are: K (Kbyte), M (Mbyte), G (Gbyte), T (terabyte), P
76 (petabyte), and E (exabyte).
79 During the execution of \fBfsstat\fR, the state of the system can change. If
80 relevant, a state change message is included in the \fBfsstat\fR output in one
81 of the following forms:
85 <<mount point no longer available: {path}>>
86 <<file system module no longer loaded: {fstype}>>
93 After the state change messages are displayed, \fBfsstat\fR continues to
94 display the statistics as directed. If all of the \fIfstypes\fR and mount
95 points that \fBfsstat\fR was reporting on are no longer available, then
99 The user is required to specify the \fB-F\fR option (all available file system
100 types) or a list of one or more \fIfstypes\fR and/or mount points.
103 The default report shows general file system activity. This display combines
104 similar operations into general categories as follows:
111 Number of creation operations for file system objects (for example, files,
112 directories, symlinks, etc.)
121 Number of name removal operations
130 Number of name change operations
139 Number of object attribute retrieval operations
148 Number of object attribute change operations
157 Number of object lookup operations
166 Number of read directory operations
175 Number of data read operations
184 Bytes transferred by data read operations
193 Number of data write operations
202 Bytes transferred by data write operations
207 The entity being reported on (\fIfstype\fR or mount point) is displayed in the
212 The following options are supported:
219 Report the activity for kernel attribute operations. The following statistics
227 Number of file attribute retrieval calls
236 Number of file attribute modification calls
245 Number of file security attribute retrieval calls
254 Number of file security attribute modification calls
257 The entity being reported on (\fIfstype\fR or mount point) is displayed in the
267 Report the full activity for all kernel file operations. Each file operation is
268 listed in the left column. The following statistics are reported for each
276 Number of calls for this operation
285 Average transfer size in bytes (only applies to read, write, readdir)
288 The entity being reported on (\fIfstype\fR or mount point) is displayed in the
298 Reports the activity for kernel I/O operations. The following statistics are
306 Number of data read calls
324 Number of data write calls
333 Number of bytes written
342 Number of read directory calls
351 Number of bytes read by reading directories
360 Number of internal file system lock operations
369 Number of internal file system unlock operations
372 The entity being reported on (\fIfstype\fR or mount point) is displayed in the
382 Reports the activity for kernel naming operations. The following statistics are
390 Number of file name retrieval calls
399 Number of file creation calls
408 Number of file remove calls
426 Number of file renaming calls
435 Number of directory creation calls
444 Number of directory removal calls
453 Number of directory read calls
462 Number of symlink creation calls
471 Number of symlink read calls
474 The entity being reported on (\fIfstype\fR or mount point) is displayed in the
484 Reports the activity for calls to the virtual memory operations. The following
485 statistics are reported.
492 Number of calls mapping a file
501 Number of calls setting additional mapping to a mapped file
510 Number of calls deleting mapping to a file
519 Number of calls retrieving a page of data from a file
528 Number of calls writing a page of data to a file
537 Number of calls to transfer pages in file system swap files
540 The entity being reported on (fstype or mount point) is displayed in the last
550 Report on all available file system types.
556 \fB\fB-T\fR \fIu\fR|\fId\fR\fR
559 Display a time stamp.
561 Specify \fIu\fR for a printed representation of the internal representation of
562 time (see \fBtime\fR(2)) Specify \fId\fR for the standard date format. (See
563 \fBdate\fR(1)). The time stamp is only used when an interval is set.
569 The following operands are supported:
576 Display only \fIcount\fR reports.
585 Explicitly specify the file system type(s) to be reported. The file system
586 module must be loaded.
595 Report once each \fIinterval\fR seconds.
604 Specify the path(s) of the mount point(s) to be reported. If path is not a
605 mount point, the mount point containing path will be determined and displayed
611 If no \fIinterval\fR and no \fIcount\fR are specified, a single report is
612 printed and \fBfsstat\fR exits. If an \fIinterval\fR is specified but no
613 \fIcount\fR is specified, \fBfsstat\fR prints reports every \fIinterval\fR
614 seconds indefinitely until the command is interrupted.
617 \fBExample 1 \fRDisplaying General Activity
620 The following example shows general activity for all file system types.
626 new name name attr attr lookup rddir read read write write
627 file remov chng get set ops ops ops bytes ops bytes
628 313K 214K 38.5K 2.16M 56.2K 8.36M 52.8K 19.7M 39.9G 18.8M 39.1G ufs
629 0 0 0 2.95K 0 3.81K 282 2.52K 466K 0 0 proc
630 0 0 0 0 0 0 0 0 0 0 0 nfs
631 10 8 2 86 9 98 15 413 103M 8.43K 1.05G zfs
632 13 14 4 98 16 125 10 1.01K 258M 15.9K 127M lofs
633 8.73K 3.29K 5.25K 55.3K 37 1.20M 44 37.9K 38.3M 47.2K 35.9M tmpfs
634 0 0 0 4.93K 0 0 0 1.08K 913K 0 0 mntfs
635 3 2 1 503 3 897 13 122 25.8K 128 272K nfs3
636 10 8 0 615 10 10.1K 18 61 45.6K 292 2.26M nfs4
642 \fBExample 2 \fRDisplaying Naming Activity
645 The following example shows the naming activity for ufs, nfs, nfs3, nfs4, and
651 \fB$ fsstat -n ufs nfs nfs3 nfs4 tmpfs\fR
652 lookup creat remov link renam mkdir rmdir rddir symlnk rdlnk
653 3.57M 3.10K 586 6 24 115 100 30.2K 5 330K ufs
654 0 0 0 0 0 0 0 0 0 0 nfs
655 18.3K 3 5 0 0 0 0 1.03K 2 346 nfs3
656 535 0 0 0 0 0 0 46 0 4 nfs4
657 146 24 15 0 0 4 0 4 0 0 tmpfs
663 \fBExample 3 \fRDisplaying Attribute Activity
666 The following example shows the attribute activity for the FS type ufs and the
667 mounted file systems "/" and "/export/home" every three seconds for every third
673 \fB# fsstat -a ufs / /export/home 3 3\fR
674 getattr setattr getsec setsec
675 378K 91.9K 11.8K 0 ufs
677 11.3K 9.6K 198 0 /export/home
678 4.97K 2.27K 163 0 ufs
680 1.03K 927 1 0 /export/home
683 361 317 2 0 /export/home
686 711 631 1 0 /export/home
692 \fBExample 4 \fRDisplaying File Operation Statistics
695 The following example shows the statistics for each file operation for "/"
696 (using the \fB-f\fR option):
752 .SH ENVIRONMENT VARIABLES
755 See \fBenviron\fR(5) for descriptions of the following environment variables
756 that affect the execution of \fBfsstat\fR: \fBLANG\fR, \fBLC_ALL\fR,
757 \fBLC_CTYPE\fR, \fBLC_MESSAGES\fR, \fBLC_TIME\fR, and \fBNLSPATH\fR.
761 The following exit values are returned:
768 Successful completion.
777 A fatal error occurred. A fatal error could be a failed system call or another
787 Invalid command-line options were specified.
793 See \fBattributes\fR(5) for descriptions of the following attributes:
801 ATTRIBUTE TYPE ATTRIBUTE VALUE
805 Interface Stability See below.
810 The command-line options are Unstable. The human-readable output is not
811 considered an interface.
815 \fBdate\fR(1), \fBtime\fR(2), \fBattributes\fR(5)
819 All display options (\fB-a\fR, \fB-f\fR, \fB-i\fR, \fB-n\fR, \fB-v\fR) are
820 mutually exclusive. Entering more than one of these options will result in an
824 The \fIfstype\fR and \fIpath\fR operands must appear after the option, but
825 before the \fIinterval\fR or \fIcount\fR on the command line. For example,
826 "\fBfsstat\fR \fB-a\fR \fIfstype\fR \fIinterval\fR". Preference is given to
827 \fIfstype\fR so that if a user wishes to see the statistics for a directory
828 that has the same name as an \fIfstype\fR (for example, ufs), then the path
829 must be specified unambiguously (for example, ./ufs). Similarly, in order to
830 define a file with a numeric name (for example, "10") from an interval or count
831 operand, the name should be prefixed accordingly (for example, ./10).
834 When an interval is used, headers repeat after more than 12 lines of statistics
835 have been displayed and the set of lines to be displayed in the current
836 interval have completed.
839 Statistics are not displayed for all pseudo-filesystems. The output displayed
840 with the \fB-F\fR option shows which of the loaded filesystem types are
844 Unbundled file systems may not be recognized by \fBfsstat\fR.
847 The command-line options are classified as Unstable and could change. The
848 output is not considered to be an interface. The construction of higher level
849 software tools depend on either the command-line options or the output of
850 \fBfsstat\fR is not recommended.