[SWDEV-551318] Update readme doc: amdsmi_get_afids_from_cper() input arguments (#766)

* 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 <oossaeed@amd.com>
This commit is contained in:
Saeed, Oosman
2025-10-17 15:42:17 -05:00
committed by GitHub
parent 460cfcba1f
commit f7c9fe3011
2 changed files with 6 additions and 12 deletions
+1 -3
View File
@@ -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.
+5 -9
View File
@@ -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: