feature: add debug logs to firmware module for new sysman implementation

Related-To: LOCI-3877

Signed-off-by: Puneeth Kumar Reddy, Devarinti <puneeth.kumar.reddy.devarinti@intel.com>
This commit is contained in:
Puneeth Kumar Reddy, Devarinti 2023-07-05 07:51:52 +00:00 committed by Compute-Runtime-Automation
parent 01a51328f5
commit 03bfea0ef5
2 changed files with 7 additions and 0 deletions

View File

@ -7,6 +7,7 @@
#include "level_zero/sysman/source/firmware/linux/sysman_os_firmware_imp.h"
#include "shared/source/debug_settings/debug_settings_manager.h"
#include "shared/source/helpers/string.h"
#include "level_zero/sysman/source/firmware_util/sysman_firmware_util.h"
@ -32,6 +33,7 @@ ze_result_t OsFirmware::getSupportedFwTypes(std::vector<std::string> &supportedF
std::vector<std::string> mtdDescriptorStrings = {};
ze_result_t result = pFsAccess->read(mtdDescriptor, mtdDescriptorStrings);
if (result != ZE_RESULT_SUCCESS) {
NEO::printDebugString(NEO::DebugManager.flags.PrintDebugMessages.get(), stderr, "Error@ %s(): Failed to read %s and returning error:0x%x \n", __FUNCTION__, mtdDescriptor.c_str(), result);
return result;
}
for (const auto &readByteLine : mtdDescriptorStrings) {

View File

@ -5,6 +5,8 @@
*
*/
#include "shared/source/debug_settings/debug_settings_manager.h"
#include "level_zero/sysman/source/firmware/linux/sysman_os_firmware_imp.h"
#include "level_zero/sysman/source/firmware_util/sysman_firmware_util.h"
#include "level_zero/sysman/source/linux/sysman_fs_access.h"
@ -26,6 +28,7 @@ ze_result_t LinuxFirmwareImp::getFirmwareVersion(std::string fwType, zes_firmwar
ze_result_t result = pSysfsAccess->scanDirEntries(iafPath, list);
if (ZE_RESULT_SUCCESS != result) {
// There should be a device directory
NEO::printDebugString(NEO::DebugManager.flags.PrintDebugMessages.get(), stderr, "Error@ %s(): Failed to scan directories at %s and returning error:0x%x \n", __FUNCTION__, iafPath.c_str(), result);
return result;
}
for (const auto &entry : list) {
@ -36,6 +39,7 @@ ze_result_t LinuxFirmwareImp::getFirmwareVersion(std::string fwType, zes_firmwar
}
if (path.empty()) {
// This device does not have a PSC Version
NEO::printDebugString(NEO::DebugManager.flags.PrintDebugMessages.get(), stderr, "Error@ %s(): device does not have a PSC version and returning error:0x%x \n", __FUNCTION__, ZE_RESULT_ERROR_NOT_AVAILABLE);
return ZE_RESULT_ERROR_NOT_AVAILABLE;
}
std::string pscVersion;
@ -43,6 +47,7 @@ ze_result_t LinuxFirmwareImp::getFirmwareVersion(std::string fwType, zes_firmwar
result = pSysfsAccess->read(path, pscVersion);
if (ZE_RESULT_SUCCESS != result) {
// not able to read PSC version from iaf.x
NEO::printDebugString(NEO::DebugManager.flags.PrintDebugMessages.get(), stderr, "Error@ %s(): Failed to read PSC version from iaf.x at %s and returning error:0x%x \n", __FUNCTION__, path.c_str(), result);
return result;
}
strncpy_s(static_cast<char *>(pProperties->version), ZES_STRING_PROPERTY_SIZE, pscVersion.c_str(), ZES_STRING_PROPERTY_SIZE - 1);