commit | ad6c880fc739b6ca750c3ab594e270efd972c2ac | [log] [tgz] |
---|---|---|
author | Aushim Nagarkatti <anagarkatti@nvidia.com> | Wed Jun 18 16:45:28 2025 -0700 |
committer | Aushim Nagarkatti <anagarkatti@nvidia.com> | Mon Jul 07 13:38:26 2025 -0700 |
tree | 5c06d5ed1edce592857561481fbf6cc0e0c92c39 | |
parent | c1e38a1a844e56292ac357be4838c4a15065743e [diff] |
Support to stringify CPER output Initial commit to add a "message" property that provides a single line description of some important properties. This makes it easier to parse multiple CPERs in crowded logs. For now, "message" is supported for nvidia, arm processor and memory types. The other types contain generic messages. Example output: ``` "sections":[ { "message":"A Corrected CCPLEXSCF NVIDIA Error occurred on CPU 0", "Nvidia":{ "signature":"CCPLEXSC", "sections":[ { "message":"An ARM Processor Error occurred on CPU 0; Error Type(s): {Cache Error at Virtual Addr=0x41D6AA12D528 Physical Addr=0x80003A198DDA10}", "ArmProcessor":{ "errorInfoNum":1, "sections":[ { "message":"A Multi-bit ECC Memory Error occurred at address 0x0000000080000000 at node 0", ``` Change-Id: I395d0370ec60579b8f7fede825b45a3ced8ff18f Signed-off-by: Aushim Nagarkatti <anagarkatti@nvidia.com>
This repository specifies a structure for representing UEFI CPER records (as described in UEFI Specification Appendix N) in a human-readable JSON format, in addition to a library which can readily convert back and forth between the standard CPER binary format and the specified structured JSON.
Before building this library and its associated tools, you must have meson (>=1.1.1)
This project uses Meson (>=1.1.1). To build for native architecture, simply run:
meson setup build ninja -C build
This project comes with several binaries to help you deal with CPER binary and CPER-JSON. The first of these is cper-convert
, which is a command line tool that can be found in build/
. With this, you can convert to and from CPER and CPER-JSON through the command line. An example usage scenario is below:
cper-convert to-cper samples/cper-json-test-arm.json --out cper.dump cper-convert to-json cper.generated.dump
Another tool bundled with this repository is cper-generate
, found in build/
. This allows you to generate pseudo-random valid CPER records with sections of specified types for testing purposes. An example use of the program is below:
cper-generate --out cper.generated.dump --sections generic ia32x64
Help for both of these tools can be accessed through using the --help
flag in isolation.
Finally, a static library containing symbols for converting CPER and CPER-JSON between an intermediate JSON format can be found generated at lib/libcper-parse.a
. This contains the following useful library symbols:
json_object* cper_to_ir(FILE* cper_file); void ir_to_cper(json_object* ir, FILE* out);
The specification for this project's CPER-JSON format can be found in specification/
, defined in both JSON Schema format and also as a LaTeX document. Specification for the CPER binary format can be found in UEFI Specification Appendix N (2021/03/18).
This library is utilised in a proof of concept displaying CPER communication between a SatMC and OpenBMC board, including a conversion into CPER JSON for logging that utilises this library. You can find information on how to reproduce the prototype at the scripts repository, and example usage of the library itself at the pldm repository.