diff --git a/projects/amdsmi/amdsmi_cli/amdsmi_commands.py b/projects/amdsmi/amdsmi_cli/amdsmi_commands.py index 9d8920e186..69c18eb7dc 100644 --- a/projects/amdsmi/amdsmi_cli/amdsmi_commands.py +++ b/projects/amdsmi/amdsmi_cli/amdsmi_commands.py @@ -6383,8 +6383,9 @@ class AMDSMICommands(): except amdsmi_exception.AmdSmiLibraryException as e: if e.get_error_code() == amdsmi_interface.amdsmi_wrapper.AMDSMI_STATUS_NO_PERM: raise PermissionError('Error opening CPER file. This command requires elevation') from e - if e.get_error_code() == amdsmi_interface.amdsmi_wrapper.AMDSMI_STATUS_FILE_NOT_FOUND: - raise FileNotFoundError('Error opening CPER file. This command requires a CPER to be enabled.') from e + if e.get_error_code() == amdsmi_interface.amdsmi_wrapper.AMDSMI_STATUS_NOT_SUPPORTED or \ + e.get_error_code() == amdsmi_interface.amdsmi_wrapper.AMDSMI_STATUS_FILE_NOT_FOUND: + raise FileNotFoundError('Error accessing CPER files. This command requires CPER to be enabled.') from e if e.get_error_code() == amdsmi_interface.amdsmi_wrapper.AMDSMI_STATUS_FILE_ERROR: raise FileExistsError('Error opening CPER file. Unable to read CPER File') from e else: diff --git a/projects/amdsmi/amdsmi_cli/amdsmi_helpers.py b/projects/amdsmi/amdsmi_cli/amdsmi_helpers.py index 0e53d8b1cd..d1f52d84bb 100644 --- a/projects/amdsmi/amdsmi_cli/amdsmi_helpers.py +++ b/projects/amdsmi/amdsmi_cli/amdsmi_helpers.py @@ -1062,6 +1062,7 @@ class AMDSMIHelpers(): print(msg) logging.warning(msg) + def hexdump(self, data, size, filepath): """ Converts binary data to a hex dump string, similar to the hexdump utility. @@ -1078,6 +1079,7 @@ class AMDSMIHelpers(): print(f"{offset:08x} {hex_values:<48} |{ascii_values}|", file=f) offset += 16 + def dump_entries(self, folder, entries, cper_data): if folder: folder = Path(folder) diff --git a/projects/amdsmi/src/amd_smi/amd_smi.cc b/projects/amdsmi/src/amd_smi/amd_smi.cc index d0947808f7..27e952834e 100644 --- a/projects/amdsmi/src/amd_smi/amd_smi.cc +++ b/projects/amdsmi/src/amd_smi/amd_smi.cc @@ -3627,7 +3627,7 @@ static auto amdsmi_read_cper_file(const std::string &filepath) { } else { ss << __PRETTY_FUNCTION__ << "\n:" << __LINE__ << "[CPER] file does not exist: " << filepath << ", errno: " << errno << "): " << strerror(errno); - ctx.status = AMDSMI_STATUS_FILE_NOT_FOUND; + ctx.status = AMDSMI_STATUS_NOT_SUPPORTED; return ctx; } diff --git a/projects/amdsmi/tests/amd_smi_test/amdsmitst.exclude b/projects/amdsmi/tests/amd_smi_test/amdsmitst.exclude index bfbae4db2e..8095d47e0c 100644 --- a/projects/amdsmi/tests/amd_smi_test/amdsmitst.exclude +++ b/projects/amdsmi/tests/amd_smi_test/amdsmitst.exclude @@ -12,7 +12,7 @@ PERMANENT_BLACKLIST_ALL_ASICS= # This is the temporary blacklist for all ASICs. This is to be used when a test # is failing consistently -TEMPORARY_BLACKLIST_ALL_ASICS= +TEMPORARY_BLACKLIST_ALL_ASICS="CperEntriesTest.*" if [ -z "$PERMANENT_BLACKLIST_ALL_ASICS" -a -z "$TEMPORARY_BLACKLIST_ALL_ASICS" ]; then @@ -25,17 +25,20 @@ fi # Device specific blacklists FILTER[vega10]=\ -$BLACKLIST_ALL_ASICS +$BLACKLIST_ALL_ASICS\ +"CperEntriesTest.*" # SWDEV-207510 FILTER[vega20]=\ $BLACKLIST_ALL_ASICS\ +"CperEntriesTest.*:"\ "amdsmitstReadOnly.TestFrequenciesRead:"\ "amdsmitstReadOnly.TestProcInfoRead" # SWDEV-207510 FILTER[arcturus]=\ $BLACKLIST_ALL_ASICS\ +"CperEntriesTest.*:"\ "amdsmitstReadOnly.TestFrequenciesRead:"\ "amdsmitstReadWrite.TestFrequenciesReadWrite:"\ "amdsmitstReadOnly.TestProcInfoRead" @@ -43,6 +46,7 @@ $BLACKLIST_ALL_ASICS\ # SWDEV-306889 FILTER[aldebaran]=\ $BLACKLIST_ALL_ASICS\ +"CperEntriesTest.*:"\ "amdsmitstReadOnly.FanRead:"\ "amdsmitstReadOnly.TestVoltCurvRead:"\ "amdsmitstReadOnly.TestFrequenciesRead:"\ @@ -54,6 +58,7 @@ $BLACKLIST_ALL_ASICS\ # SWDEV-319795 FILTER[sienna_cichlid]=\ $BLACKLIST_ALL_ASICS\ +"CperEntriesTest.*:"\ "amdsmitstReadWrite.TestPerfLevelReadWrite" # SWDEV-321166 diff --git a/projects/amdsmi/tests/amd_smi_test/cper/sys/kernel/debug/dri/1/amdgpu_ring_cper b/projects/amdsmi/tests/amd_smi_test/cper/sys/kernel/debug/dri/1/amdgpu_ring_cper deleted file mode 100644 index a494b69d66..0000000000 Binary files a/projects/amdsmi/tests/amd_smi_test/cper/sys/kernel/debug/dri/1/amdgpu_ring_cper and /dev/null differ diff --git a/projects/amdsmi/tests/amd_smi_test/cper/sys/kernel/debug/dri/17/amdgpu_ring_cper b/projects/amdsmi/tests/amd_smi_test/cper/sys/kernel/debug/dri/17/amdgpu_ring_cper deleted file mode 100644 index 58ddb43c5b..0000000000 Binary files a/projects/amdsmi/tests/amd_smi_test/cper/sys/kernel/debug/dri/17/amdgpu_ring_cper and /dev/null differ diff --git a/projects/amdsmi/tests/amd_smi_test/cper/sys/kernel/debug/dri/25/amdgpu_ring_cper b/projects/amdsmi/tests/amd_smi_test/cper/sys/kernel/debug/dri/25/amdgpu_ring_cper deleted file mode 100644 index f307556a78..0000000000 Binary files a/projects/amdsmi/tests/amd_smi_test/cper/sys/kernel/debug/dri/25/amdgpu_ring_cper and /dev/null differ diff --git a/projects/amdsmi/tests/amd_smi_test/cper/sys/kernel/debug/dri/33/amdgpu_ring_cper b/projects/amdsmi/tests/amd_smi_test/cper/sys/kernel/debug/dri/33/amdgpu_ring_cper deleted file mode 100644 index 194a1f7036..0000000000 Binary files a/projects/amdsmi/tests/amd_smi_test/cper/sys/kernel/debug/dri/33/amdgpu_ring_cper and /dev/null differ diff --git a/projects/amdsmi/tests/amd_smi_test/cper/sys/kernel/debug/dri/41/amdgpu_ring_cper b/projects/amdsmi/tests/amd_smi_test/cper/sys/kernel/debug/dri/41/amdgpu_ring_cper deleted file mode 100644 index 686082edec..0000000000 Binary files a/projects/amdsmi/tests/amd_smi_test/cper/sys/kernel/debug/dri/41/amdgpu_ring_cper and /dev/null differ diff --git a/projects/amdsmi/tests/amd_smi_test/cper/sys/kernel/debug/dri/49/amdgpu_ring_cper b/projects/amdsmi/tests/amd_smi_test/cper/sys/kernel/debug/dri/49/amdgpu_ring_cper deleted file mode 100644 index 7479297920..0000000000 Binary files a/projects/amdsmi/tests/amd_smi_test/cper/sys/kernel/debug/dri/49/amdgpu_ring_cper and /dev/null differ diff --git a/projects/amdsmi/tests/amd_smi_test/cper/sys/kernel/debug/dri/57/amdgpu_ring_cper b/projects/amdsmi/tests/amd_smi_test/cper/sys/kernel/debug/dri/57/amdgpu_ring_cper deleted file mode 100644 index ce58bc9f84..0000000000 Binary files a/projects/amdsmi/tests/amd_smi_test/cper/sys/kernel/debug/dri/57/amdgpu_ring_cper and /dev/null differ diff --git a/projects/amdsmi/tests/amd_smi_test/cper/sys/kernel/debug/dri/9/amdgpu_ring_cper b/projects/amdsmi/tests/amd_smi_test/cper/sys/kernel/debug/dri/9/amdgpu_ring_cper deleted file mode 100644 index 377c797bfb..0000000000 Binary files a/projects/amdsmi/tests/amd_smi_test/cper/sys/kernel/debug/dri/9/amdgpu_ring_cper and /dev/null differ