On Time RTOS-32 Documentation
Welcome
RTTarget-32
RTKernel-32
RTFiles-32
RTFiles-32 Programming Manual
RTFiles-32 Reference Manual
Introduction
General File I/O
Information about Files
File Attributes
Directories
Finding Files
File Name Operations
Disk and Volume Management
Miscellaneous File Functions
Raw I/O Functions
Functions for Debugging
Function RTFBufferInfo
Function RTFAddBuffers
Function RTFDumpFileTable
Function RTFSetMessageHandler
Function RTFDiagMessage
Device Dependent Functions
Obsolete Functions
Disk Device Driver API
MTD Device Driver API
RTFiles-32 Error Codes
Code Page Reference
RTIP-32
RTPEG-32
RTUSB-32
|
Function RTFBufferInfo
RTFBufferInfo returns information about RTFiles-32's internal buffer cache:
void RTFBufferInfo(RTFBufferStatistic * BufferInfo);
ParametersBufferInfoPointer to structure RTFBufferStatistic defined in Rtfiles.h:
typedef struct {
DWORD TotalBuffers,
ValidBuffers,
DirtyBuffers,
MaxDirtyBuffers,
PhysicalBufferReads,
CachedBufferReads,
BuffersDiscarded,
CacheHits,
PhysicalBufferWrites,
CachedBufferWrites,
AsynchBufferFlushs,
UnbufferedReads,
UnbufferedWrites;
} RTFBufferStatistic;
The counters contain the following values:
Value |
Meaning |
TotalBuffers |
The number of available sector buffers. See Configuring RTFiles-32, section RTFiles-32 Data Tables for information on how to change the number of buffers. |
ValidBuffers |
The number of buffers currently holding valid data. |
DirtyBuffers |
The number of buffers currently holding data which has not yet been written to disk. This value must be 0 when all files are closed. |
MaxDirtyBuffers |
The maximum number of dirty buffers at any one time since program startup. This value should always be less than TotalBuffers. If it is not, consider increasing the number of buffers or avoid excessive use of device flag RTF_DEVICE_LAZY_WRITE or RTFOpen flag RTF_LAZY_DATA. When all buffers are dirty, RTFiles-32 may fail file I/O operations with error RTF_OUT_OF_BUFFERS, since it is not always possible to flush buffers when a new buffer is required. |
PhysicalBufferReads |
The number of sectors read from disk into a buffer since program start. |
CachedBufferReads |
The number of times RTFiles-32 required a sector of data and the required sector was found in the buffer cache (cache hits). |
BuffersDiscarded |
The number of times RTFiles-32 had to discard a valid buffer to accommodate a new sector. When a discarded sector is required at a later time, it must be reread from disk. |
CacheHits |
A percentage value indicating buffer cache efficiency. This value is calculated as 100 * CachedBufferReads / PhysicalBufferReads + CachedBufferReads). |
PhysicalBufferWrites |
The number of times RTFiles-32 has flushed a buffer to disk. |
CachedBufferWrites |
The number of times RTFiles-32 has modified the data in a dirty buffer. Such buffers are either still present in the cache as dirty buffers or they have been flushed at a later time. |
AsynchBufferFlushs |
The number of times a buffer was flushed to disk even though it had been modified in an earlier RTFiles-32 API function call. Such asynchronous buffer flushes will not occur if all files are opened with flag RTF_COMMITTED. |
UnbufferedReads |
The number of sectors read from disk, bypassing RTFiles-32's buffer cache. Such reads occur when the application reads large blocks of data containing complete sectors. |
UnbufferedWrites |
The number of sectors written to disk, bypassing RTFiles-32's buffer cache. Such writes occur when the application writes large blocks of data containing complete sectors. |
Function RTFBufferInfo never fails and does not return a value. All counters start with 0 at program start.
Functions for Debugging
Function RTFAddBuffers
|