diff --git a/level_zero/tools/source/sysman/engine/linux/os_engine_imp.cpp b/level_zero/tools/source/sysman/engine/linux/os_engine_imp.cpp index 620c568a45..600f1bd390 100644 --- a/level_zero/tools/source/sysman/engine/linux/os_engine_imp.cpp +++ b/level_zero/tools/source/sysman/engine/linux/os_engine_imp.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2020-2024 Intel Corporation + * Copyright (C) 2020-2025 Intel Corporation * * SPDX-License-Identifier: MIT * @@ -10,6 +10,7 @@ #include "shared/source/debug_settings/debug_settings_manager.h" #include "shared/source/os_interface/linux/engine_info.h" #include "shared/source/os_interface/linux/i915.h" +#include "shared/source/os_interface/linux/sys_calls.h" #include "level_zero/tools/source/sysman/linux/os_sysman_imp.h" @@ -82,7 +83,7 @@ ze_result_t LinuxEngineImp::getActivityExt(uint32_t *pCount, zes_engine_stats_t void LinuxEngineImp::cleanup() { for (auto &fdPair : fdList) { DEBUG_BREAK_IF(fdPair.first < 0); - close(static_cast(fdPair.first)); + NEO::SysCalls::close(static_cast(fdPair.first)); } fdList.clear(); } diff --git a/level_zero/tools/source/sysman/engine/linux/os_engine_imp_prelim.cpp b/level_zero/tools/source/sysman/engine/linux/os_engine_imp_prelim.cpp index de9db2ef83..46b93a5666 100644 --- a/level_zero/tools/source/sysman/engine/linux/os_engine_imp_prelim.cpp +++ b/level_zero/tools/source/sysman/engine/linux/os_engine_imp_prelim.cpp @@ -79,7 +79,7 @@ static ze_result_t openPmuHandlesForVfs(uint32_t numberOfVfs, 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 PMU Handle \n", __FUNCTION__); - close(static_cast(fd[0])); + NEO::SysCalls::close(static_cast(fd[0])); fd[0] = -1; } } @@ -111,10 +111,10 @@ ze_result_t LinuxEngineImpPrelim::getActivity(zes_engine_stats_t *pStats) { void LinuxEngineImpPrelim::cleanup() { for (auto &fdPair : fdList) { if (fdPair.first >= 0) { - close(static_cast(fdPair.first)); + NEO::SysCalls::close(static_cast(fdPair.first)); } if (fdPair.second >= 0) { - close(static_cast(fdPair.second)); + NEO::SysCalls::close(static_cast(fdPair.second)); } } fdList.clear(); @@ -154,8 +154,8 @@ ze_result_t LinuxEngineImpPrelim::getActivityExt(uint32_t *pCount, zes_engine_st for (size_t i = 1; i < fdList.size(); i++) { auto &fdPair = fdList[i]; if (fdPair.first >= 0) { - close(static_cast(fdPair.first)); - close(static_cast(fdPair.second)); + NEO::SysCalls::close(static_cast(fdPair.first)); + NEO::SysCalls::close(static_cast(fdPair.second)); } fdList.resize(1); } @@ -242,7 +242,7 @@ void LinuxEngineImpPrelim::init() { if (fd[1] < 0) { NEO::printDebugString(NEO::debugManager.flags.PrintDebugMessages.get(), stderr, "Error@ %s(): Could not open Total Active Ticks Handle \n", __FUNCTION__); checkErrorNumberAndUpdateStatus(); - close(static_cast(fd[0])); + NEO::SysCalls::close(static_cast(fd[0])); return; } diff --git a/level_zero/tools/source/sysman/ras/linux/os_ras_imp_gt.cpp b/level_zero/tools/source/sysman/ras/linux/os_ras_imp_gt.cpp index b6afae0aa0..6c74218047 100644 --- a/level_zero/tools/source/sysman/ras/linux/os_ras_imp_gt.cpp +++ b/level_zero/tools/source/sysman/ras/linux/os_ras_imp_gt.cpp @@ -53,7 +53,7 @@ static const std::map> ca static void closeFd(int64_t &fd) { if (fd != -1) { - close(static_cast(fd)); + NEO::SysCalls::close(static_cast(fd)); fd = -1; } } @@ -350,4 +350,4 @@ LinuxRasSourceGt::LinuxRasSourceGt(LinuxSysmanImp *pLinuxSysmanImp, zes_ras_erro pSysfsAccess = &pLinuxSysmanImp->getSysfsAccess(); } -} // namespace L0 \ No newline at end of file +} // namespace L0 diff --git a/level_zero/tools/source/sysman/vf_management/linux/os_vf_imp.cpp b/level_zero/tools/source/sysman/vf_management/linux/os_vf_imp.cpp index b4cc7df20e..d3e2de9c99 100644 --- a/level_zero/tools/source/sysman/vf_management/linux/os_vf_imp.cpp +++ b/level_zero/tools/source/sysman/vf_management/linux/os_vf_imp.cpp @@ -132,9 +132,9 @@ LinuxVfImp::LinuxVfImp( void LinuxVfImp::cleanup() { for (auto pEngineUtilsData : pEngineUtils) { DEBUG_BREAK_IF(pEngineUtilsData.busyTicksFd < 0); - close(static_cast(pEngineUtilsData.busyTicksFd)); + NEO::SysCalls::close(static_cast(pEngineUtilsData.busyTicksFd)); DEBUG_BREAK_IF(pEngineUtilsData.totalTicksFd < 0); - close(static_cast(pEngineUtilsData.totalTicksFd)); + NEO::SysCalls::close(static_cast(pEngineUtilsData.totalTicksFd)); } pEngineUtils.clear(); } diff --git a/level_zero/tools/source/sysman/vf_management/linux/os_vf_imp_prelim.cpp b/level_zero/tools/source/sysman/vf_management/linux/os_vf_imp_prelim.cpp index be8fdd9768..5a6a99ff1c 100644 --- a/level_zero/tools/source/sysman/vf_management/linux/os_vf_imp_prelim.cpp +++ b/level_zero/tools/source/sysman/vf_management/linux/os_vf_imp_prelim.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2024 Intel Corporation + * Copyright (C) 2024-2025 Intel Corporation * * SPDX-License-Identifier: MIT * @@ -68,7 +68,7 @@ ze_result_t LinuxVfImp::vfEngineDataInit() { int64_t totalTicksFd = pPmuInterface->pmuInterfaceOpen(totalTicksConfig, static_cast(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(busyTicksFd)); + NEO::SysCalls::close(static_cast(busyTicksFd)); cleanup(); return ZE_RESULT_ERROR_UNSUPPORTED_FEATURE; } @@ -127,4 +127,4 @@ ze_result_t LinuxVfImp::getEngineUtilization(uint32_t *pCount, zes_vf_util_engin return ZE_RESULT_SUCCESS; } -} // namespace L0 \ No newline at end of file +} // namespace L0