History log of /openbmc/libcper/cper-parse.c (Results 1 – 25 of 41)
Revision Date Author Comments
# ae8f6d9a 29-Jan-2025 Aushim Nagarkatti <anagarkatti@nvidia.com>

Remove validation bits

Discard invalid properties from json decode. JSON output should only
contain valid properties. This saves time in preventing post
processing of output for valid fields.

Ensur

Remove validation bits

Discard invalid properties from json decode. JSON output should only
contain valid properties. This saves time in preventing post
processing of output for valid fields.

Ensure round trip validity with validation bits removed and required
properties populated.

Fix bugs in json decode.

Overhaul unit tests to use valijson. Add tests with static examples
to validate against schema. Use and nlohmann for better schema
validation over intrinsic libcper validation.

Example json output before:
{
"ValidationBits": {
"LevelValid": false,
"CorrectedValid": true
},
"Level": 1,
"Corrected": true
}

After:
{
"Corrected": true
}

Change-Id: I188bdc2827a57d938c22a431238fadfcdc939ab8
Signed-off-by: Aushim Nagarkatti <anagarkatti@nvidia.com>

show more ...


# 13f099ff 20-Nov-2024 Ed Tanous <etanous@nvidia.com>

Fix timestamp buffer length overrun

Addresses the buffer overrun introduced by format changes.

Change-Id: I8341818747b43883a3d3b243e9a1fbc5bcc927cf
Signed-off-by: Andrew Adriance <aadriance@nvidia.

Fix timestamp buffer length overrun

Addresses the buffer overrun introduced by format changes.

Change-Id: I8341818747b43883a3d3b243e9a1fbc5bcc927cf
Signed-off-by: Andrew Adriance <aadriance@nvidia.com>
Signed-off-by: Ed Tanous <etanous@nvidia.com>

show more ...


# e42fb487 15-Oct-2024 Thu Nguyen <thu@os.amperecomputing.com>

Change include style to use system includes

The libcper header files in `libcper` are installed to
`usr/include/libcper`. Use that system includes in `libcper` source
instead of using the project in

Change include style to use system includes

The libcper header files in `libcper` are installed to
`usr/include/libcper`. Use that system includes in `libcper` source
instead of using the project includes.

Change-Id: I596edc2c754dae4829844f535a1e34caa246fb43
Signed-off-by: Thu Nguyen <thu@os.amperecomputing.com>

show more ...


# a3b7f8a2 04-Nov-2024 Ed Tanous <etanous@nvidia.com>

Unflatten edk includes

Installing the edk headers into a folder requires us to do odd things
with imports, and either include headers with "..", or otherwise get the
include directories lined up.

M

Unflatten edk includes

Installing the edk headers into a folder requires us to do odd things
with imports, and either include headers with "..", or otherwise get the
include directories lined up.

