Veritas™ File System Programmer's Reference Guide - Solaris
- Veritas File System software developer's kit
- File Change Log
- About the File Change Log file
- Record types
- File Change Log tunables
- Application programming interface for File Change Log
- API functions
- File Change Log record
- Copying File Change Log records
- Veritas File System and File Change Log upgrade and downgrade
- Reverse path name lookup
- Multi-volume support
- Named data streams
- Veritas File System I/O
- Caching advisories
- Extents
- Thin Reclamation
fcl_iostats structure
VxFS 5.0 and later releases let you gather statistics such as the number of reads and 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.
The aggregation considers values only from the latest record from records with the same lastreset time and then sums up the number of reads for each such record.