Veritas™ File System 5.0.1 Programmer's Reference Guide

fcl_iostats structure
VxFS 5.0 lets you gather statistics such as the number of reads / writes occurring
on a file. You can enable this through the fiostat command. The gathered stats
are maintained in a per-file in-core structure and the File Change Log acts as a
persistent backing store for the statistics.
The stats are written to the FCL under the following circumstances:
When the in-core structures need to be freed
When the stats are reset
At periodic intervals
These statistics can be read from the FCL as VX_FCL_FILESTAT records. Each record
contains information as defined by the following fcl_iostat structure:
struct fcl_iostats {
uint64_t nbytesread; /* Number of bytes read from the file*/
uint64_t nbyteswrite;/* Number of bytes written to the file*/
uint32_t nreads; /* Number of reads from the file */
uint32_t nwrites; /* Number of writes to the file */
uint32_t readtime; /* Total time in seconds for the reads */
uint32_t writetime; /* Total time in seconds for the writes */
struct {
uint32_t tv_sec;
uint32_t tv_nsec;
} lastreset;/* Last reset time for the stats */
uint32_tnodeid; /* Node from which the record was written */
uint32_treset; /* Stats have been written due to a reset */
};
Each iostat record in the FCL contains I/O statistics accumulated over the time
interval from the lastreset time to when the FCL record is written.
Over a period of time, the cumulative statistics and aggregate can be computed
by the following:
Traversing the FCL
Looking for records of type VX_FCL_FILESTATS
For example, computing the aggregate for the total number of reads over a period
of time requires traversing a set of FCL files to obtain I/O statistics records. This
informations contains a sequence of records of the type VX_FCL_FILESTATS with
the same lastreset time followed by another sequence of records with a later
lastreset time for a specific file.
File Change Log
Application programming interface for File Change Log
38