From 3e419ee84bdb64916fa163a6b6e135d3795169e2 Mon Sep 17 00:00:00 2001 From: Maisam Arif Date: Mon, 14 Apr 2025 17:30:08 -0500 Subject: [PATCH] CPER Tests fix Signed-off-by: Maisam Arif Change-Id: I5c1b85c37df07b912ad82b50a3658a8a7edaccb1 [ROCm/amdsmi commit: 81c53e179d2f8dc09839dcd58777aa2b603e5d9a] --- projects/amdsmi/amdsmi_cli/amdsmi_commands.py | 5 +++-- projects/amdsmi/amdsmi_cli/amdsmi_helpers.py | 2 ++ projects/amdsmi/src/amd_smi/amd_smi.cc | 2 +- .../amdsmi/tests/amd_smi_test/amdsmitst.exclude | 9 +++++++-- .../cper/sys/kernel/debug/dri/1/amdgpu_ring_cper | Bin 8736 -> 0 bytes .../sys/kernel/debug/dri/17/amdgpu_ring_cper | Bin 3304 -> 0 bytes .../sys/kernel/debug/dri/25/amdgpu_ring_cper | Bin 1504 -> 0 bytes .../sys/kernel/debug/dri/33/amdgpu_ring_cper | Bin 3456 -> 0 bytes .../sys/kernel/debug/dri/41/amdgpu_ring_cper | Bin 376 -> 0 bytes .../sys/kernel/debug/dri/49/amdgpu_ring_cper | Bin 848 -> 0 bytes .../sys/kernel/debug/dri/57/amdgpu_ring_cper | Bin 12 -> 0 bytes .../cper/sys/kernel/debug/dri/9/amdgpu_ring_cper | Bin 3680 -> 0 bytes 12 files changed, 13 insertions(+), 5 deletions(-) delete mode 100644 projects/amdsmi/tests/amd_smi_test/cper/sys/kernel/debug/dri/1/amdgpu_ring_cper delete mode 100644 projects/amdsmi/tests/amd_smi_test/cper/sys/kernel/debug/dri/17/amdgpu_ring_cper delete mode 100644 projects/amdsmi/tests/amd_smi_test/cper/sys/kernel/debug/dri/25/amdgpu_ring_cper delete mode 100644 projects/amdsmi/tests/amd_smi_test/cper/sys/kernel/debug/dri/33/amdgpu_ring_cper delete mode 100644 projects/amdsmi/tests/amd_smi_test/cper/sys/kernel/debug/dri/41/amdgpu_ring_cper delete mode 100644 projects/amdsmi/tests/amd_smi_test/cper/sys/kernel/debug/dri/49/amdgpu_ring_cper delete mode 100644 projects/amdsmi/tests/amd_smi_test/cper/sys/kernel/debug/dri/57/amdgpu_ring_cper delete mode 100644 projects/amdsmi/tests/amd_smi_test/cper/sys/kernel/debug/dri/9/amdgpu_ring_cper 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 a494b69d66fef1f7343cfefe26de1b5e917189f3..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 8736 zcmZQzU|{IrfMDkU*B}PQ|3JXVzz7s)2jU7KLq|)TL7rJs#Gt~^z`)4Lpu*h5(FiDq z4ia-y(hEuvqW|*0zL+!dsL!sB)YT6?g?F1;88T?h|NkGM0+n?F$lUN_c zy>Zc+O!0{1MQbv{9drEAgpxW{ zYL%0&qxBzf{84R?l#^;?#w%ty=|(WW4(D=Gi^Ou0kC|He$g=+C? s$S^wpHfYL8a^n@VoHR5d6tBa%oCJ+;kkXzMXQf(xG9E1_=`&9Q0CVHY#m>7T* zLj}(oBW1O39*v9EWQsS0%A%@f0K3uO(bo)JoCTzr0)We2VvS{FXh5+Y=3{A)0S*dx z8W8e~Obi?sfWgh63Y22Bk7Ss(0IZb@Oj3!!6|b`9)QVRl28{(UUt&6XG+yZ&uNDl# zRLZZ$qwzY3@+&(dwc^!;L36Ym9yH~!71iR^bTq#XqWsFkOs)KCHX5&kC|<=_sTHs0 Kqwz|ocm)8$a98O7 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 f307556a78cf82df8469bf996599d980d1b1c806..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 1504 zcmZQzU|^_Vgka|Y*B}PQ|3JXV02E?ihsrUT3NbLUNQxL#7#bKDSs7HAn>ZQ)<J)V9T?8UhPyheFqP7~@o2b{5bjn~3wM*zaEFFF05YbSpa1{> 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 194a1f7036c9c187488b91bf88b810443ae64d77..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 3456 zcmZQzU|>jKhG6Fa*B}PQ|3JXVzz7s)2jU7KL)}z}fssX0#Gt~^z`)4Lpu*h5(FiDq z4ia-y(hEuvqW|*0zL+!dsL!sB)YT6?g?AfU88T=r`2QcF0+n?F$lUxkwDBJ~scEiHGanYJg@rF=Ykeko}ws2>G`UhPt zv3y+i5^F3YLj#Ic|M_8DI|c?0g&8m&gyy*L8)&d1hy#reFdJ17MLgQatMSN;S7-?$ z4N4dW3U>}%{l@`~C`L90jtjuzi$N76ps&d=4OE~ouyBJ&Y60YU1vvp$P71OKQ>mOZ zAsDZt!HVu&t>3{BXBZ+6N4^1;N>7N;}|O3QMiaG a2Z0Spq;`cR!?XgBHypU9l*7G476Sn3K~Ty7 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 686082edec957149c5811173e0fa2fedc00d2559..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 376 zcmZQzU|@)YV&?$YAO^<&K)}er2oz%n;tC)`lTDa`kwsF(pu*6=z{tv=!ra8s2q=dR z5_4113rZ29|MI`Sm^1OH&#sQt)ek*|cNL2`I)6#5Wj03}FUF7D*9<3PS?}BP)Xna}!4+pfEZ} z%uPuzC`E{F>^`S^eJ`Ku&b4#CyuR{df`OGGgT{jY{}C!sSto#80ib=1N=ytOYb$ux z7%8iL^JrYOCR4m2R2Ee=1K5rJj=l!y;w&J|6aZZI5^F3YLj#KKpb!NK1TeAzNrf56 zl1vO77k&Z_Rs{)8+8`L<0G9RAZJYyUP=i2@SCAh-@mc|7Fp?Rs|MI`Sm^1OH&#sQt z)ek*|cN(KoOawE2QMOQ~}J|lwyij@H%hcYbK1s4Ry F9{~P{TKoV2 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 ce58bc9f84b9623e708de4eb8427a57d9f9a160f..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 12 KcmZQzKmY&$3;+QD 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 377c797bfb5c388aef06796a53fdd4ffcecebea8..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 3680 zcmZQzU|^WR48hI;u0afp|ABy!fe9$i4#YPY85pchgculEBt;A=3=Is7tPCp5O&pDY za_As2HzmEG6d}5?`<(9ey?m}a*UtI!`pS<9CRT8SG8d$3X*OYP;BPik^$1BJnSiCZrk{7T4^1r^AGx4a; zu8!2z4?Tr5%fkMDOQpxKNy06n||UPznWr+=#6`jG|}&IE)MmXttuZmq6_!0J{=;*Z=?k