diff --git a/level_zero/tools/source/sysman/linux/pmt/pmt.cpp b/level_zero/tools/source/sysman/linux/pmt/pmt.cpp index 60fef21b57..90c3951957 100644 --- a/level_zero/tools/source/sysman/linux/pmt/pmt.cpp +++ b/level_zero/tools/source/sysman/linux/pmt/pmt.cpp @@ -22,9 +22,6 @@ const std::string PlatformMonitoringTech::baseTelemSysFS("/sys/class/intel_pmt") const std::string PlatformMonitoringTech::telem("telem"); uint32_t PlatformMonitoringTech::rootDeviceTelemNodeIndex = 0; -std::string PlatformMonitoringTech::getGuid() { - return guid; -} ze_result_t PlatformMonitoringTech::readValue(const std::string key, uint32_t &value) { auto offset = keyOffsetMap.find(key); if (offset == keyOffsetMap.end()) { @@ -149,6 +146,7 @@ ze_result_t PlatformMonitoringTech::init(FsAccess *pFsAccess, const std::string return ZE_RESULT_ERROR_DEPENDENCY_UNAVAILABLE; } + std::string guid; std::string guidPath = baseTelemSysFSNode + std::string("/guid"); ze_result_t result = pFsAccess->read(guidPath, guid); if (ZE_RESULT_SUCCESS != result) { diff --git a/level_zero/tools/source/sysman/linux/pmt/pmt.h b/level_zero/tools/source/sysman/linux/pmt/pmt.h index e993af7272..d4c337dfc3 100644 --- a/level_zero/tools/source/sysman/linux/pmt/pmt.h +++ b/level_zero/tools/source/sysman/linux/pmt/pmt.h @@ -28,7 +28,6 @@ class PlatformMonitoringTech : NEO::NonCopyableOrMovableClass { virtual ze_result_t readValue(const std::string key, uint32_t &value); virtual ze_result_t readValue(const std::string key, uint64_t &value); static ze_result_t enumerateRootTelemIndex(FsAccess *pFsAccess, std::string &gpuUpstreamPortPath); - std::string getGuid(); static void create(const std::vector &deviceHandles, FsAccess *pFsAccess, std::string &gpuUpstreamPortPath, std::map &mapOfSubDeviceIdToPmtObject); @@ -38,7 +37,6 @@ class PlatformMonitoringTech : NEO::NonCopyableOrMovableClass { static uint32_t rootDeviceTelemNodeIndex; std::string telemetryDeviceEntry{}; std::map keyOffsetMap; - std::string guid; ze_result_t init(FsAccess *pFsAccess, const std::string &gpuUpstreamPortPath, PRODUCT_FAMILY productFamily); static void doInitPmtObject(FsAccess *pFsAccess, uint32_t subdeviceId, PlatformMonitoringTech *pPmt, const std::string &gpuUpstreamPortPath, std::map &mapOfSubDeviceIdToPmtObject, PRODUCT_FAMILY productFamily); diff --git a/level_zero/tools/source/sysman/memory/linux/os_memory_imp_prelim.cpp b/level_zero/tools/source/sysman/memory/linux/os_memory_imp_prelim.cpp index 85e1d3cca2..c059c8eb29 100644 --- a/level_zero/tools/source/sysman/memory/linux/os_memory_imp_prelim.cpp +++ b/level_zero/tools/source/sysman/memory/linux/os_memory_imp_prelim.cpp @@ -260,10 +260,6 @@ ze_result_t LinuxMemoryImp::getHbmBandwidth(uint32_t numHbmModules, zes_mem_band } ze_result_t LinuxMemoryImp::getHbmBandwidthPVC(uint32_t numHbmModules, zes_mem_bandwidth_t *pBandwidth) { - std::string guid = pPmt->getGuid(); - if (guid != guid64BitMemoryCounters) { - return getHbmBandwidth(numHbmModules, pBandwidth); - } pBandwidth->readCounter = 0; pBandwidth->writeCounter = 0; pBandwidth->timestamp = 0; diff --git a/level_zero/tools/source/sysman/sysman_const.h b/level_zero/tools/source/sysman/sysman_const.h index e475be2437..5a8c4c35b9 100644 --- a/level_zero/tools/source/sysman/sysman_const.h +++ b/level_zero/tools/source/sysman/sysman_const.h @@ -11,7 +11,6 @@ const std::string vendorIntel("Intel(R) Corporation"); const std::string unknown("unknown"); const std::string intelPciId("0x8086"); -const std::string guid64BitMemoryCounters("0xb15a0ede"); constexpr uint32_t MbpsToBytesPerSecond = 125000; constexpr double milliVoltsFactor = 1000.0; constexpr uint32_t maxRasErrorCategoryCount = 7; diff --git a/level_zero/tools/test/unit_tests/sources/sysman/memory/linux/mock_memory_prelim.h b/level_zero/tools/test/unit_tests/sources/sysman/memory/linux/mock_memory_prelim.h index b7043e1439..63264878b7 100644 --- a/level_zero/tools/test/unit_tests/sources/sysman/memory/linux/mock_memory_prelim.h +++ b/level_zero/tools/test/unit_tests/sources/sysman/memory/linux/mock_memory_prelim.h @@ -243,7 +243,6 @@ struct MockMemoryNeoDrm : public Drm { struct MockMemoryPmt : public PlatformMonitoringTech { - using PlatformMonitoringTech::guid; using PlatformMonitoringTech::keyOffsetMap; std::vector mockReadValueReturnStatus{}; std::vector mockReadArgumentValue{}; @@ -254,9 +253,7 @@ struct MockMemoryPmt : public PlatformMonitoringTech { bool mockVfid0Status = false; bool mockVfid1Status = false; bool isRepeated = false; - void setGuid(std::string guid) { - this->guid = guid; - } + MockMemoryPmt(FsAccess *pFsAccess, ze_bool_t onSubdevice, uint32_t subdeviceId) : PlatformMonitoringTech(pFsAccess, onSubdevice, subdeviceId) {} ze_result_t readValue(const std::string key, uint32_t &val) override { ze_result_t result = ZE_RESULT_SUCCESS; diff --git a/level_zero/tools/test/unit_tests/sources/sysman/memory/linux/test_sysman_memory_prelim.cpp b/level_zero/tools/test/unit_tests/sources/sysman/memory/linux/test_sysman_memory_prelim.cpp index dfd7dfe96f..cfe205df03 100644 --- a/level_zero/tools/test/unit_tests/sources/sysman/memory/linux/test_sysman_memory_prelim.cpp +++ b/level_zero/tools/test/unit_tests/sources/sysman/memory/linux/test_sysman_memory_prelim.cpp @@ -407,7 +407,7 @@ HWTEST2_F(SysmanDeviceMemoryFixture, GivenValidMemoryHandleWhenCallingzesSysmanM auto &productHelper = pLinuxSysmanImp->getDeviceHandle()->getNEODevice()->getProductHelper(); hwInfo->platform.usRevId = productHelper.getHwRevIdFromStepping(REVISION_B, *hwInfo); auto pPmt = static_cast(pLinuxSysmanImp->getPlatformMonitoringTechAccess(properties.subdeviceId)); - pPmt->setGuid(guid64BitMemoryCounters); + pPmt->mockVfid0Status = true; pSysfsAccess->mockReadUInt64Value.push_back(hbmRP0Frequency); pSysfsAccess->mockReadReturnStatus.push_back(ZE_RESULT_SUCCESS); @@ -441,7 +441,7 @@ HWTEST2_F(SysmanDeviceMemoryFixture, GivenValidMemoryHandleWhenCallingzesSysmanM auto &productHelper = pLinuxSysmanImp->getDeviceHandle()->getNEODevice()->getProductHelper(); hwInfo->platform.usRevId = productHelper.getHwRevIdFromStepping(REVISION_B, *hwInfo); auto pPmt = static_cast(pLinuxSysmanImp->getPlatformMonitoringTechAccess(properties.subdeviceId)); - pPmt->setGuid(guid64BitMemoryCounters); + pPmt->mockVfid1Status = true; pSysfsAccess->mockReadUInt64Value.push_back(hbmRP0Frequency); pSysfsAccess->mockReadReturnStatus.push_back(ZE_RESULT_SUCCESS); @@ -471,7 +471,6 @@ HWTEST2_F(SysmanDeviceMemoryFixture, GivenValidMemoryHandleWhenCallingzesSysmanM zes_mem_bandwidth_t bandwidth; auto pPmt = static_cast(pLinuxSysmanImp->getPlatformMonitoringTechAccess(properties.subdeviceId)); - pPmt->setGuid(guid64BitMemoryCounters); pPmt->mockReadArgumentValue.push_back(1); pPmt->mockReadValueReturnStatus.push_back(ZE_RESULT_SUCCESS); // Return success after reading VF0_VFID pPmt->mockReadArgumentValue.push_back(0); @@ -482,24 +481,6 @@ HWTEST2_F(SysmanDeviceMemoryFixture, GivenValidMemoryHandleWhenCallingzesSysmanM } } -HWTEST2_F(SysmanDeviceMemoryFixture, GivenValidMemoryHandleWhenCallingzesSysmanMemoryGetBandwidthAndVF0_VFIDFailsForOldGuidThenFailureIsReturned, IsPVC) { - setLocalSupportedAndReinit(true); - auto handles = getMemoryHandles(memoryHandleComponentCount); - - for (auto &handle : handles) { - zes_mem_properties_t properties = {}; - zesMemoryGetProperties(handle, &properties); - - zes_mem_bandwidth_t bandwidth; - - auto pPmt = static_cast(pLinuxSysmanImp->getPlatformMonitoringTechAccess(properties.subdeviceId)); - pPmt->setGuid("0xb15a0edd"); - pPmt->mockReadArgumentValue.push_back(1); - pPmt->mockReadValueReturnStatus.push_back(ZE_RESULT_ERROR_UNSUPPORTED_FEATURE); - EXPECT_EQ(zesMemoryGetBandwidth(handle, &bandwidth), ZE_RESULT_ERROR_UNSUPPORTED_FEATURE); - } -} - HWTEST2_F(SysmanDeviceMemoryFixture, GivenValidMemoryHandleWhenCallingzesSysmanMemoryGetBandwidthAndVF0_HBM_READ_HFailsThenFailureIsReturned, IsPVC) { setLocalSupportedAndReinit(true); auto handles = getMemoryHandles(memoryHandleComponentCount); @@ -511,7 +492,6 @@ HWTEST2_F(SysmanDeviceMemoryFixture, GivenValidMemoryHandleWhenCallingzesSysmanM zes_mem_bandwidth_t bandwidth; auto pPmt = static_cast(pLinuxSysmanImp->getPlatformMonitoringTechAccess(properties.subdeviceId)); - pPmt->setGuid(guid64BitMemoryCounters); pPmt->mockReadArgumentValue.push_back(1); pPmt->mockReadValueReturnStatus.push_back(ZE_RESULT_SUCCESS); // Return success after reading VF0_VFID pPmt->mockReadArgumentValue.push_back(0); @@ -535,7 +515,6 @@ HWTEST2_F(SysmanDeviceMemoryFixture, GivenValidMemoryHandleWhenCallingzesSysmanM zes_mem_bandwidth_t bandwidth; auto pPmt = static_cast(pLinuxSysmanImp->getPlatformMonitoringTechAccess(properties.subdeviceId)); - pPmt->setGuid(guid64BitMemoryCounters); pPmt->mockReadArgumentValue.push_back(1); pPmt->mockReadValueReturnStatus.push_back(ZE_RESULT_SUCCESS); // Return success after reading VF0_VFID pPmt->mockReadArgumentValue.push_back(0); @@ -561,7 +540,6 @@ HWTEST2_F(SysmanDeviceMemoryFixture, GivenValidMemoryHandleWhenCallingzesSysmanM zes_mem_bandwidth_t bandwidth; auto pPmt = static_cast(pLinuxSysmanImp->getPlatformMonitoringTechAccess(properties.subdeviceId)); - pPmt->setGuid(guid64BitMemoryCounters); pPmt->mockReadArgumentValue.push_back(1); pPmt->mockReadValueReturnStatus.push_back(ZE_RESULT_SUCCESS); // Return success after reading VF0_VFID pPmt->mockReadArgumentValue.push_back(0); @@ -755,7 +733,7 @@ HWTEST2_F(SysmanDeviceMemoryFixture, GivenValidMemoryHandleWhenCallingGetBandwid auto &productHelper = pLinuxSysmanImp->getDeviceHandle()->getNEODevice()->getProductHelper(); hwInfo->platform.usRevId = productHelper.getHwRevIdFromStepping(REVISION_B, *hwInfo); auto pPmt = static_cast(pLinuxSysmanImp->getPlatformMonitoringTechAccess(0)); - pPmt->setGuid(guid64BitMemoryCounters); + pPmt->mockVfid1Status = true; pSysfsAccess->mockReadUInt64Value.push_back(hbmRP0Frequency); pSysfsAccess->mockReadReturnStatus.push_back(ZE_RESULT_SUCCESS); @@ -777,7 +755,7 @@ HWTEST2_F(SysmanDeviceMemoryFixture, GivenValidMemoryHandleWhenCallingGetBandwid auto &productHelper = pLinuxSysmanImp->getDeviceHandle()->getNEODevice()->getProductHelper(); hwInfo->platform.usRevId = productHelper.getHwRevIdFromStepping(REVISION_B, *hwInfo); auto pPmt = static_cast(pLinuxSysmanImp->getPlatformMonitoringTechAccess(0)); - pPmt->setGuid(guid64BitMemoryCounters); + pPmt->mockVfid0Status = true; pSysfsAccess->mockReadUInt64Value.push_back(hbmRP0Frequency); pSysfsAccess->mockReadReturnStatus.push_back(ZE_RESULT_SUCCESS); @@ -836,7 +814,6 @@ HWTEST2_F(SysmanDeviceMemoryFixture, GivenValidUsRevIdForRevisionBWhenCallingzes hwInfo->platform.usRevId = productHelper.getHwRevIdFromStepping(REVISION_B, *hwInfo); auto pPmt = static_cast(pLinuxSysmanImp->getPlatformMonitoringTechAccess(properties.subdeviceId)); pPmt->mockVfid1Status = true; - pPmt->setGuid(guid64BitMemoryCounters); pSysfsAccess->mockReadUInt64Value.push_back(hbmRP0Frequency); pSysfsAccess->mockReadReturnStatus.push_back(ZE_RESULT_SUCCESS); @@ -1051,7 +1028,6 @@ TEST_F(SysmanDeviceMemoryFixture, GivenValidMemoryHandleWhenBothVfid0AndVfid1Are zes_mem_bandwidth_t bandwidth; auto pPmt = static_cast(pLinuxSysmanImp->getPlatformMonitoringTechAccess(properties.subdeviceId)); - pPmt->setGuid(guid64BitMemoryCounters); pPmt->mockReadArgumentValue.push_back(0); pPmt->mockReadValueReturnStatus.push_back(ZE_RESULT_SUCCESS); // Return success after reading VF0_VFID pPmt->mockReadArgumentValue.push_back(0);