feature: Add debug logs for scheduler module

Related-To: LOCI-3880

Signed-off-by: Devarinti, Puneeth Kumar Reddy <puneeth.kumar.reddy.devarinti@intel.com>
This commit is contained in:
Devarinti, Puneeth Kumar Reddy
2023-04-25 18:53:57 +00:00
committed by Compute-Runtime-Automation
parent f3a89bfe07
commit 52afb9fc85
2 changed files with 85 additions and 12 deletions

View File

@@ -7,6 +7,8 @@
#include "level_zero/tools/source/sysman/scheduler/linux/os_scheduler_imp.h"
#include "shared/source/debug_settings/debug_settings_manager.h"
#include "level_zero/tools/source/sysman/linux/os_sysman_imp.h"
namespace L0 {
@@ -41,14 +43,17 @@ ze_result_t LinuxSchedulerImp::getCurrentMode(zes_sched_mode_t *pMode) {
uint64_t heartbeat = 0;
ze_result_t result = getPreemptTimeout(timeout, false);
if (result != ZE_RESULT_SUCCESS) {
NEO::printDebugString(NEO::DebugManager.flags.PrintDebugMessages.get(), stderr, "Error@ %s(): Failed to get preempt timeout and returning error:0x%x \n", __FUNCTION__, result);
return result;
}
result = getTimesliceDuration(timeslice, false);
if (result != ZE_RESULT_SUCCESS) {
NEO::printDebugString(NEO::DebugManager.flags.PrintDebugMessages.get(), stderr, "Error@ %s(): Failed to get timeslice duration and returning error:0x%x \n", __FUNCTION__, result);
return result;
}
result = getHeartbeatInterval(heartbeat, false);
if (result != ZE_RESULT_SUCCESS) {
NEO::printDebugString(NEO::DebugManager.flags.PrintDebugMessages.get(), stderr, "Error@ %s(): Failed to get heartbeat interval and returning error:0x%x \n", __FUNCTION__, result);
return result;
}
@@ -80,10 +85,12 @@ ze_result_t LinuxSchedulerImp::setExclusiveModeImp() {
uint64_t timeslice = 0, timeout = 0, heartbeat = 0;
ze_result_t result = setPreemptTimeout(timeout);
if (result != ZE_RESULT_SUCCESS) {
NEO::printDebugString(NEO::DebugManager.flags.PrintDebugMessages.get(), stderr, "Error@ %s(): Failed to set preempt timeout and returning error:0x%x \n", __FUNCTION__, result);
return result;
}
result = setTimesliceDuration(timeslice);
if (result != ZE_RESULT_SUCCESS) {
NEO::printDebugString(NEO::DebugManager.flags.PrintDebugMessages.get(), stderr, "Error@ %s(): Failed to set timeslice duration and returning error:0x%x \n", __FUNCTION__, result);
return result;
}
result = setHeartbeatInterval(heartbeat);
@@ -96,6 +103,7 @@ ze_result_t LinuxSchedulerImp::setExclusiveMode(ze_bool_t *pNeedReload) {
zes_sched_mode_t currMode;
ze_result_t result = getCurrentMode(&currMode);
if (result != ZE_RESULT_SUCCESS) {
NEO::printDebugString(NEO::DebugManager.flags.PrintDebugMessages.get(), stderr, "Error@ %s(): Failed to get current mode and returning error:0x%x \n", __FUNCTION__, result);
return result;
}
@@ -103,6 +111,7 @@ ze_result_t LinuxSchedulerImp::setExclusiveMode(ze_bool_t *pNeedReload) {
// Unset this mode
result = disableComputeUnitDebugMode(pNeedReload);
if (result != ZE_RESULT_SUCCESS) {
NEO::printDebugString(NEO::DebugManager.flags.PrintDebugMessages.get(), stderr, "Error@ %s(): Failed to diasble COMPUTE_UNIT_DEBUG mode and returning error:0x%x \n", __FUNCTION__, result);
return result;
}
}
@@ -114,6 +123,7 @@ ze_result_t LinuxSchedulerImp::getTimeoutModeProperties(ze_bool_t getDefaults, z
uint64_t heartbeat = 0;
ze_result_t result = getHeartbeatInterval(heartbeat, getDefaults);
if (result != ZE_RESULT_SUCCESS) {
NEO::printDebugString(NEO::DebugManager.flags.PrintDebugMessages.get(), stderr, "Error@ %s(): Failed to get heart beat interval and returning error:0x%x \n", __FUNCTION__, result);
return result;
}
pConfig->watchdogTimeout = heartbeat;
@@ -125,10 +135,12 @@ ze_result_t LinuxSchedulerImp::getTimesliceModeProperties(ze_bool_t getDefaults,
uint64_t timeout = 0, timeslice = 0;
ze_result_t result = getPreemptTimeout(timeout, getDefaults);
if (result != ZE_RESULT_SUCCESS) {
NEO::printDebugString(NEO::DebugManager.flags.PrintDebugMessages.get(), stderr, "Error@ %s(): Failed to get preempt timeout and returning error:0x%x \n", __FUNCTION__, result);
return result;
}
result = getTimesliceDuration(timeslice, getDefaults);
if (result != ZE_RESULT_SUCCESS) {
NEO::printDebugString(NEO::DebugManager.flags.PrintDebugMessages.get(), stderr, "Error@ %s(): Failed to get timeslice duration and returning error:0x%x \n", __FUNCTION__, result);
return result;
}
pConfig->interval = timeslice;
@@ -141,6 +153,7 @@ ze_result_t LinuxSchedulerImp::setTimeoutMode(zes_sched_timeout_properties_t *pP
zes_sched_mode_t currMode;
ze_result_t result = getCurrentMode(&currMode);
if (result != ZE_RESULT_SUCCESS) {
NEO::printDebugString(NEO::DebugManager.flags.PrintDebugMessages.get(), stderr, "Error@ %s(): Failed to get current mode and returning error:0x%x \n", __FUNCTION__, result);
return result;
}
@@ -155,24 +168,28 @@ ze_result_t LinuxSchedulerImp::setTimeoutMode(zes_sched_timeout_properties_t *pP
// Unset this mode
result = disableComputeUnitDebugMode(pNeedReload);
if (result != ZE_RESULT_SUCCESS) {
NEO::printDebugString(NEO::DebugManager.flags.PrintDebugMessages.get(), stderr, "Error@ %s(): Failed to diasble COMPUTE_UNIT_DEBUG mode and returning error:0x%x \n", __FUNCTION__, result);
return result;
}
}
result = setHeartbeatInterval(pProperties->watchdogTimeout);
if (result != ZE_RESULT_SUCCESS) {
NEO::printDebugString(NEO::DebugManager.flags.PrintDebugMessages.get(), stderr, "Error@ %s(): Failed to set heartbeat interval and returning error:0x%x \n", __FUNCTION__, result);
return result;
}
uint64_t timeout = (pProperties->watchdogTimeout) / 5;
result = setPreemptTimeout(timeout);
if (result != ZE_RESULT_SUCCESS) {
NEO::printDebugString(NEO::DebugManager.flags.PrintDebugMessages.get(), stderr, "Error@ %s(): Failed to set preempt timeout and returning error:0x%x \n", __FUNCTION__, result);
return result;
}
uint64_t timeslice = 0;
result = setTimesliceDuration(timeslice);
if (result != ZE_RESULT_SUCCESS) {
NEO::printDebugString(NEO::DebugManager.flags.PrintDebugMessages.get(), stderr, "Error@ %s(): Failed to set timeslice duration and returning error:0x%x \n", __FUNCTION__, result);
return result;
}
return result;
@@ -189,6 +206,7 @@ ze_result_t LinuxSchedulerImp::setTimesliceMode(zes_sched_timeslice_properties_t
zes_sched_mode_t currMode;
ze_result_t result = getCurrentMode(&currMode);
if (result != ZE_RESULT_SUCCESS) {
NEO::printDebugString(NEO::DebugManager.flags.PrintDebugMessages.get(), stderr, "Error@ %s(): Failed to get current mode and returning error:0x%x \n", __FUNCTION__, result);
return result;
}
@@ -196,16 +214,19 @@ ze_result_t LinuxSchedulerImp::setTimesliceMode(zes_sched_timeslice_properties_t
// Unset this mode
result = disableComputeUnitDebugMode(pNeedReload);
if (result != ZE_RESULT_SUCCESS) {
NEO::printDebugString(NEO::DebugManager.flags.PrintDebugMessages.get(), stderr, "Error@ %s(): Failed to diasble COMPUTE_UNIT_DEBUG mode and returning error:0x%x \n", __FUNCTION__, result);
return result;
}
}
result = setPreemptTimeout(pProperties->yieldTimeout);
if (result != ZE_RESULT_SUCCESS) {
NEO::printDebugString(NEO::DebugManager.flags.PrintDebugMessages.get(), stderr, "Error@ %s(): Failed to set preempt timeout and returning error:0x%x \n", __FUNCTION__, result);
return result;
}
result = setTimesliceDuration(pProperties->interval);
if (result != ZE_RESULT_SUCCESS) {
NEO::printDebugString(NEO::DebugManager.flags.PrintDebugMessages.get(), stderr, "Error@ %s(): Failed to set timeslice duration and returning error:0x%x \n", __FUNCTION__, result);
return result;
}
uint64_t heartbeat = 2500 * (pProperties->interval);
@@ -216,12 +237,15 @@ ze_result_t LinuxSchedulerImp::getPreemptTimeout(uint64_t &timeout, ze_bool_t ge
ze_result_t result = ZE_RESULT_ERROR_UNKNOWN;
uint32_t i = 0;
std::vector<uint64_t> timeoutVec = {};
std::string path = "";
timeoutVec.resize(listOfEngines.size());
for (const auto &engineName : listOfEngines) {
if (getDefault) {
result = pSysfsAccess->read(engineDir + "/" + engineName + "/" + defaultPreemptTimeouttMilliSecs, timeout);
path = engineDir + "/" + engineName + "/" + defaultPreemptTimeouttMilliSecs;
result = pSysfsAccess->read(path, timeout);
} else {
result = pSysfsAccess->read(engineDir + "/" + engineName + "/" + preemptTimeoutMilliSecs, timeout);
path = engineDir + "/" + engineName + "/" + preemptTimeoutMilliSecs;
result = pSysfsAccess->read(path, timeout);
}
if (result == ZE_RESULT_SUCCESS) {
timeout = timeout * milliSecsToMicroSecs;
@@ -231,6 +255,7 @@ ze_result_t LinuxSchedulerImp::getPreemptTimeout(uint64_t &timeout, ze_bool_t ge
if (result == ZE_RESULT_ERROR_NOT_AVAILABLE) {
result = ZE_RESULT_ERROR_UNSUPPORTED_FEATURE;
}
NEO::printDebugString(NEO::DebugManager.flags.PrintDebugMessages.get(), stderr, "Error@ %s(): Failed to read preempt timeout from %s and returning error:0x%x \n", __FUNCTION__, path.c_str(), result);
return result;
}
}
@@ -247,12 +272,15 @@ ze_result_t LinuxSchedulerImp::getTimesliceDuration(uint64_t &timeslice, ze_bool
ze_result_t result = ZE_RESULT_ERROR_UNKNOWN;
uint32_t i = 0;
std::vector<uint64_t> timesliceVec = {};
std::string path = "";
timesliceVec.resize(listOfEngines.size());
for (const auto &engineName : listOfEngines) {
if (getDefault) {
result = pSysfsAccess->read(engineDir + "/" + engineName + "/" + defaultTimesliceDurationMilliSecs, timeslice);
path = engineDir + "/" + engineName + "/" + defaultTimesliceDurationMilliSecs;
result = pSysfsAccess->read(path, timeslice);
} else {
result = pSysfsAccess->read(engineDir + "/" + engineName + "/" + timesliceDurationMilliSecs, timeslice);
path = engineDir + "/" + engineName + "/" + timesliceDurationMilliSecs;
result = pSysfsAccess->read(path, timeslice);
}
if (result == ZE_RESULT_SUCCESS) {
timeslice = timeslice * milliSecsToMicroSecs;
@@ -262,6 +290,7 @@ ze_result_t LinuxSchedulerImp::getTimesliceDuration(uint64_t &timeslice, ze_bool
if (result == ZE_RESULT_ERROR_NOT_AVAILABLE) {
result = ZE_RESULT_ERROR_UNSUPPORTED_FEATURE;
}
NEO::printDebugString(NEO::DebugManager.flags.PrintDebugMessages.get(), stderr, "Error@ %s(): Failed to read timeslice duration from %s and returning error:0x%x \n", __FUNCTION__, path.c_str(), result);
return result;
}
}
@@ -278,12 +307,15 @@ ze_result_t LinuxSchedulerImp::getHeartbeatInterval(uint64_t &heartbeat, ze_bool
ze_result_t result = ZE_RESULT_ERROR_UNKNOWN;
uint32_t i = 0;
std::vector<uint64_t> heartbeatVec = {};
std::string path = "";
heartbeatVec.resize(listOfEngines.size());
for (const auto &engineName : listOfEngines) {
if (getDefault) {
result = pSysfsAccess->read(engineDir + "/" + engineName + "/" + defaultHeartbeatIntervalMilliSecs, heartbeat);
path = engineDir + "/" + engineName + "/" + defaultHeartbeatIntervalMilliSecs;
result = pSysfsAccess->read(path, heartbeat);
} else {
result = pSysfsAccess->read(engineDir + "/" + engineName + "/" + heartbeatIntervalMilliSecs, heartbeat);
path = engineDir + "/" + engineName + "/" + heartbeatIntervalMilliSecs;
result = pSysfsAccess->read(path, heartbeat);
}
if (result == ZE_RESULT_SUCCESS) {
heartbeat = heartbeat * milliSecsToMicroSecs;
@@ -293,6 +325,7 @@ ze_result_t LinuxSchedulerImp::getHeartbeatInterval(uint64_t &heartbeat, ze_bool
if (result == ZE_RESULT_ERROR_NOT_AVAILABLE) {
result = ZE_RESULT_ERROR_UNSUPPORTED_FEATURE;
}
NEO::printDebugString(NEO::DebugManager.flags.PrintDebugMessages.get(), stderr, "Error@ %s(): Failed to read heartbeat interval from %s and returning error:0x%x \n", __FUNCTION__, path.c_str(), result);
return result;
}
}
@@ -314,6 +347,7 @@ ze_result_t LinuxSchedulerImp::setPreemptTimeout(uint64_t timeout) {
if (result == ZE_RESULT_ERROR_NOT_AVAILABLE) {
result = ZE_RESULT_ERROR_UNSUPPORTED_FEATURE;
}
NEO::printDebugString(NEO::DebugManager.flags.PrintDebugMessages.get(), stderr, "Error@ %s(): Failed to write Preempt timeout into engineDir/%s/preemptTimeoutMilliSecs and returning error:0x%x \n", __FUNCTION__, engineName.c_str(), result);
return result;
}
}
@@ -329,6 +363,7 @@ ze_result_t LinuxSchedulerImp::setTimesliceDuration(uint64_t timeslice) {
if (result == ZE_RESULT_ERROR_NOT_AVAILABLE) {
result = ZE_RESULT_ERROR_UNSUPPORTED_FEATURE;
}
NEO::printDebugString(NEO::DebugManager.flags.PrintDebugMessages.get(), stderr, "Error@ %s(): Failed to write Timeslice duration into engineDir/%s/timesliceDurationMilliSecs and returning error:0x%x \n", __FUNCTION__, engineName.c_str(), result);
return result;
}
}
@@ -344,6 +379,7 @@ ze_result_t LinuxSchedulerImp::setHeartbeatInterval(uint64_t heartbeat) {
if (result == ZE_RESULT_ERROR_NOT_AVAILABLE) {
result = ZE_RESULT_ERROR_UNSUPPORTED_FEATURE;
}
NEO::printDebugString(NEO::DebugManager.flags.PrintDebugMessages.get(), stderr, "Error@ %s(): Failed to write Heartbeat interval into engineDir/%s/heartbeatIntervalMilliSecs and returning error:0x%x \n", __FUNCTION__, engineName.c_str(), result);
return result;
}
}
@@ -375,6 +411,7 @@ static ze_result_t getNumEngineTypeAndInstancesForDevice(std::map<zes_engine_typ
if (result == ZE_RESULT_ERROR_NOT_AVAILABLE) {
result = ZE_RESULT_ERROR_UNSUPPORTED_FEATURE;
}
NEO::printDebugString(NEO::DebugManager.flags.PrintDebugMessages.get(), stderr, "Error@ %s(): Failed to scan directory entries to list all engines and returning error:0x%x \n", __FUNCTION__, result);
return result;
}
for_each(localListOfAllEngines.begin(), localListOfAllEngines.end(),

View File

@@ -59,14 +59,17 @@ ze_result_t LinuxSchedulerImp::getCurrentMode(zes_sched_mode_t *pMode) {
uint64_t heartbeat = 0;
ze_result_t result = getPreemptTimeout(timeout, false);
if (result != ZE_RESULT_SUCCESS) {
NEO::printDebugString(NEO::DebugManager.flags.PrintDebugMessages.get(), stderr, "Error@ %s(): Failed to get preempt timeout and returning error:0x%x \n", __FUNCTION__, result);
return result;
}
result = getTimesliceDuration(timeslice, false);
if (result != ZE_RESULT_SUCCESS) {
NEO::printDebugString(NEO::DebugManager.flags.PrintDebugMessages.get(), stderr, "Error@ %s(): Failed to get timeslice duration and returning error:0x%x \n", __FUNCTION__, result);
return result;
}
result = getHeartbeatInterval(heartbeat, false);
if (result != ZE_RESULT_SUCCESS) {
NEO::printDebugString(NEO::DebugManager.flags.PrintDebugMessages.get(), stderr, "Error@ %s(): Failed to get heartbeat interval and returning error:0x%x \n", __FUNCTION__, result);
return result;
}
@@ -98,10 +101,12 @@ ze_result_t LinuxSchedulerImp::setExclusiveModeImp() {
uint64_t timeslice = 0, timeout = 0, heartbeat = 0;
ze_result_t result = setPreemptTimeout(timeout);
if (result != ZE_RESULT_SUCCESS) {
NEO::printDebugString(NEO::DebugManager.flags.PrintDebugMessages.get(), stderr, "Error@ %s(): Failed to set preempt timeout and returning error:0x%x \n", __FUNCTION__, result);
return result;
}
result = setTimesliceDuration(timeslice);
if (result != ZE_RESULT_SUCCESS) {
NEO::printDebugString(NEO::DebugManager.flags.PrintDebugMessages.get(), stderr, "Error@ %s(): Failed to set timeslice duration and returning error:0x%x \n", __FUNCTION__, result);
return result;
}
result = setHeartbeatInterval(heartbeat);
@@ -114,6 +119,7 @@ ze_result_t LinuxSchedulerImp::setExclusiveMode(ze_bool_t *pNeedReload) {
zes_sched_mode_t currMode;
ze_result_t result = getCurrentMode(&currMode);
if (result != ZE_RESULT_SUCCESS) {
NEO::printDebugString(NEO::DebugManager.flags.PrintDebugMessages.get(), stderr, "Error@ %s(): Failed to get current mode and returning error:0x%x \n", __FUNCTION__, result);
return result;
}
@@ -121,6 +127,7 @@ ze_result_t LinuxSchedulerImp::setExclusiveMode(ze_bool_t *pNeedReload) {
// Unset this mode
result = disableComputeUnitDebugMode(pNeedReload);
if (result != ZE_RESULT_SUCCESS) {
NEO::printDebugString(NEO::DebugManager.flags.PrintDebugMessages.get(), stderr, "Error@ %s(): Failed to diasble COMPUTE_UNIT_DEBUG mode and returning error:0x%x \n", __FUNCTION__, result);
return result;
}
}
@@ -132,6 +139,7 @@ ze_result_t LinuxSchedulerImp::getTimeoutModeProperties(ze_bool_t getDefaults, z
uint64_t heartbeat = 0;
ze_result_t result = getHeartbeatInterval(heartbeat, getDefaults);
if (result != ZE_RESULT_SUCCESS) {
NEO::printDebugString(NEO::DebugManager.flags.PrintDebugMessages.get(), stderr, "Error@ %s(): Failed to get heart beat interval and returning error:0x%x \n", __FUNCTION__, result);
return result;
}
pConfig->watchdogTimeout = heartbeat;
@@ -143,10 +151,12 @@ ze_result_t LinuxSchedulerImp::getTimesliceModeProperties(ze_bool_t getDefaults,
uint64_t timeout = 0, timeslice = 0;
ze_result_t result = getPreemptTimeout(timeout, getDefaults);
if (result != ZE_RESULT_SUCCESS) {
NEO::printDebugString(NEO::DebugManager.flags.PrintDebugMessages.get(), stderr, "Error@ %s(): Failed to get preempt timeout and returning error:0x%x \n", __FUNCTION__, result);
return result;
}
result = getTimesliceDuration(timeslice, getDefaults);
if (result != ZE_RESULT_SUCCESS) {
NEO::printDebugString(NEO::DebugManager.flags.PrintDebugMessages.get(), stderr, "Error@ %s(): Failed to get timeslice duration and returning error:0x%x \n", __FUNCTION__, result);
return result;
}
pConfig->interval = timeslice;
@@ -159,6 +169,7 @@ ze_result_t LinuxSchedulerImp::setTimeoutMode(zes_sched_timeout_properties_t *pP
zes_sched_mode_t currMode;
ze_result_t result = getCurrentMode(&currMode);
if (result != ZE_RESULT_SUCCESS) {
NEO::printDebugString(NEO::DebugManager.flags.PrintDebugMessages.get(), stderr, "Error@ %s(): Failed to get current mode and returning error:0x%x \n", __FUNCTION__, result);
return result;
}
@@ -173,24 +184,29 @@ ze_result_t LinuxSchedulerImp::setTimeoutMode(zes_sched_timeout_properties_t *pP
// Unset this mode
result = disableComputeUnitDebugMode(pNeedReload);
if (result != ZE_RESULT_SUCCESS) {
// failed to disable compute unit debug mode
NEO::printDebugString(NEO::DebugManager.flags.PrintDebugMessages.get(), stderr, "Error@ %s(): Failed to diasble COMPUTE_UNIT_DEBUG mode and returning error:0x%x \n", __FUNCTION__, result);
return result;
}
}
result = setHeartbeatInterval(pProperties->watchdogTimeout);
if (result != ZE_RESULT_SUCCESS) {
NEO::printDebugString(NEO::DebugManager.flags.PrintDebugMessages.get(), stderr, "Error@ %s(): Failed to set heartbeat interval and returning error:0x%x \n", __FUNCTION__, result);
return result;
}
uint64_t timeout = (pProperties->watchdogTimeout) / 5;
result = setPreemptTimeout(timeout);
if (result != ZE_RESULT_SUCCESS) {
NEO::printDebugString(NEO::DebugManager.flags.PrintDebugMessages.get(), stderr, "Error@ %s(): Failed to set preempt timeout and returning error:0x%x \n", __FUNCTION__, result);
return result;
}
uint64_t timeslice = 0;
result = setTimesliceDuration(timeslice);
if (result != ZE_RESULT_SUCCESS) {
NEO::printDebugString(NEO::DebugManager.flags.PrintDebugMessages.get(), stderr, "Error@ %s(): Failed to set timeslice duration and returning error:0x%x \n", __FUNCTION__, result);
return result;
}
return result;
@@ -207,6 +223,7 @@ ze_result_t LinuxSchedulerImp::setTimesliceMode(zes_sched_timeslice_properties_t
zes_sched_mode_t currMode;
ze_result_t result = getCurrentMode(&currMode);
if (result != ZE_RESULT_SUCCESS) {
NEO::printDebugString(NEO::DebugManager.flags.PrintDebugMessages.get(), stderr, "Error@ %s(): Failed to get current mode and returning error:0x%x \n", __FUNCTION__, result);
return result;
}
@@ -214,16 +231,19 @@ ze_result_t LinuxSchedulerImp::setTimesliceMode(zes_sched_timeslice_properties_t
// Unset this mode
result = disableComputeUnitDebugMode(pNeedReload);
if (result != ZE_RESULT_SUCCESS) {
NEO::printDebugString(NEO::DebugManager.flags.PrintDebugMessages.get(), stderr, "Error@ %s(): Failed to diasble COMPUTE_UNIT_DEBUG mode and returning error:0x%x \n", __FUNCTION__, result);
return result;
}
}
result = setPreemptTimeout(pProperties->yieldTimeout);
if (result != ZE_RESULT_SUCCESS) {
NEO::printDebugString(NEO::DebugManager.flags.PrintDebugMessages.get(), stderr, "Error@ %s(): Failed to set preempt timeout and returning error:0x%x \n", __FUNCTION__, result);
return result;
}
result = setTimesliceDuration(pProperties->interval);
if (result != ZE_RESULT_SUCCESS) {
NEO::printDebugString(NEO::DebugManager.flags.PrintDebugMessages.get(), stderr, "Error@ %s(): Failed to set timeslice duration and returning error:0x%x \n", __FUNCTION__, result);
return result;
}
uint64_t heartbeat = 2500 * (pProperties->interval);
@@ -243,12 +263,15 @@ ze_result_t LinuxSchedulerImp::getPreemptTimeout(uint64_t &timeout, ze_bool_t ge
ze_result_t result = ZE_RESULT_ERROR_UNKNOWN;
uint32_t i = 0;
std::vector<uint64_t> timeoutVec = {};
std::string path = "";
timeoutVec.resize(listOfEngines.size());
for (const auto &engineName : listOfEngines) {
if (getDefault) {
result = pSysfsAccess->read(engineDir + "/" + engineName + "/" + defaultPreemptTimeouttMilliSecs, timeout);
path = engineDir + "/" + engineName + "/" + defaultPreemptTimeouttMilliSecs;
result = pSysfsAccess->read(path, timeout);
} else {
result = pSysfsAccess->read(engineDir + "/" + engineName + "/" + preemptTimeoutMilliSecs, timeout);
path = engineDir + "/" + engineName + "/" + preemptTimeoutMilliSecs;
result = pSysfsAccess->read(path, timeout);
}
if (result == ZE_RESULT_SUCCESS) {
timeout = timeout * milliSecsToMicroSecs;
@@ -258,6 +281,7 @@ ze_result_t LinuxSchedulerImp::getPreemptTimeout(uint64_t &timeout, ze_bool_t ge
if (result == ZE_RESULT_ERROR_NOT_AVAILABLE) {
result = ZE_RESULT_ERROR_UNSUPPORTED_FEATURE;
}
NEO::printDebugString(NEO::DebugManager.flags.PrintDebugMessages.get(), stderr, "Error@ %s(): Failed to read preempt timeout from %s and returning error:0x%x \n", __FUNCTION__, path.c_str(), result);
return result;
}
}
@@ -280,12 +304,15 @@ ze_result_t LinuxSchedulerImp::getTimesliceDuration(uint64_t &timeslice, ze_bool
ze_result_t result = ZE_RESULT_ERROR_UNKNOWN;
uint32_t i = 0;
std::vector<uint64_t> timesliceVec = {};
std::string path = "";
timesliceVec.resize(listOfEngines.size());
for (const auto &engineName : listOfEngines) {
if (getDefault) {
result = pSysfsAccess->read(engineDir + "/" + engineName + "/" + defaultTimesliceDurationMilliSecs, timeslice);
path = engineDir + "/" + engineName + "/" + defaultTimesliceDurationMilliSecs;
result = pSysfsAccess->read(path, timeslice);
} else {
result = pSysfsAccess->read(engineDir + "/" + engineName + "/" + timesliceDurationMilliSecs, timeslice);
path = engineDir + "/" + engineName + "/" + timesliceDurationMilliSecs;
result = pSysfsAccess->read(path, timeslice);
}
if (result == ZE_RESULT_SUCCESS) {
timeslice = timeslice * milliSecsToMicroSecs;
@@ -295,6 +322,7 @@ ze_result_t LinuxSchedulerImp::getTimesliceDuration(uint64_t &timeslice, ze_bool
if (result == ZE_RESULT_ERROR_NOT_AVAILABLE) {
result = ZE_RESULT_ERROR_UNSUPPORTED_FEATURE;
}
NEO::printDebugString(NEO::DebugManager.flags.PrintDebugMessages.get(), stderr, "Error@ %s(): Failed to read timeslice duration from %s and returning error:0x%x \n", __FUNCTION__, path.c_str(), result);
return result;
}
}
@@ -311,12 +339,15 @@ ze_result_t LinuxSchedulerImp::getHeartbeatInterval(uint64_t &heartbeat, ze_bool
ze_result_t result = ZE_RESULT_ERROR_UNKNOWN;
uint32_t i = 0;
std::vector<uint64_t> heartbeatVec = {};
std::string path = "";
heartbeatVec.resize(listOfEngines.size());
for (const auto &engineName : listOfEngines) {
if (getDefault) {
result = pSysfsAccess->read(engineDir + "/" + engineName + "/" + defaultHeartbeatIntervalMilliSecs, heartbeat);
path = engineDir + "/" + engineName + "/" + defaultHeartbeatIntervalMilliSecs;
result = pSysfsAccess->read(path, heartbeat);
} else {
result = pSysfsAccess->read(engineDir + "/" + engineName + "/" + heartbeatIntervalMilliSecs, heartbeat);
path = engineDir + "/" + engineName + "/" + heartbeatIntervalMilliSecs;
result = pSysfsAccess->read(path, heartbeat);
}
if (result == ZE_RESULT_SUCCESS) {
heartbeat = heartbeat * milliSecsToMicroSecs;
@@ -326,6 +357,7 @@ ze_result_t LinuxSchedulerImp::getHeartbeatInterval(uint64_t &heartbeat, ze_bool
if (result == ZE_RESULT_ERROR_NOT_AVAILABLE) {
result = ZE_RESULT_ERROR_UNSUPPORTED_FEATURE;
}
NEO::printDebugString(NEO::DebugManager.flags.PrintDebugMessages.get(), stderr, "Error@ %s(): Failed to read heartbeat interval from %s and returning error:0x%x \n", __FUNCTION__, path.c_str(), result);
return result;
}
}
@@ -347,6 +379,7 @@ ze_result_t LinuxSchedulerImp::setPreemptTimeout(uint64_t timeout) {
if (result == ZE_RESULT_ERROR_NOT_AVAILABLE) {
result = ZE_RESULT_ERROR_UNSUPPORTED_FEATURE;
}
NEO::printDebugString(NEO::DebugManager.flags.PrintDebugMessages.get(), stderr, "Error@ %s(): Failed to write Preempt timeout into engineDir/%s/preemptTimeoutMilliSecs and returning error:0x%x \n", __FUNCTION__, engineName.c_str(), result);
return result;
}
}
@@ -362,6 +395,7 @@ ze_result_t LinuxSchedulerImp::setTimesliceDuration(uint64_t timeslice) {
if (result == ZE_RESULT_ERROR_NOT_AVAILABLE) {
result = ZE_RESULT_ERROR_UNSUPPORTED_FEATURE;
}
NEO::printDebugString(NEO::DebugManager.flags.PrintDebugMessages.get(), stderr, "Error@ %s(): Failed to write Timeslice duration into engineDir/%s/timesliceDurationMilliSecs and returning error:0x%x \n", __FUNCTION__, engineName.c_str(), result);
return result;
}
}
@@ -377,6 +411,7 @@ ze_result_t LinuxSchedulerImp::setHeartbeatInterval(uint64_t heartbeat) {
if (result == ZE_RESULT_ERROR_NOT_AVAILABLE) {
result = ZE_RESULT_ERROR_UNSUPPORTED_FEATURE;
}
NEO::printDebugString(NEO::DebugManager.flags.PrintDebugMessages.get(), stderr, "Error@ %s(): Failed to write Heartbeat interval into engineDir/%s/heartbeatIntervalMilliSecs and returning error:0x%x \n", __FUNCTION__, engineName.c_str(), result);
return result;
}
}
@@ -481,6 +516,7 @@ static ze_result_t getNumEngineTypeAndInstancesForDevice(std::map<zes_engine_typ
if (result == ZE_RESULT_ERROR_NOT_AVAILABLE) {
result = ZE_RESULT_ERROR_UNSUPPORTED_FEATURE;
}
NEO::printDebugString(NEO::DebugManager.flags.PrintDebugMessages.get(), stderr, "Error@ %s(): Failed to scan directory entries to list all engines and returning error:0x%x \n", __FUNCTION__, result);
return result;
}
for_each(localListOfAllEngines.begin(), localListOfAllEngines.end(),