[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>
[ROCm/amdsmi commit: f7c9fe3011]
Этот коммит содержится в:
коммит произвёл
GitHub
родитель
5ec7b213e4
Коммит
7d39749a08
@@ -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.
|
||||
|
||||
@@ -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:
|
||||
|
||||
Ссылка в новой задаче
Block a user