Move the contents of edk/*.c/h up a level, and just simplify the include
structure. This is done to fix the immediate change of the prior patch
and make this build again. Happy to discuss other options.

Change-Id: I328f20bca6d23100993493445bee0e5e11d2866a
Signed-off-by: Ed Tanous <etanous@nvidia.com>

show more ...


# b07061ab 22-Sep-2024 Ed Tanous <etanous@nvidia.com>

Make key types based on id

This commit separates out the libcper json output by section name.
Previously, each section was

i.e., for e.g., add "Nvidia" for the NVIDIA section
```
"sections": [

Make key types based on id

This commit separates out the libcper json output by section name.
Previously, each section was

i.e., for e.g., add "Nvidia" for the NVIDIA section
```
"sections": [
{
"Nvidia":{
"socket": 0
}
}
]
```
instead of
```
"sections": [
{
"socket": 0
}
]
```

This allows disambiguating between multiple fields with different types
and removes collisions between the field names.

Change-Id: I4e257f1e04fc5fbf2798955d3a5d93214c81f0fc
Signed-off-by: Karthik Rajagopalan <krajagopalan@nvidia.com>
Signed-off-by: Ed Tanous <etanous@nvidia.com>

show more ...


# 5220c9bd 08-Aug-2024 Karthik Rajagopalan <krajagopalan@nvidia.com>

Add ability to use lib without json-c dependency

Adds 2 wrapper APIs to parse raw CPER & return char* for json
cperbuf_to_str_ir - parses a full CPER
cperbuf_single_section_to_str_ir - parses a sing

Add ability to use lib without json-c dependency

Adds 2 wrapper APIs to parse raw CPER & return char* for json
cperbuf_to_str_ir - parses a full CPER
cperbuf_single_section_to_str_ir - parses a single-section CPER

Change-Id: Ief018cc421497a8c366157a21e83ef60641e2646
Signed-off-by: Karthik Rajagopalan <krajagopalan@nvidia.com>

show more ...


# bf6ccc85 05-Aug-2024 Karthik Rajagopalan <krajagopalan@nvidia.com>

Fix leaked json objects when there is a failure parsing

An example that was flagged from the app that uses libcper:
'''
Indirect leak of 96 byte(s) in 2 object(s) allocated from:
#0 0x7f93e0ddaf

Fix leaked json objects when there is a failure parsing

An example that was flagged from the app that uses libcper:
'''
Indirect leak of 96 byte(s) in 2 object(s) allocated from:
#0 0x7f93e0ddafdf in __interceptor_malloc ../../../../src/libsanitizer/asan/asan_malloc_linux.cpp:69
#1 0x7f93e0b97cde in json_object_new /json-c-json-c-0.17-20230812/json_object.c:321
#2 0x7f93e0b97cde in json_object_new_object /json-c-json-c-0.17-20230812/json_object.c:532
#3 0x7f93e0c8ac81 in cper_to_ir ../subprojects/libcper/cper-parse.c:45
'''

Change-Id: I6c77cf797bb369d6e459545cf021f31c47dbe6a0
Signed-off-by: Karthik Rajagopalan <krajagopalan@nvidia.com>

show more ...


# a7d2cddd 15-Jul-2024 Ed Tanous <etanous@nvidia.com>

Move to embedded base64

Base64 encode/decode is a relatively simple algorithm, and currently
libcper takes a dependency on libb64 for this. libb64 does not have
methods for determining the encoded

Move to embedded base64

Base64 encode/decode is a relatively simple algorithm, and currently
libcper takes a dependency on libb64 for this. libb64 does not have
methods for determining the encoded size or decoded size, and rely on
the user to provide the right buffer sizes, which libcper currently
approximates as 2X the input size (which is incorrect).

This commit removes the libb64 dependency entirely, and inlines a
libcper specific base64 encoder and decoder, using EDK2-allowed types.

The implementation itself is unique to libcper and makes the following
design decisions.
1. Malloc is performed within the base64_<> functions. This reduces the
number of malloc calls total, and removes the need for separately
determining the output size.
2. Arguments are passed in by EDK2-types under the assumption that this
will keep compatibility with EDK2 implementations.
3. Incremental parsing is not supported. CPER records are expected to
be algorithmically small, and buffered such that the entire value
fits in memory. This was already an assumption, but dropping the
support for incremental encoding significantly reduces the amount of
code to support it. It could be added back in the future if needed.

Change-Id: Idb010db105067ea317dbee05c2663511ab3c6611
Signed-off-by: Ed Tanous <ed@tanous.net>

show more ...


# fedd457d 12-Jul-2024 Ed Tanous <ed@tanous.net>

Remove trailing whitespace

clang-format won't remove trailing whitespace if that's the only change.
Fix them all.

Change-Id: Ic6e14af43cdd11905d3b58430d49b9ec1484f812
Signed-off-by: Ed Tanous <ed@t

Remove trailing whitespace

clang-format won't remove trailing whitespace if that's the only change.
Fix them all.

Change-Id: Ic6e14af43cdd11905d3b58430d49b9ec1484f812
Signed-off-by: Ed Tanous <ed@tanous.net>

show more ...


# f8fc7052 03-May-2024 John Chung <john.chung@arm.com>

Formatting .c/.h files and fix memory leakage issues

Signed-off-by: John Chung <john.chung@arm.com>
Change-Id: Id8328f412c2724992d80c0b3f895c8f85bc4ae68


# 94153499 05-Sep-2022 Lawrence Tang <lawrence.tang@arm.com>

cper-parse: Make CPER reads relative to original fd location.

Change-Id: Ideec019a959a293bd1e871e935edbbf28ebda045


# f1f3b839 24-Aug-2022 Lawrence Tang <lawrence.tang@arm.com>

Formatting fixes.

Change-Id: I8947f98088bc7996f33235ab2267e243e45bd8dd


# 580423fe 24-Aug-2022 Lawrence Tang <lawrence.tang@arm.com>

Shift section definitions into separate file, add testing.

Change-Id: Idb0b41d7fa2999485580fca770958a27c1086f65


# 5202bbb4 12-Aug-2022 Lawrence Tang <lawrence.tang@arm.com>

Source json.h non-locally.

Change-Id: Ia42c41fde74596b394a1f7ae0021f1a5510991a8


# 617949e4 08-Aug-2022 Lawrence Tang <lawrence.tang@arm.com>

Add CPER conversion for single section records.


# e407b4c8 21-Jul-2022 Lawrence Tang <lawrence.tang@arm.com>

Partial reformat to kernel code style.


# aacf0e26 20-Jul-2022 Lawrence Tang <lawrence.tang@arm.com>

Add fixes based on test fuzzing.


# de9707f9 19-Jul-2022 Lawrence Tang <lawrence.tang@arm.com>

Add generation for remaining, fix invalid fseek().


# 02c801a5 18-Jul-2022 Lawrence Tang <lawrence.tang@arm.com>

Add "cper-generate", update README, fix minor bugs.


# 0cb33793 13-Jul-2022 Lawrence Tang <lawrence.tang@arm.com>

Add section descriptor parsing, generic processor error.


# 3c878352 08-Jul-2022 Lawrence Tang <lawrence.tang@arm.com>

Add JSON specification of main structures.


# f0f95574 07-Jul-2022 Lawrence Tang <lawrence.tang@arm.com>

Add README, reverse function signature.


# 2721739a 07-Jul-2022 Lawrence Tang <lawrence.tang@arm.com>

Add extra definitions for existing sections.


# d7e8ca34 07-Jul-2022 Lawrence Tang <lawrence.tang@arm.com>

Add CXL component GUIDs, b64 dumps for unknown.


# e18aaee9 07-Jul-2022 Lawrence Tang <lawrence.tang@arm.com>

Add initial IPF support.


12