diff --git a/smartmontools/ChangeLog b/smartmontools/ChangeLog index d06f14c87e6447b9757f910c69cc2b94097ab7f8..9d233f4f497cbfba3a3bbc395181ed9e61d8d8bd 100644 --- a/smartmontools/ChangeLog +++ b/smartmontools/ChangeLog @@ -1,5 +1,13 @@ $Id$ +2022-02-16 Douglas Gilbert <dgilbert@interlog.com> + + smartctl.cpp: add new --log=tapedevstat to print out SCSI + Tape (SSC) Device Statistics log page. '-a' does not include + this log page, but '-x' does. May add new --log= option + soon (probably 'tapealert' which must be invoked explicitly); + manpage needs updating + 2022-02-09 Alex Samorukov <samm@os2.kiev.ua> Remove cppcheck 2.7 warning as we are using it now on our CI builds diff --git a/smartmontools/scsiprint.cpp b/smartmontools/scsiprint.cpp index 3f77f48a6884683b08b22db284e0e18dcb5f9147..6a2a1daceacfccb0eb4384e3de1b615fc4384c8b 100644 --- a/smartmontools/scsiprint.cpp +++ b/smartmontools/scsiprint.cpp @@ -3441,7 +3441,7 @@ scsiPrintMain(scsi_device * device, const scsi_print_options & options) any_output = true; } - if (options.smart_background_log && is_tape) { + if (options.tape_device_stats && is_tape) { if (! checkedSupportedLogPages) scsiGetSupportedLogPages(device); res = 0; diff --git a/smartmontools/scsiprint.h b/smartmontools/scsiprint.h index 41a398a6d89b7585a046d103f51ac903b0da2b6f..5449257dc4221c85b2002b3a9891bd2ce1db970f 100644 --- a/smartmontools/scsiprint.h +++ b/smartmontools/scsiprint.h @@ -41,6 +41,8 @@ struct scsi_print_options bool smart_env_rep = false; bool sasphy = false, sasphy_reset = false; + + bool tape_device_stats = false; bool get_wce = false, get_rcd = false; short int set_wce = 0, set_rcd = 0; // disable(-1), enable(1) cache diff --git a/smartmontools/smartctl.cpp b/smartmontools/smartctl.cpp index 6e65f9d38d4e053a3fa604b662e0017c36df0234..2f7cbe5ccc2508549dcc1804df328b76feb2d4d0 100644 --- a/smartmontools/smartctl.cpp +++ b/smartmontools/smartctl.cpp @@ -177,7 +177,8 @@ static void Usage() " xerror[,N][,error], xselftest[,N][,selftest], background,\n" " sasphy[,reset], sataphy[,reset], scttemp[sts,hist],\n" " scttempint,N[,p], scterc[,N,M][,p|reset], devstat[,N], defects[,N],\n" -" ssd, gplog,N[,RANGE], smartlog,N[,RANGE], nvmelog,N,SIZE\n\n" +" ssd, gplog,N[,RANGE], smartlog,N[,RANGE], nvmelog,N,SIZE\n" +" tapedevstat\n\n" " -v N,OPTION , --vendorattribute=N,OPTION (ATA)\n" " Set display OPTION for vendor Attribute N (see man page)\n\n" " -F TYPE, --firmwarebug=TYPE (ATA)\n" @@ -245,7 +246,7 @@ static std::string getvalidarglist(int opt) "scttemp[sts,hist], scttempint,N[,p], " "scterc[,N,M][,p|reset], devstat[,N], defects[,N], " "ssd, gplog,N[,RANGE], smartlog,N[,RANGE], " - "nvmelog,N,SIZE"; + "nvmelog,N,SIZE, tapedevstat"; case 'P': return "use, ignore, show, showall"; case 't': @@ -549,6 +550,8 @@ static int parse_options(int argc, char** argv, const char * & type, ataopts.sct_temp_sts = true; } else if (!strcmp(optarg,"scttemphist")) { ataopts.sct_temp_hist = true; + } else if (!strcmp(optarg,"tapedevstat")) { + scsiopts.tape_device_stats = true; } else if (!strncmp(optarg, "scttempint,", sizeof("scstempint,")-1)) { unsigned interval = 0; int n1 = -1, n2 = -1, len = strlen(optarg); @@ -739,6 +742,7 @@ static int parse_options(int argc, char** argv, const char * & type, scsiopts.smart_ss_media_log = true; scsiopts.sasphy = true; scsiopts.smart_env_rep = true; + scsiopts.tape_device_stats = true; if (!output_format_set) ataopts.output_format |= ata_print_options::FMT_BRIEF; break;