The Fermi Tape Tools library is a C subroutine package that provides consistent, platform-independent tape I/O for a variety of tape drives on a variety of platforms . In the most recent releases of FTT, function are available which allow users to store the history of various statistics during the tape usage. This FTT Appendix C provides descriptions of these FTT calls and also provides a complete call reference of the routines.
Additional Tape Statistics Functions
stat | Description | Notes | Origin |
FTT_VENDOR_ID | Vendor id data | string | Drive:SCSI Inquiry |
FTT_PRODUCT_ID | Product id | string | Drive:SCSI Inquiry |
FTT_FIRMWARE | Firmware rev level | string | Drive:SCSI Inquiry |
FTT_SERIAL_NUM | Device serial number | string | Drive:SCSI2 Inquiry |
FTT_READ_COUNT | KB read since rewind/reset | counter | Drive:SCSI ReqSense(EXB spec) |
FTT_WRITE_COUNT | KB written since rewind/reset | counter | (see above) |
FTT_READ_ERRORS | Read errors - drive corrected | counter | (see above) |
FTT_WRITE_ERRORS | Write errors - drive corrected | counter | (see above) |
FTT_REMAIN_TAPE | Remaining KB of tape | counter | Drive: SCSI ReqSense |
FTT_USER_READ | KB read since open/unload | counter | Ftt: d->readkb |
FTT_USER_WRITE | KB written since open/unload | counter | Ftt: d->writekb |
FTT_DENSITY | Tape density | numeric | Drive:SCSI Mode Sense |
FTT_UNDERRUN | Stop/start counter | numeric | (see above) |
FTT_MOTION_HOUR | Hours tape drive is in motion | counter | Drive:SCSI ReqSense(DLT spec) |
FTT_POWER_HOURS | Hours device has been on | counter | Drive:SCSI ReqSense(DLT spec) |
FTT_COUNT_ORIGIN | Origin of read/write kb | string | Ftt |
FTT_N_READS | Number of read calls | counter | Ftt: d->nreads |
FTT_N_WRITES | Number of write and writefm calls | counter | Ftt: d->nwrites |
FTT_RETRIES | Total ftt_retry() repeats | counter | Ftt: |
FTT_FAIL_RETRIES | Total ftt_retry() failures | counter | Ftt |
FTT_RESETS | Unexpected BOT discoveries | counter | Ftt |
FTT_HARD_ERRORS | Counter of recovered errors | counter | Ftt |
FTT_UNC_READ | Non_compressed bytes read | counter | Ftt |
FTT_UNC_WRITE | Non_compressed bytes written | counter | Ftt |
FTT_CMP_READ | Compressed bytes read | counter | Ftt |
FTT_CMP_WRITE | Compressed bytes written | counter | Ftt |
Example:
#include "ftt.h" ftt_statdb_buf *stbuff; stbuff = ftt_alloc_statdbs();
Example:
#include "ftt.h" ftt_statdb_buf stbuff; stbuff = ftt_alloc_statdb();
Example:
#include "ftt.h" int status; ftt_statdb_buf* stbuff; status = ftt_free_statdbs(stbuff);
Example:
#include "ftt.h" ftt_statdb_buf *stbuff; stbuff = ftt_init_statdb(ftt_descriptor d);
Example:
#include "ftt.h" ftt_statdb_buf *bp; ftt_descriptor d int status; bp = ftt_init_statdb(d); /* do some i/o tape operations */ status = ftt_update_statdb(d, bp);
Example:
#include "ftt.h" int status; ftt_descriptor d; ftt_statdb_buf stbuff; stbuff = ftt_alloc_statdb(); status = ftt_get_statdb(d,stbuff);
#include <stdio.h> #include "ftt.h" char *name; /* name of extracted stat */ ftt_stat_buf *stbuff; /* statistic's database buffer */ FILE *outfile; int status, ftt_status; /* status of ftt calls */ char *estring; /* error string */
stbuff = ftt_init_statdb(d); /* do some i/o tape operation here */ status = ftt_update_statdb(d,stbuff); /* update statistical database (as often as needed) */ outfile = fopen (filename,"w"); status = ftt_extract_statdb(stbuff, outfile, FTT_REMAIN_TAPE); fclose(outfile);
Example:
#include <stdio.h> #include "ftt.h" int status; ftt_descriptor d; ftt_stat_buf stbuff; FILE = *outfile; stbuff = ftt_alloc_statdb(); status = ftt_get_statdb(d,stbuff); status status = ftt_dump_statdb (stbuff, outfile);
Example:
#include <stdio.h> #include "ftt.h" int status; ftt_descriptor d; ftt_stat_buf *stbuff; FILE = *outfile; stbuff = ftt_init_statdb(d); status = ftt_update_statdb(d,stbuff); status = ftt_dump_statdbs (stbuff, outfile);
Example:
#include <stdio.h> #include "ftt.h" int status; ftt_descriptor d; FILE = *outfile; status = ftt_dump_rsdata (d, outfile);