diff --git a/level_zero/api/sysman/zes_sysman.cpp b/level_zero/api/sysman/zes_sysman.cpp index a25084f50d..9e1e92150f 100644 --- a/level_zero/api/sysman/zes_sysman.cpp +++ b/level_zero/api/sysman/zes_sysman.cpp @@ -648,7 +648,7 @@ zesRasGetState( zes_ras_handle_t hRas, ze_bool_t clear, zes_ras_state_t *pState) { - return L0::Ras::fromHandle(hRas)->rasGetState(pState); + return L0::Ras::fromHandle(hRas)->rasGetState(pState, clear); } ZE_APIEXPORT ze_result_t ZE_APICALL diff --git a/level_zero/tools/source/sysman/ras/linux/os_ras_imp.cpp b/level_zero/tools/source/sysman/ras/linux/os_ras_imp.cpp index 9aad10e419..cb84d8fb5d 100644 --- a/level_zero/tools/source/sysman/ras/linux/os_ras_imp.cpp +++ b/level_zero/tools/source/sysman/ras/linux/os_ras_imp.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2020 Intel Corporation + * Copyright (C) 2020-2021 Intel Corporation * * SPDX-License-Identifier: MIT * @@ -15,7 +15,7 @@ ze_result_t OsRas::getSupportedRasErrorTypes(std::vector & return ZE_RESULT_ERROR_UNSUPPORTED_FEATURE; } -ze_result_t LinuxRasImp::osRasGetState(zes_ras_state_t &state) { +ze_result_t LinuxRasImp::osRasGetState(zes_ras_state_t &state, ze_bool_t clear) { return ZE_RESULT_ERROR_UNSUPPORTED_FEATURE; } diff --git a/level_zero/tools/source/sysman/ras/linux/os_ras_imp.h b/level_zero/tools/source/sysman/ras/linux/os_ras_imp.h index 3a7b0746db..51cd0da218 100644 --- a/level_zero/tools/source/sysman/ras/linux/os_ras_imp.h +++ b/level_zero/tools/source/sysman/ras/linux/os_ras_imp.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2020 Intel Corporation + * Copyright (C) 2020-2021 Intel Corporation * * SPDX-License-Identifier: MIT * @@ -15,7 +15,7 @@ namespace L0 { class LinuxRasImp : public OsRas, NEO::NonCopyableOrMovableClass { public: ze_result_t osRasGetProperties(zes_ras_properties_t &properties) override; - ze_result_t osRasGetState(zes_ras_state_t &state) override; + ze_result_t osRasGetState(zes_ras_state_t &state, ze_bool_t clear) override; LinuxRasImp(OsSysman *pOsSysman, zes_ras_error_type_t type, ze_bool_t onSubdevice, uint32_t subdeviceId); LinuxRasImp() = default; ~LinuxRasImp() override = default; diff --git a/level_zero/tools/source/sysman/ras/os_ras.h b/level_zero/tools/source/sysman/ras/os_ras.h index 9205b0814c..8a30e85c94 100644 --- a/level_zero/tools/source/sysman/ras/os_ras.h +++ b/level_zero/tools/source/sysman/ras/os_ras.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2020 Intel Corporation + * Copyright (C) 2020-2021 Intel Corporation * * SPDX-License-Identifier: MIT * @@ -17,7 +17,7 @@ struct OsSysman; class OsRas { public: virtual ze_result_t osRasGetProperties(zes_ras_properties_t &properties) = 0; - virtual ze_result_t osRasGetState(zes_ras_state_t &state) = 0; + virtual ze_result_t osRasGetState(zes_ras_state_t &state, ze_bool_t clear) = 0; static OsRas *create(OsSysman *pOsSysman, zes_ras_error_type_t type, ze_bool_t onSubdevice, uint32_t subdeviceId); static ze_result_t getSupportedRasErrorTypes(std::vector &errorType, OsSysman *pOsSysman, ze_device_handle_t deviceHandle); virtual ~OsRas() = default; diff --git a/level_zero/tools/source/sysman/ras/ras.h b/level_zero/tools/source/sysman/ras/ras.h index 23cb7535d9..4f4c30a662 100644 --- a/level_zero/tools/source/sysman/ras/ras.h +++ b/level_zero/tools/source/sysman/ras/ras.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2020 Intel Corporation + * Copyright (C) 2020-2021 Intel Corporation * * SPDX-License-Identifier: MIT * @@ -24,7 +24,7 @@ class Ras : _zes_ras_handle_t { virtual ze_result_t rasGetProperties(zes_ras_properties_t *pProperties) = 0; virtual ze_result_t rasGetConfig(zes_ras_config_t *pConfig) = 0; virtual ze_result_t rasSetConfig(const zes_ras_config_t *pConfig) = 0; - virtual ze_result_t rasGetState(zes_ras_state_t *pState) = 0; + virtual ze_result_t rasGetState(zes_ras_state_t *pState, ze_bool_t clear) = 0; static Ras *fromHandle(zes_ras_handle_t handle) { return static_cast(handle); diff --git a/level_zero/tools/source/sysman/ras/ras_imp.cpp b/level_zero/tools/source/sysman/ras/ras_imp.cpp index f92092ddf9..0e977a7f0e 100644 --- a/level_zero/tools/source/sysman/ras/ras_imp.cpp +++ b/level_zero/tools/source/sysman/ras/ras_imp.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2020 Intel Corporation + * Copyright (C) 2020-2021 Intel Corporation * * SPDX-License-Identifier: MIT * @@ -27,8 +27,9 @@ ze_result_t RasImp::rasSetConfig(const zes_ras_config_t *pConfig) { return ZE_RESULT_ERROR_UNSUPPORTED_FEATURE; } -ze_result_t RasImp::rasGetState(zes_ras_state_t *pState) { - return pOsRas->osRasGetState(*pState); +ze_result_t RasImp::rasGetState(zes_ras_state_t *pState, ze_bool_t clear) { + memset(pState->category, 0, sizeof(pState->category)); + return pOsRas->osRasGetState(*pState, clear); } void RasImp::init() { diff --git a/level_zero/tools/source/sysman/ras/ras_imp.h b/level_zero/tools/source/sysman/ras/ras_imp.h index 92672278cc..6e549ee64c 100644 --- a/level_zero/tools/source/sysman/ras/ras_imp.h +++ b/level_zero/tools/source/sysman/ras/ras_imp.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2020 Intel Corporation + * Copyright (C) 2020-2021 Intel Corporation * * SPDX-License-Identifier: MIT * @@ -19,7 +19,7 @@ class RasImp : public Ras, NEO::NonCopyableOrMovableClass { ze_result_t rasGetProperties(zes_ras_properties_t *pProperties) override; ze_result_t rasGetConfig(zes_ras_config_t *pConfig) override; ze_result_t rasSetConfig(const zes_ras_config_t *pConfig) override; - ze_result_t rasGetState(zes_ras_state_t *pConfig) override; + ze_result_t rasGetState(zes_ras_state_t *pConfig, ze_bool_t clear) override; RasImp() = default; RasImp(OsSysman *pOsSysman, zes_ras_error_type_t type, ze_device_handle_t deviceHandle); diff --git a/level_zero/tools/source/sysman/ras/windows/os_ras_imp.cpp b/level_zero/tools/source/sysman/ras/windows/os_ras_imp.cpp index 60630e9d6c..59b00973ca 100644 --- a/level_zero/tools/source/sysman/ras/windows/os_ras_imp.cpp +++ b/level_zero/tools/source/sysman/ras/windows/os_ras_imp.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2020 Intel Corporation + * Copyright (C) 2020-2021 Intel Corporation * * SPDX-License-Identifier: MIT * @@ -11,7 +11,7 @@ namespace L0 { class WddmRasImp : public OsRas { ze_result_t osRasGetProperties(zes_ras_properties_t &properties) override; - ze_result_t osRasGetState(zes_ras_state_t &state) override; + ze_result_t osRasGetState(zes_ras_state_t &state, ze_bool_t clear) override; }; ze_result_t OsRas::getSupportedRasErrorTypes(std::vector &errorType, OsSysman *pOsSysman, ze_device_handle_t deviceHandle) { @@ -22,7 +22,7 @@ ze_result_t WddmRasImp::osRasGetProperties(zes_ras_properties_t &properties) { return ZE_RESULT_ERROR_UNSUPPORTED_FEATURE; } -ze_result_t WddmRasImp::osRasGetState(zes_ras_state_t &state) { +ze_result_t WddmRasImp::osRasGetState(zes_ras_state_t &state, ze_bool_t clear) { return ZE_RESULT_ERROR_UNSUPPORTED_FEATURE; } diff --git a/level_zero/tools/test/black_box_tests/zello_sysman.cpp b/level_zero/tools/test/black_box_tests/zello_sysman.cpp index b98e4d8e64..b9fc34cea0 100644 --- a/level_zero/tools/test/black_box_tests/zello_sysman.cpp +++ b/level_zero/tools/test/black_box_tests/zello_sysman.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2020 Intel Corporation + * Copyright (C) 2020-2021 Intel Corporation * * SPDX-License-Identifier: MIT * @@ -360,8 +360,19 @@ void testSysmanRas(ze_device_handle_t &device) { if (rasProperties.type == ZES_RAS_ERROR_TYPE_UNCORRECTABLE) { std::cout << "Number of fatal accelerator engine resets attempted by the driver = " << rasState.category[ZES_RAS_ERROR_CAT_RESET] << std::endl; std::cout << "Number of fatal errors that have occurred in caches = " << rasState.category[ZES_RAS_ERROR_CAT_CACHE_ERRORS] << std::endl; + std::cout << "Number of fatal programming errors that have occurred = " << rasState.category[ZES_RAS_ERROR_CAT_PROGRAMMING_ERRORS] << std::endl; + std::cout << "Number of fatal driver errors that have occurred = " << rasState.category[ZES_RAS_ERROR_CAT_DRIVER_ERRORS] << std::endl; + std::cout << "Number of fatal compute errors that have occurred = " << rasState.category[ZES_RAS_ERROR_CAT_COMPUTE_ERRORS] << std::endl; + std::cout << "Number of fatal non compute errors that have occurred = " << rasState.category[ZES_RAS_ERROR_CAT_NON_COMPUTE_ERRORS] << std::endl; + std::cout << "Number of fatal display errors that have occurred = " << rasState.category[ZES_RAS_ERROR_CAT_DISPLAY_ERRORS] << std::endl; } else { + std::cout << "Number of correctable accelerator engine resets attempted by the driver = " << rasState.category[ZES_RAS_ERROR_CAT_RESET] << std::endl; std::cout << "Number of correctable errors that have occurred in caches = " << rasState.category[ZES_RAS_ERROR_CAT_CACHE_ERRORS] << std::endl; + std::cout << "Number of correctable programming errors that have occurred = " << rasState.category[ZES_RAS_ERROR_CAT_PROGRAMMING_ERRORS] << std::endl; + std::cout << "Number of correctable driver errors that have occurred = " << rasState.category[ZES_RAS_ERROR_CAT_DRIVER_ERRORS] << std::endl; + std::cout << "Number of correctable compute errors that have occurred = " << rasState.category[ZES_RAS_ERROR_CAT_COMPUTE_ERRORS] << std::endl; + std::cout << "Number of correctable non compute errors that have occurred = " << rasState.category[ZES_RAS_ERROR_CAT_NON_COMPUTE_ERRORS] << std::endl; + std::cout << "Number of correctable display errors that have occurred = " << rasState.category[ZES_RAS_ERROR_CAT_DISPLAY_ERRORS] << std::endl; } } }