×
Menu
Index

HDCACHEINFO Subroutine

 
Usage:
info = HDCACHEINFO(num)
 
Description:
Obtains information about a given hard drives (zero-based) cache that was opened by OPEN CACHE.  A non-zero return value indicates a cache was found.  The return value contains several members that provide the information. 
The member names are:
SIZE
Size of the cache in bytes.
MAXIOREQ
Largest I/O request (in bytes) to cache.
FLAGS
Cache flags (Bit 0=Lazy Write, Bit 1=Partial Lazy Write).
READHIT
Number of cache read hits. 
READMISS
Number of cache read misses.
WRITEHIT
Number of cache write hits.
WRITEMISS
Number of cache write misses.
ERRORS
Number of cache aborts (memory or lazy write failure) 
WRITEERRORS
Number of lazy write failures
 
Example:
sub main()
   ext("mount 0: 0 0x01")
   ext("open cache 0")
 
   info=hdcacheinfo(0)
 
   if info then
    printl("Size:", info.size)
    printl("Max IO Request Cached:", info.maxioreq)
    printl("Flags:0x", hex(info.flags))
    printl("Read Hits:", info.readhit)
    printl("Read Misses:", info.readmiss)
    printl("Write Hits:", info.writehit)
    printl("Write Misses:", info.writemiss)
    printl("Errors:", info.errors)
    printl("Lazy Write Errors:", info.writeerrors)
    printl("")
   else
    printl("No cache found")
   end if  
   ext("close cache 0")
   ext("umount 0:")
end sub