diff --git a/include/openseachest_util_options.h b/include/openseachest_util_options.h index d955fad..2c41a5e 100644 --- a/include/openseachest_util_options.h +++ b/include/openseachest_util_options.h @@ -1957,6 +1957,12 @@ extern "C" #define SHOW_CONCURRENT_RANGES_LONG_OPT_STRING "showConcurrentRanges" #define SHOW_CONCURRENT_RANGES_LONG_OPT { SHOW_CONCURRENT_RANGES_LONG_OPT_STRING, no_argument, &SHOW_CONCURRENT_RANGES, goTrue } + //SATA Phy event counters + #define SHOW_PHY_EVENT_COUNTERS showSataPhyEventCounters + #define SHOW_PHY_EVENT_COUNTERS_VAR getOptBool SHOW_PHY_EVENT_COUNTERS = goFalse; + #define SHOW_PHY_EVENT_COUNTERS_LONG_OPT_STRING "showPhyEvents" + #define SHOW_PHY_EVENT_COUNTERS_LONG_OPT { SHOW_PHY_EVENT_COUNTERS_LONG_OPT_STRING, no_argument, &SHOW_PHY_EVENT_COUNTERS, goTrue } + //SCSI/NVMe reservations #define SHOW_RESERVATION_CAPABILITIES showReservationCapabilities #define SHOW_RESERVATION_CAPABILITIES_VAR getOptBool SHOW_RESERVATION_CAPABILITIES = goFalse; @@ -3550,6 +3556,8 @@ extern "C" void print_DCO_Disable_Features_Help(bool shortHelp); + void print_Show_Phy_Event_Counters_Help(bool shortHelp); + void print_WRV_Help(bool shortHelp); #define OUTPUTPATH_PARSE outputPathPtr = optarg; diff --git a/src/openseachest_util_options.c b/src/openseachest_util_options.c index f26a020..bbc5884 100644 --- a/src/openseachest_util_options.c +++ b/src/openseachest_util_options.c @@ -1094,6 +1094,16 @@ void print_Show_NVM_Power_States_Help(bool shortHelp) } } +void print_Show_Phy_Event_Counters_Help(bool shortHelp) +{ + printf("\t--%s\t(SATA Only)\n", SHOW_PHY_EVENT_COUNTERS_LONG_OPT_STRING); + if (!shortHelp) + { + printf("\t\tUse this option to display a SATA device's supported\n"); + printf("\t\tevent counters.\n\n"); + } +} + void print_Transition_Power_Help(bool shortHelp) { printf("\t--%s [active | idle | idleUnload | standby | idle_a | idle_b | idle_c | standby_y | standby_z | sleep]\n", TRANSITION_POWER_MODE_LONG_OPT_STRING); diff --git a/subprojects/opensea-operations b/subprojects/opensea-operations index 1f94772..3e07566 160000 --- a/subprojects/opensea-operations +++ b/subprojects/opensea-operations @@ -1 +1 @@ -Subproject commit 1f9477265993556d47244577b0b7e4261673e2bb +Subproject commit 3e0756670c6501a3bf7771908afad3048b37550d diff --git a/subprojects/opensea-transport b/subprojects/opensea-transport index 45390e6..9987849 160000 --- a/subprojects/opensea-transport +++ b/subprojects/opensea-transport @@ -1 +1 @@ -Subproject commit 45390e6689d847831a5b7a91b6cca8b2b6463e5c +Subproject commit 99878499e799177751ff0935a9264dae425bfcda diff --git a/utils/C/openSeaChest/openSeaChest_Info.c b/utils/C/openSeaChest/openSeaChest_Info.c index ae05a6f..6f03c50 100644 --- a/utils/C/openSeaChest/openSeaChest_Info.c +++ b/utils/C/openSeaChest/openSeaChest_Info.c @@ -31,11 +31,12 @@ #include "csmi_helper_func.h" #endif #include "partition_info.h" +#include "sata_phy.h" //////////////////////// // Global Variables // //////////////////////// const char *util_name = "openSeaChest_Info"; -const char *buildVersion = "2.5.0"; +const char *buildVersion = "2.6.0"; //////////////////////////// // functions to declare // @@ -96,6 +97,7 @@ int32_t main(int argc, char *argv[]) SHOW_CONCURRENT_RANGES_VAR LOWLEVEL_INFO_VAR PARTITION_INFO_VAR + SHOW_PHY_EVENT_COUNTERS_VAR int args = 0; int argIndex = 0; @@ -138,6 +140,7 @@ int32_t main(int argc, char *argv[]) #endif SHOW_CONCURRENT_RANGES_LONG_OPT, PARTITION_INFO_LONG_OPT, + SHOW_PHY_EVENT_COUNTERS_LONG_OPT, LONG_OPT_TERMINATOR }; @@ -559,6 +562,7 @@ int32_t main(int argc, char *argv[]) #endif || SHOW_CONCURRENT_RANGES || PARTITION_INFO_FLAG + || SHOW_PHY_EVENT_COUNTERS )) { utility_Usage(true); @@ -982,6 +986,32 @@ int32_t main(int argc, char *argv[]) } } + if (SHOW_PHY_EVENT_COUNTERS) + { + sataPhyEventCounters events; + memset(&events, 0, sizeof(sataPhyEventCounters)); + switch (get_SATA_Phy_Event_Counters(&deviceList[deviceIter], &events)) + { + case SUCCESS: + print_SATA_Phy_Event_Counters(&events); + break; + case NOT_SUPPORTED: + if (VERBOSITY_QUIET < toolVerbosity) + { + printf("Phy event counters are not supported on this device.\n"); + } + exitCode = UTIL_EXIT_OPERATION_NOT_SUPPORTED; + break; + default: + if (VERBOSITY_QUIET < toolVerbosity) + { + printf("Failed to read the Phy event counters.\n"); + } + exitCode = UTIL_EXIT_OPERATION_FAILURE; + break; + } + } + //At this point, close the device handle since it is no longer needed. Do not put any further IO below this. close_Device(&deviceList[deviceIter]); } @@ -1072,6 +1102,7 @@ void utility_Usage(bool shortUsage) print_Partition_Info_Help(shortUsage); //SATA Only Options printf("\n\tSATA Only:\n\t=========\n"); + print_Show_Phy_Event_Counters_Help(shortUsage); print_SMART_Attributes_Help(shortUsage); //SAS Only Options printf("\n\tSAS Only:\n\t=========\n");