mirror of
https://github.com/intel/compute-runtime.git
synced 2026-01-08 22:12:59 +08:00
feature: Add FsAccess and Derived class in Sysman Kmd Interface
- The FsAccess, ProcFsAccess and SysfsAccess classes have been added in a file in the Sysman Shared directory. The instances of these classes are maintained in the Sysman Kmd Interface classes. - Added functions for opendir, readdir and closedir in the shared code. - Added a ULT in the sysman directory to cover these new functions from the shared code. Related-To: LOCI-4689 Signed-off-by: Bari, Pratik <pratik.bari@intel.com>
This commit is contained in:
committed by
Compute-Runtime-Automation
parent
e77e49853b
commit
f9e4381c1e
@@ -5,15 +5,12 @@
|
||||
*
|
||||
*/
|
||||
|
||||
#include "level_zero/sysman/source/shared/linux/sysman_kmd_interface.h"
|
||||
#include "level_zero/tools/test/unit_tests/sources/sysman/frequency/linux/mock_sysfs_frequency_prelim.h"
|
||||
#include "level_zero/tools/test/unit_tests/sources/sysman/linux/mock_sysman_fixture.h"
|
||||
|
||||
#include "gtest/gtest.h"
|
||||
#include "igfxfmid.h"
|
||||
|
||||
using namespace L0::Sysman;
|
||||
|
||||
#include <cmath>
|
||||
|
||||
extern bool sysmanUltsEnable;
|
||||
@@ -110,48 +107,6 @@ class SysmanDeviceFrequencyFixture : public SysmanDeviceFixture {
|
||||
}
|
||||
};
|
||||
|
||||
TEST_F(SysmanDeviceFrequencyFixture, GivenKmdInterfaceWhenGettingFilenamesForFrequencyFilesForI915VersionAndBaseDirectoryExistsThenProperPathsAreReturned) {
|
||||
auto pSysmanKmdInterface = std::make_unique<SysmanKmdInterfaceI915>(device->getNEODevice()->getHardwareInfo().platform.eProductFamily);
|
||||
bool baseDirectoryExists = true;
|
||||
EXPECT_STREQ("gt/gt1/rps_min_freq_mhz", pSysmanKmdInterface->getSysfsFilePath(SysfsName::sysfsNameMinFrequency, 1, baseDirectoryExists).c_str());
|
||||
EXPECT_STREQ("gt/gt1/rps_max_freq_mhz", pSysmanKmdInterface->getSysfsFilePath(SysfsName::sysfsNameMaxFrequency, 1, baseDirectoryExists).c_str());
|
||||
EXPECT_STREQ("gt/gt1/.defaults/rps_min_freq_mhz", pSysmanKmdInterface->getSysfsFilePath(SysfsName::sysfsNameMinDefaultFrequency, 1, baseDirectoryExists).c_str());
|
||||
EXPECT_STREQ("gt/gt1/.defaults/rps_max_freq_mhz", pSysmanKmdInterface->getSysfsFilePath(SysfsName::sysfsNameMaxDefaultFrequency, 1, baseDirectoryExists).c_str());
|
||||
EXPECT_STREQ("gt/gt1/rps_boost_freq_mhz", pSysmanKmdInterface->getSysfsFilePath(SysfsName::sysfsNameBoostFrequency, 1, baseDirectoryExists).c_str());
|
||||
EXPECT_STREQ("gt/gt1/punit_req_freq_mhz", pSysmanKmdInterface->getSysfsFilePath(SysfsName::sysfsNameCurrentFrequency, 1, baseDirectoryExists).c_str());
|
||||
EXPECT_STREQ("gt/gt1/rapl_PL1_freq_mhz", pSysmanKmdInterface->getSysfsFilePath(SysfsName::sysfsNameTdpFrequency, 1, baseDirectoryExists).c_str());
|
||||
EXPECT_STREQ("gt/gt1/rps_act_freq_mhz", pSysmanKmdInterface->getSysfsFilePath(SysfsName::sysfsNameActualFrequency, 1, baseDirectoryExists).c_str());
|
||||
EXPECT_STREQ("gt/gt1/rps_RP1_freq_mhz", pSysmanKmdInterface->getSysfsFilePath(SysfsName::sysfsNameEfficientFrequency, 1, baseDirectoryExists).c_str());
|
||||
EXPECT_STREQ("gt/gt1/rps_RP0_freq_mhz", pSysmanKmdInterface->getSysfsFilePath(SysfsName::sysfsNameMaxValueFrequency, 1, baseDirectoryExists).c_str());
|
||||
EXPECT_STREQ("gt/gt1/rps_RPn_freq_mhz", pSysmanKmdInterface->getSysfsFilePath(SysfsName::sysfsNameMinValueFrequency, 1, baseDirectoryExists).c_str());
|
||||
EXPECT_STREQ("gt/gt1/throttle_reason_status", pSysmanKmdInterface->getSysfsFilePath(SysfsName::sysfsNameThrottleReasonStatus, 1, baseDirectoryExists).c_str());
|
||||
EXPECT_STREQ("gt/gt1/throttle_reason_pl1", pSysmanKmdInterface->getSysfsFilePath(SysfsName::sysfsNameThrottleReasonPL1, 1, baseDirectoryExists).c_str());
|
||||
EXPECT_STREQ("gt/gt1/throttle_reason_pl2", pSysmanKmdInterface->getSysfsFilePath(SysfsName::sysfsNameThrottleReasonPL2, 1, baseDirectoryExists).c_str());
|
||||
EXPECT_STREQ("gt/gt1/throttle_reason_pl4", pSysmanKmdInterface->getSysfsFilePath(SysfsName::sysfsNameThrottleReasonPL4, 1, baseDirectoryExists).c_str());
|
||||
EXPECT_STREQ("gt/gt1/throttle_reason_thermal", pSysmanKmdInterface->getSysfsFilePath(SysfsName::sysfsNameThrottleReasonThermal, 1, baseDirectoryExists).c_str());
|
||||
}
|
||||
|
||||
TEST_F(SysmanDeviceFrequencyFixture, GivenKmdInterfaceWhenGettingFilenamesForFrequencyFilesForXeVersionAndBaseDirectoryExistsThenProperPathsAreReturned) {
|
||||
auto pSysmanKmdInterface = std::make_unique<SysmanKmdInterfaceXe>(device->getNEODevice()->getHardwareInfo().platform.eProductFamily);
|
||||
bool baseDirectoryExists = true;
|
||||
EXPECT_STREQ("device/tile0/gt0/rps_min_freq_mhz", pSysmanKmdInterface->getSysfsFilePath(SysfsName::sysfsNameMinFrequency, 0, baseDirectoryExists).c_str());
|
||||
EXPECT_STREQ("device/tile0/gt0/rps_max_freq_mhz", pSysmanKmdInterface->getSysfsFilePath(SysfsName::sysfsNameMaxFrequency, 0, baseDirectoryExists).c_str());
|
||||
EXPECT_STREQ("device/tile0/gt0/.defaults/rps_min_freq_mhz", pSysmanKmdInterface->getSysfsFilePath(SysfsName::sysfsNameMinDefaultFrequency, 0, baseDirectoryExists).c_str());
|
||||
EXPECT_STREQ("device/tile0/gt0/.defaults/rps_max_freq_mhz", pSysmanKmdInterface->getSysfsFilePath(SysfsName::sysfsNameMaxDefaultFrequency, 0, baseDirectoryExists).c_str());
|
||||
EXPECT_STREQ("device/tile0/gt0/rps_boost_freq_mhz", pSysmanKmdInterface->getSysfsFilePath(SysfsName::sysfsNameBoostFrequency, 0, baseDirectoryExists).c_str());
|
||||
EXPECT_STREQ("device/tile0/gt0/punit_req_freq_mhz", pSysmanKmdInterface->getSysfsFilePath(SysfsName::sysfsNameCurrentFrequency, 0, baseDirectoryExists).c_str());
|
||||
EXPECT_STREQ("device/tile0/gt0/rapl_PL1_freq_mhz", pSysmanKmdInterface->getSysfsFilePath(SysfsName::sysfsNameTdpFrequency, 0, baseDirectoryExists).c_str());
|
||||
EXPECT_STREQ("device/tile0/gt0/rps_act_freq_mhz", pSysmanKmdInterface->getSysfsFilePath(SysfsName::sysfsNameActualFrequency, 0, baseDirectoryExists).c_str());
|
||||
EXPECT_STREQ("device/tile0/gt0/rps_RP1_freq_mhz", pSysmanKmdInterface->getSysfsFilePath(SysfsName::sysfsNameEfficientFrequency, 0, baseDirectoryExists).c_str());
|
||||
EXPECT_STREQ("device/tile0/gt0/rps_RP0_freq_mhz", pSysmanKmdInterface->getSysfsFilePath(SysfsName::sysfsNameMaxValueFrequency, 0, baseDirectoryExists).c_str());
|
||||
EXPECT_STREQ("device/tile0/gt0/rps_RPn_freq_mhz", pSysmanKmdInterface->getSysfsFilePath(SysfsName::sysfsNameMinValueFrequency, 0, baseDirectoryExists).c_str());
|
||||
EXPECT_STREQ("device/tile0/gt0/throttle_reason_status", pSysmanKmdInterface->getSysfsFilePath(SysfsName::sysfsNameThrottleReasonStatus, 0, baseDirectoryExists).c_str());
|
||||
EXPECT_STREQ("device/tile0/gt0/throttle_reason_pl1", pSysmanKmdInterface->getSysfsFilePath(SysfsName::sysfsNameThrottleReasonPL1, 0, baseDirectoryExists).c_str());
|
||||
EXPECT_STREQ("device/tile0/gt0/throttle_reason_pl2", pSysmanKmdInterface->getSysfsFilePath(SysfsName::sysfsNameThrottleReasonPL2, 0, baseDirectoryExists).c_str());
|
||||
EXPECT_STREQ("device/tile0/gt0/throttle_reason_pl4", pSysmanKmdInterface->getSysfsFilePath(SysfsName::sysfsNameThrottleReasonPL4, 0, baseDirectoryExists).c_str());
|
||||
EXPECT_STREQ("device/tile0/gt0/throttle_reason_thermal", pSysmanKmdInterface->getSysfsFilePath(SysfsName::sysfsNameThrottleReasonThermal, 0, baseDirectoryExists).c_str());
|
||||
}
|
||||
|
||||
TEST_F(SysmanDeviceFrequencyFixture, GivenComponentCountZeroWhenEnumeratingFrequencyHandlesThenNonZeroCountIsReturnedAndCallSucceds) {
|
||||
uint32_t count = 0U;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user