From 996d73b7686b05eb614015549ff1fd3d4d3564e2 Mon Sep 17 00:00:00 2001 From: "Devarinti, Puneeth Kumar Reddy" Date: Thu, 19 Jan 2023 06:03:19 +0000 Subject: [PATCH] Debug: Add debug logs for firmware module Related-To: LOCI-3877 Signed-off-by: Devarinti, Puneeth Kumar Reddy --- .../tools/source/sysman/firmware/linux/os_firmware_imp.cpp | 2 ++ .../firmware/linux/os_firmware_imp_helper_prelim.cpp | 7 ++++++- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/level_zero/tools/source/sysman/firmware/linux/os_firmware_imp.cpp b/level_zero/tools/source/sysman/firmware/linux/os_firmware_imp.cpp index bff4df9414..18950b7dd7 100644 --- a/level_zero/tools/source/sysman/firmware/linux/os_firmware_imp.cpp +++ b/level_zero/tools/source/sysman/firmware/linux/os_firmware_imp.cpp @@ -7,6 +7,7 @@ #include "level_zero/tools/source/sysman/firmware/linux/os_firmware_imp.h" +#include "shared/source/debug_settings/debug_settings_manager.h" #include "shared/source/helpers/string.h" #include "level_zero/tools/source/sysman/firmware_util/firmware_util.h" @@ -27,6 +28,7 @@ ze_result_t OsFirmware::getSupportedFwTypes(std::vector &supportedF std::vector mtdDescriptorStrings = {}; ze_result_t result = pFsAccess->read(mtdDescriptor, mtdDescriptorStrings); if (result != ZE_RESULT_SUCCESS) { + NEO::printDebugString(NEO::DebugManager.flags.PrintDebugMessages.get(), stderr, "Error@ %s(): FsAccess->read() failed to read %s and returning error:0x%x \n", __FUNCTION__, mtdDescriptor.c_str(), result); return result; } for (const auto &readByteLine : mtdDescriptorStrings) { diff --git a/level_zero/tools/source/sysman/firmware/linux/os_firmware_imp_helper_prelim.cpp b/level_zero/tools/source/sysman/firmware/linux/os_firmware_imp_helper_prelim.cpp index 14a0ea7920..d6e6433163 100644 --- a/level_zero/tools/source/sysman/firmware/linux/os_firmware_imp_helper_prelim.cpp +++ b/level_zero/tools/source/sysman/firmware/linux/os_firmware_imp_helper_prelim.cpp @@ -1,10 +1,12 @@ /* - * Copyright (C) 2021-2022 Intel Corporation + * Copyright (C) 2021-2023 Intel Corporation * * SPDX-License-Identifier: MIT * */ +#include "shared/source/debug_settings/debug_settings_manager.h" + #include "level_zero/tools/source/sysman/firmware/linux/os_firmware_imp.h" #include "level_zero/tools/source/sysman/firmware_util/firmware_util.h" @@ -24,6 +26,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(): SysfsAcess->scanDirEntries() failed to locate device directory at %s and returning error:0x%x \n", __FUNCTION__, iafPath.c_str(), result); return result; } for (const auto &entry : list) { @@ -34,6 +37,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; @@ -41,6 +45,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(): SysfsAccess->read() failed to read %s and returning error:0x%x \n", __FUNCTION__, path.c_str(), result); return result; } strncpy_s(static_cast(pProperties->version), ZES_STRING_PROPERTY_SIZE, pscVersion.c_str(), ZES_STRING_PROPERTY_SIZE - 1);