mirror of
https://github.com/intel/compute-runtime.git
synced 2026-01-03 06:49:52 +08:00
Adding debug logs in standby module
Related-To: LOCI-3471 Signed-off-by: Singh, Prasoon prasoon.singh@intel.com
This commit is contained in:
committed by
Compute-Runtime-Automation
parent
6254dd057d
commit
93ca711d23
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (C) 2020-2021 Intel Corporation
|
||||
* Copyright (C) 2020-2023 Intel Corporation
|
||||
*
|
||||
* SPDX-License-Identifier: MIT
|
||||
*
|
||||
@@ -7,6 +7,8 @@
|
||||
|
||||
#include "level_zero/tools/source/sysman/standby/linux/os_standby_imp.h"
|
||||
|
||||
#include "shared/source/debug_settings/debug_settings_manager.h"
|
||||
|
||||
namespace L0 {
|
||||
|
||||
ze_result_t LinuxStandbyImp::osStandbyGetProperties(zes_standby_properties_t &properties) {
|
||||
@@ -18,9 +20,12 @@ ze_result_t LinuxStandbyImp::osStandbyGetProperties(zes_standby_properties_t &pr
|
||||
}
|
||||
|
||||
bool LinuxStandbyImp::isStandbySupported(void) {
|
||||
if (ZE_RESULT_SUCCESS == pSysfsAccess->canRead(standbyModeFile)) {
|
||||
auto rel = pSysfsAccess->canRead(standbyModeFile);
|
||||
if (ZE_RESULT_SUCCESS == rel) {
|
||||
return true;
|
||||
} else {
|
||||
NEO::printDebugString(NEO::DebugManager.flags.PrintDebugMessages.get(), stderr,
|
||||
"error@<%s> <can't read file %s> <error: 0x%x>\n", __func__, standbyModeFile.c_str(), rel);
|
||||
return false;
|
||||
}
|
||||
}
|
||||
@@ -32,6 +37,8 @@ ze_result_t LinuxStandbyImp::getMode(zes_standby_promo_mode_t &mode) {
|
||||
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 file %s> <result: 0x%x>\n", __func__, standbyModeFile.c_str(), result);
|
||||
return result;
|
||||
}
|
||||
if (standbyModeDefault == currentMode) {
|
||||
@@ -40,6 +47,8 @@ ze_result_t LinuxStandbyImp::getMode(zes_standby_promo_mode_t &mode) {
|
||||
mode = ZES_STANDBY_PROMO_MODE_NEVER;
|
||||
} else {
|
||||
result = ZE_RESULT_ERROR_UNKNOWN;
|
||||
NEO::printDebugString(NEO::DebugManager.flags.PrintDebugMessages.get(), stderr,
|
||||
"error@<%s> <unknown or internal error occured> <currentMode: %d & result: 0x%x>\n", __func__, currentMode, result);
|
||||
}
|
||||
return result;
|
||||
}
|
||||
@@ -54,6 +63,8 @@ ze_result_t LinuxStandbyImp::setMode(zes_standby_promo_mode_t mode) {
|
||||
|
||||
if (ZE_RESULT_ERROR_NOT_AVAILABLE == result) {
|
||||
result = ZE_RESULT_ERROR_UNSUPPORTED_FEATURE;
|
||||
NEO::printDebugString(NEO::DebugManager.flags.PrintDebugMessages.get(), stderr,
|
||||
"error@<%s> <Unsupported feature> <result: 0x%x>\n", __func__, result);
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user