From aaabbaa2824176e586427115d7d373d7165b170a Mon Sep 17 00:00:00 2001 From: Ryan Chane <103678133+rchane@users.noreply.github.com> Date: Thu, 18 Jul 2024 14:09:03 -0700 Subject: [PATCH] CR-1206429 xrt-smi output and help menu fixes (#8297) Signed-off-by: Ryan Chane --- src/runtime_src/core/tools/common/XBMain.cpp | 1 + src/runtime_src/core/tools/common/reports/ReportHost.cpp | 6 +++--- .../tools/common/reports/platform/ReportRyzenPlatform.cpp | 4 ++-- src/runtime_src/core/tools/xbutil2/SubCmdValidate.cpp | 6 +++--- 4 files changed, 9 insertions(+), 8 deletions(-) diff --git a/src/runtime_src/core/tools/common/XBMain.cpp b/src/runtime_src/core/tools/common/XBMain.cpp index a57d159c7eb..2ce7caf40ac 100644 --- a/src/runtime_src/core/tools/common/XBMain.cpp +++ b/src/runtime_src/core/tools/common/XBMain.cpp @@ -151,6 +151,7 @@ void main_(int argc, char** argv, XBU::report_commands_help( _executable, _description, globalOptions, hiddenOptions, parsedSubCmds); if (!bHelp && !sCmd.empty()) throw xrt_core::error(std::errc::operation_canceled); + return; } // -- Prepare the data diff --git a/src/runtime_src/core/tools/common/reports/ReportHost.cpp b/src/runtime_src/core/tools/common/reports/ReportHost.cpp index 308903e65c8..2e50c78366e 100644 --- a/src/runtime_src/core/tools/common/reports/ReportHost.cpp +++ b/src/runtime_src/core/tools/common/reports/ReportHost.cpp @@ -127,8 +127,8 @@ ReportHost::writeReport(const xrt_core::device* /*_pDevice*/, % lib.get("version", "N/A"); } _output << boost::format(" %-20s : %s\n") % "Model" % _pt.get("host.os.model"); - _output << boost::format(" %-20s : %s\n") % "BIOS vendor" % _pt.get("host.os.bios_vendor"); - _output << boost::format(" %-20s : %s\n") % "BIOS version" % _pt.get("host.os.bios_version"); + _output << boost::format(" %-20s : %s\n") % "BIOS Vendor" % _pt.get("host.os.bios_vendor"); + _output << boost::format(" %-20s : %s\n") % "BIOS Version" % _pt.get("host.os.bios_version"); _output << std::endl; _output << "XRT\n"; _output << boost::format(" %-20s : %s\n") % "Version" % _pt.get("host.xrt.version", "N/A"); @@ -169,7 +169,7 @@ ReportHost::writeReport(const xrt_core::device* /*_pDevice*/, //no device available } - _output << std::endl << "Devices present\n"; + _output << std::endl << "Device(s) Present\n"; if (available_devices.empty()) _output << " 0 devices found" << std::endl; diff --git a/src/runtime_src/core/tools/common/reports/platform/ReportRyzenPlatform.cpp b/src/runtime_src/core/tools/common/reports/platform/ReportRyzenPlatform.cpp index 450bf730ff4..3497d924870 100644 --- a/src/runtime_src/core/tools/common/reports/platform/ReportRyzenPlatform.cpp +++ b/src/runtime_src/core/tools/common/reports/platform/ReportRyzenPlatform.cpp @@ -50,7 +50,7 @@ ReportRyzenPlatform::writeReport(const xrt_core::device* /*_pDevice*/, _output << boost::format(" %-23s: %s \n") % "Name" % pt_static_region.get("name"); const boost::property_tree::ptree& pt_status = pt_platform.get_child("status"); - _output << boost::format(" %-23s: %s \n") % "Performance Mode" % pt_status.get("performance_mode"); + _output << boost::format(" %-23s: %s \n") % "Power Mode" % pt_status.get("performance_mode"); const boost::property_tree::ptree& clocks = pt_platform.get_child("clocks", empty_ptree); if (!clocks.empty()) { @@ -63,7 +63,7 @@ ReportRyzenPlatform::writeReport(const xrt_core::device* /*_pDevice*/, } auto watts = pt_platform.get("electrical.power_consumption_watts", "N/A"); - _output << std::endl << boost::format("%-23s: %s Watts\n") % "Power" % watts; + _output << std::endl << boost::format("%-23s : %s Watts\n") % "Power" % watts; } _output << std::endl; diff --git a/src/runtime_src/core/tools/xbutil2/SubCmdValidate.cpp b/src/runtime_src/core/tools/xbutil2/SubCmdValidate.cpp index 8a33527373e..482271a2964 100644 --- a/src/runtime_src/core/tools/xbutil2/SubCmdValidate.cpp +++ b/src/runtime_src/core/tools/xbutil2/SubCmdValidate.cpp @@ -286,7 +286,7 @@ get_platform_info(const std::shared_ptr& device, oStream << boost::format(" %-22s: %s\n") % "Platform ID" % plat_id; const std::string& perf_mode = ptTree.get("performance_mode", ""); if (!perf_mode.empty()) - oStream << boost::format(" %-22s: %s\n") % "Performance Mode" % perf_mode; + oStream << boost::format(" %-22s: %s\n") % "Power Mode" % perf_mode; const std::string& power = ptTree.get("power", ""); if (!boost::starts_with(power, "")) oStream << boost::format(" %-22s: %s Watts\n") % "Power" % power; @@ -449,7 +449,7 @@ SubCmdValidate::SubCmdValidate(bool _isHidden, bool _isDepricated, bool _isPreli m_commonOptions.add(common_options); m_commonOptions.add_options() - ("run,r", boost::program_options::value(&m_tests_to_run)->multitoken(), (std::string("Run a subset of the test suite. Valid options are:\n") + formatRunValues).c_str() ) + ("run,r", boost::program_options::value(&m_tests_to_run)->multitoken(), (std::string("Run a subset of the test suite. Valid options are:\n") + formatRunValues).c_str() ) ; } @@ -512,7 +512,7 @@ SubCmdValidate::print_help_internal() const static const std::string testOptionValues = XBU::create_suboption_list_map(deviceClass, jsonOptions, help_tests); std::vector tempVec; common_options.add_options() - ("report,r", boost::program_options::value(&tempVec)->multitoken(), (std::string("The type of report to be produced. Reports currently available are:\n") + testOptionValues).c_str() ) + ("run,r", boost::program_options::value(&tempVec)->multitoken(), (std::string("Run a subset of the test suite. Valid options are:\n") + testOptionValues).c_str() ) ; printHelp(common_options, m_hiddenOptions, deviceClass, false, extendedKeysOptions()); }