H5P_SET_FAPL_LOG modifies the file access property list to use the logging driver,
H5FD_LOG. The logging virtual file driver (VFD) is a clone of the standard SEC2 (
H5FD_SEC2) driver with additional facilities for logging VFD metrics and activity to a file.
logfile is the name of the file in which the logging entries are to be recorded.
The actions to be logged are specified in the parameter
flags using the pre-defined constants described in the following table. Multiple flags can be set through the use of a logical OR contained in parentheses. For example, logging read and write locations would be specified as
Table 1: Logging flags
Track the location and length of every read, write, or seek operation.
Track all I/O locations and lengths. The logical equivalent of the following:
(H5FD_LOG_LOC_READ | H5FD_LOG_LOC_WRITE | H5FD_LOG_LOC_SEEK)
Track the number of times each byte is read or written.
Track the number of times each byte is read and written. The logical equivalent of the following:
(H5FD_LOG_FILE_READ | H5FD_LOG_FILE_WRITE)
Track the type, or flavor, of information stored at each byte.
Track the total number of read, write, seek, or truncate operations that occur.
Track the total number of all types of I/O operations. The logical equivalent of the following:
(H5FD_LOG_NUM_READ | H5FD_LOG_NUM_WRITE | H5FD_LOG_NUM_SEEK | H5FD_LOG_NUM_TRUNCATE)
Track the time spent in open, stat, read, write, seek, or close operations.
Track the time spent in each of the above operations. The logical equivalent of the following:
(H5FD_LOG_TIME_OPEN | H5FD_LOG_TIME_STAT | H5FD_LOG_TIME_READ | H5FD_LOG_TIME_WRITE | H5FD_LOG_TIME_SEEK | H5FD_LOG_TIME_CLOSE)
Track the allocation of space in the file.
Track everything. The logical equivalent of the following:
(H5FD_LOG_ALLOC | H5FD_LOG_TIME_IO | H5FD_LOG_NUM_IO | H5FD_LOG_FLAVOR | H5FD_LOG_FILE_IO | H5FD_LOG_LOC_IO)
The logging driver can track the number of times each byte in the file is read from or written to (using
H5FD_LOG_FILE_WRITE) and what kind of data is at that location (e.g., metadata, raw data; using
H5FD_LOG_FLAVOR). This information is tracked in internal buffers of size
buf_size, which must be at least the maximum size in bytes of the file to be logged while the log driver is in use.
One buffer of size
buf_size will be created for each of
H5FD_LOG_FLAVOR when those flags are set; these buffers will not grow as the file increases in size.