mirror of
https://github.com/intel/compute-runtime.git
synced 2026-01-03 14:55:24 +08:00
refactor: use NEO::SysCalls::close wrapper for close function call
Signed-off-by: Mateusz Jablonski <mateusz.jablonski@intel.com>
This commit is contained in:
committed by
Compute-Runtime-Automation
parent
66bf978a13
commit
509cc066e0
@@ -24,7 +24,7 @@ namespace Sysman {
|
||||
void LinuxEngineImp::cleanup() {
|
||||
for (auto &fdPair : fdList) {
|
||||
DEBUG_BREAK_IF(fdPair.first < 0);
|
||||
close(static_cast<int>(fdPair.first));
|
||||
NEO::SysCalls::close(static_cast<int>(fdPair.first));
|
||||
}
|
||||
fdList.clear();
|
||||
}
|
||||
@@ -167,7 +167,7 @@ static void closeFds(std::vector<int64_t> &fdList) {
|
||||
if (!fdList.empty()) {
|
||||
for (auto &fd : fdList) {
|
||||
DEBUG_BREAK_IF(fd < 0);
|
||||
close(static_cast<int>(fd));
|
||||
NEO::SysCalls::close(static_cast<int>(fd));
|
||||
}
|
||||
fdList.clear();
|
||||
}
|
||||
|
||||
@@ -157,7 +157,7 @@ ze_result_t LinuxVfImp::vfEngineDataInit() {
|
||||
int64_t totalTicksFd = pPmuInterface->pmuInterfaceOpen(totalTicksConfig, static_cast<int32_t>(busyTicksFd), PERF_FORMAT_TOTAL_TIME_ENABLED | PERF_FORMAT_GROUP);
|
||||
if (totalTicksFd < 0) {
|
||||
NEO::printDebugString(NEO::debugManager.flags.PrintDebugMessages.get(), stderr, "Error@ %s(): Could not open Total Ticks Handle and returning error:0x%x \n", __FUNCTION__, ZE_RESULT_ERROR_UNSUPPORTED_FEATURE);
|
||||
close(static_cast<int>(busyTicksFd));
|
||||
NEO::SysCalls::close(static_cast<int>(busyTicksFd));
|
||||
cleanup();
|
||||
return ZE_RESULT_ERROR_UNSUPPORTED_FEATURE;
|
||||
}
|
||||
@@ -239,9 +239,9 @@ LinuxVfImp::LinuxVfImp(
|
||||
void LinuxVfImp::cleanup() {
|
||||
for (const auto &pEngineUtilsData : pEngineUtils) {
|
||||
DEBUG_BREAK_IF(pEngineUtilsData.busyTicksFd < 0);
|
||||
close(static_cast<int>(pEngineUtilsData.busyTicksFd));
|
||||
NEO::SysCalls::close(static_cast<int>(pEngineUtilsData.busyTicksFd));
|
||||
DEBUG_BREAK_IF(pEngineUtilsData.totalTicksFd < 0);
|
||||
close(static_cast<int>(pEngineUtilsData.totalTicksFd));
|
||||
NEO::SysCalls::close(static_cast<int>(pEngineUtilsData.totalTicksFd));
|
||||
}
|
||||
pEngineUtils.clear();
|
||||
}
|
||||
|
||||
@@ -149,7 +149,7 @@ ze_result_t SysmanKmdInterfaceI915Prelim::getEngineActivityFdListAndConfigPair(z
|
||||
fd[1] = pPmuInterface->pmuInterfaceOpen(configPair.second, static_cast<int>(fd[0]), PERF_FORMAT_TOTAL_TIME_ENABLED | PERF_FORMAT_GROUP);
|
||||
if (fd[1] < 0) {
|
||||
NEO::printDebugString(NEO::debugManager.flags.PrintDebugMessages.get(), stderr, "Error@ %s(): Could not open Total Active Ticks Handle \n", __FUNCTION__);
|
||||
close(static_cast<int>(fd[0]));
|
||||
NEO::SysCalls::close(static_cast<int>(fd[0]));
|
||||
return checkErrorNumberAndReturnStatus();
|
||||
}
|
||||
|
||||
@@ -247,4 +247,4 @@ void SysmanKmdInterfaceI915Prelim::setSysmanDeviceDirName(const bool isIntegrate
|
||||
}
|
||||
|
||||
} // namespace Sysman
|
||||
} // namespace L0
|
||||
} // namespace L0
|
||||
|
||||
@@ -180,7 +180,7 @@ ze_result_t SysmanKmdInterfaceXe::getEngineActivityFdListAndConfigPair(zes_engin
|
||||
fd[1] = pPmuInterface->pmuInterfaceOpen(configPair.second, static_cast<int>(fd[0]), PERF_FORMAT_TOTAL_TIME_ENABLED | PERF_FORMAT_GROUP);
|
||||
if (fd[1] < 0) {
|
||||
NEO::printDebugString(NEO::debugManager.flags.PrintDebugMessages.get(), stderr, "Error@ %s(): Could not open Total Active Ticks Handle \n", __FUNCTION__);
|
||||
close(static_cast<int>(fd[0]));
|
||||
NEO::SysCalls::close(static_cast<int>(fd[0]));
|
||||
return checkErrorNumberAndReturnStatus();
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user