From 7d39749a084c0dda581f9af8ad97fe300103f5b4 Mon Sep 17 00:00:00 2001 From: "Saeed, Oosman" Date: Fri, 17 Oct 2025 15:42:17 -0500 Subject: [PATCH] [SWDEV-551318] Update readme doc: amdsmi_get_afids_from_cper() input arguments (#766) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * Update readme doc: amdsmi_get_afids_from_cper() input argument is only bytes, not a list of dicts each with keys “bytes” (List[int]) and “size” (int) --------- Signed-off-by: Oosman Saeed [ROCm/amdsmi commit: f7c9fe3011cfcd7d1860743e60c28539d1931fbd] --- projects/amdsmi/docs/reference/amdsmi-py-api.md | 4 +--- projects/amdsmi/py-interface/amdsmi_interface.py | 14 +++++--------- 2 files changed, 6 insertions(+), 12 deletions(-) diff --git a/projects/amdsmi/docs/reference/amdsmi-py-api.md b/projects/amdsmi/docs/reference/amdsmi-py-api.md index bfdf4e1443..968fde8432 100644 --- a/projects/amdsmi/docs/reference/amdsmi-py-api.md +++ b/projects/amdsmi/docs/reference/amdsmi-py-api.md @@ -1316,9 +1316,7 @@ Description: Get the AFIDs from CPER buffer Input parameters: -* `cper_afid_data`: Either - - raw bytes or bytearray of a single CPER record, or - - a list of dicts each with keys "bytes" (List[int]) and "size" (int). +* `cper_afid_data`: raw bytes of a single CPER record. Output: Tuple[List[int], int]: A tuple containing: - A list of extracted AFIDs. diff --git a/projects/amdsmi/py-interface/amdsmi_interface.py b/projects/amdsmi/py-interface/amdsmi_interface.py index ee0e18bb5b..996d69379c 100644 --- a/projects/amdsmi/py-interface/amdsmi_interface.py +++ b/projects/amdsmi/py-interface/amdsmi_interface.py @@ -2724,30 +2724,26 @@ def amdsmi_get_gpu_cper_entries( def amdsmi_get_afids_from_cper( - cper_afid_data: Union[bytes, bytearray, List[Dict[str, Any]]] + cper_afid_data: bytes ) -> Tuple[List[int], int]: """ - Extract AFIDs from one or more CPER blobs. + Extract AFIDs from a CPER blob. Args: - cper_afid_data: Either - - raw bytes or bytearray of a single CPER record, or - - a list of dicts each with keys "bytes" (List[int]) and "size" (int). + cper_afid_data: raw bytes of a single CPER record. Returns: Tuple[List[int], int]: A tuple containing: - A list of extracted AFIDs. - The total count of AFIDs. """ + cper_records = [] # Normalize single blob into a list of records - if isinstance(cper_afid_data, (bytes, bytearray)): + if isinstance(cper_afid_data, bytes): cper_records = [{ "bytes": list(cper_afid_data), "size": len(cper_afid_data) }] - else: - cper_records = cper_afid_data - all_afids: List[int] = [] for record in cper_records: