History log of /openbmc/phosphor-logging/extensions/openpower-pels/user_data_json.cpp (Results 1 – 16 of 16)
Revision Date Author Comments
# 075c7923 16-Aug-2024 Patrick Williams <patrick@stwcx.xyz>

clang-format: re-format for clang-18

clang-format-18 isn't compatible with the clang-format-17 output, so we
need to reformat the code with the latest version. The way clang-18
handles lambda forma

clang-format: re-format for clang-18

clang-format-18 isn't compatible with the clang-format-17 output, so we
need to reformat the code with the latest version. The way clang-18
handles lambda formatting also changed, so we have made changes to the
organization default style format to better handle lambda formatting.

See I5e08687e696dd240402a2780158664b7113def0e for updated style.
See Iea0776aaa7edd483fa395e23de25ebf5a6288f71 for clang-18 enablement.

Change-Id: I21d2ca8065f24fd73509229c517f5caf48934b60
Signed-off-by: Patrick Williams <patrick@stwcx.xyz>

show more ...


# 7cc3aea3 07-Jul-2023 Matt Spinler <spinler@us.ibm.com>

PEL: Use lg2 in user_data_json.cpp

Signed-off-by: Matt Spinler <spinler@us.ibm.com>
Change-Id: I59944fbfd4ed8aba16c2c1a3742ff5e8d9d73066


# b832aa5e 21-Mar-2023 Matt Spinler <spinler@us.ibm.com>

PEL: Print component names in peltool

Every PEL section has a 2 byte component ID field in its header that
peltool prints. Currently, it just prints the hex version, like
"0x1000".

There are JSON

PEL: Print component names in peltool

Every PEL section has a 2 byte component ID field in its header that
peltool prints. Currently, it just prints the hex version, like
"0x1000".

There are JSON files in the flash already that contain mappings of
component IDs to to component names, and this commit starts looking
up the component names from those files and using those in the peltool
output.

An example of a file is:
/usr/share/phosphor-logging/pels/O_component_ids.json:
{
"1000": "bmc common function",
"2000": "bmc error logging",
...
}

Where the 'O' in the filename is the creator ID field of the PEL. There
is also a file for hostboot, which is B_component_ids.json.

Also, for PELs with a PHYP creator ID, just convert the ID to two
characters, like 0x4552 - > "ER" as that is what they are.

peltool output examples:
"Created by": "bmc error logging",
"Created by": "hostboot: errl",
"Created by": "IO",

This matches what is already done by the python peltool.

Signed-off-by: Matt Spinler <spinler@us.ibm.com>
Change-Id: Id616739e1b7ca67c85dc7efa85dc34acf6aca9b5

show more ...


# 2544b419 04-Oct-2022 Patrick Williams <patrick@stwcx.xyz>

clang-format: update with latest

Signed-off-by: Patrick Williams <patrick@stwcx.xyz>
Change-Id: I329396457b83bb2eb8740629b4ac1fbe9106bced


# be952d2e 01-Jul-2022 Matt Spinler <spinler@us.ibm.com>

PEL: Fix more cppcheck warnings

This is the second of two commits to fix most of the cppcheck warnings
in the PEL code. It doesn't fix all of them because some are false
positives and some are just

PEL: Fix more cppcheck warnings

This is the second of two commits to fix most of the cppcheck warnings
in the PEL code. It doesn't fix all of them because some are false
positives and some are just suggestions.

It's broken up into two commits to make them smaller.

Signed-off-by: Matt Spinler <spinler@us.ibm.com>
Change-Id: Id9f462386df85fd25d09529d6b410115ff4ccba8

show more ...


# 3279cc58 15-Feb-2022 Matt Spinler <spinler@us.ibm.com>

PEL: Change python plugin error traces to debug

There's been lots of complaints and questions about what these are, if
they're important, and why they show up so much so just make them debug
traces

PEL: Change python plugin error traces to debug

There's been lots of complaints and questions about what these are, if
they're important, and why they show up so much so just make them debug
traces. The plugin parser developers can still enable debug traces to
see the errors if they notice some unparsed sections.

Signed-off-by: Matt Spinler <spinler@us.ibm.com>
Change-Id: If68e0e080eff92225331e39c3c41faa007fe785e

show more ...


# 66491c61 06-Oct-2021 Patrick Williams <patrick@stwcx.xyz>

catch exceptions as const

Signed-off-by: Patrick Williams <patrick@stwcx.xyz>
Change-Id: Ic8e6ade739bd5ea6e79cac6b9bb2b182748e10c8


# d5c31366 29-May-2021 Harisuddin Mohamed Isa <harisuddin@gmail.com>

peltool: Fix Python C Extension for UD parsing

This fixes some issues with reference counting which could possibly
lead to memory leaks and unwanted behaviours.

Only accepts val

peltool: Fix Python C Extension for UD parsing

This fixes some issues with reference counting which could possibly
lead to memory leaks and unwanted behaviours.

Only accepts valid data from python module (non-empty object, array and
string) or else to return the default hex dump.

Signed-off-by: Harisuddin Mohamed Isa <harisuddin@gmail.com>
Change-Id: I13d06247533018709b93e5d7887453e652132956

show more ...


# bb1c1d5c 03-Jun-2021 Matt Spinler <spinler@us.ibm.com>

PEL: Use ordered_json parse on plugin data

When calling parse() to parse JSON data from a string, if the JSON is a
dictionary and the key order needs to be preserved, then the code needs

PEL: Use ordered_json parse on plugin data

When calling parse() to parse JSON data from a string, if the JSON is a
dictionary and the key order needs to be preserved, then the code needs
to call ordered_json::parse() instead of the standard json::parse().
This would get used when parsing the JSON string returned from PEL SRC
or UserData plugin modules.

I also changed it on the from_cbor() call since that was being saved in
an ordered_json object.

Signed-off-by: Matt Spinler <spinler@us.ibm.com>
Change-Id: I1ac27698320f839d12d2ac45de1e4fe303cefc0d

show more ...


# 516935a5 14-Apr-2021 Sumit Kumar <sumit_kumar@in.ibm.com>

PEL: Use ordered_json in code instead of fifo_map

JSON objects are defined as 'unordered collections' of zero or more
name/value pairs. The implementation doesn't need to preserve specif

PEL: Use ordered_json in code instead of fifo_map

JSON objects are defined as 'unordered collections' of zero or more
name/value pairs. The implementation doesn't need to preserve specific
orders of inputs objects and where it did (say in older versions)
external fifo_map header method was used. Now with built-in ordered_json
supported (nlohmann::ordered_json), the specific 'order of inputs
objects are preserved' automatically and are not jumbled up or external
header needed to preserve input objects anymore.

Signed-off-by: Sumit Kumar <sumit_kumar@in.ibm.com>
Change-Id: I9abc1220b9fbefbae412efc6ac128d797d0faa16

show more ...


# aadf28f5 29-Sep-2020 Harisuddin Mohamed Isa <harisuddin@gmail.com>

peltool: Change getTextJSON() to split by newlines

This changes getTextJSON to split the input data using newline as
separator instead of doing line breaks every 60 chars.

Input

peltool: Change getTextJSON() to split by newlines

This changes getTextJSON to split the input data using newline as
separator instead of doing line breaks every 60 chars.

Input = "This is a line\nThis is another line"

Output =

"Data": [
"This is a line",
"This is another line"
]

Signed-off-by: Harisuddin Mohamed Isa <harisuddin@gmail.com>
Change-Id: I3caedfbb075c10da96ee39e36367d2198b76b4b6

show more ...


# 3fdcd4e8 25-Aug-2020 Harisuddin Mohamed Isa <harisuddin@gmail.com>

PEL: Fixed Userdata section parsing

A previous commit incorrectly tries to call python parsers when they do
not exist. This fixes it.

Signed-off-by: Harisuddin Mohamed Isa <hari

PEL: Fixed Userdata section parsing

A previous commit incorrectly tries to call python parsers when they do
not exist. This fixes it.

Signed-off-by: Harisuddin Mohamed Isa <harisuddin@gmail.com>
Change-Id: I6e65bc89e60b9ac31077009921d4376ddc8254bf

show more ...


# f67bafd0 06-Jul-2020 Harisuddin Mohamed Isa <harisuddin@gmail.com>

PEL: Python3 module support for UserData parsing

This change enables the calling of python3 parsers for UserData section.
Modules will be searched under the namespace "udparsers" from py

PEL: Python3 module support for UserData parsing

This change enables the calling of python3 parsers for UserData section.
Modules will be searched under the namespace "udparsers" from python3
sys.path directories (including the current directory).

Example:

/usr/lib/python3.8/site-packages/udparsers/bxxxx/bxxxx.py

or

./udparsers/bxxxx/bxxxx.py

where

b = Creator Subsystem ID for Hostboot
xxxx = Component ID of UserData section

The parsers will need to provide a function called "parseUDToJson" with
input parameters:

1. (int) Sub-section type
2. (int) Section version
3. (memoryview): Data

The return value needs to be a valid JSON string.

Signed-off-by: Harisuddin Mohamed Isa <harisuddin@gmail.com>
Change-Id: I4d3523083bc48ad0c329c525d83c4a61d36ff611

show more ...


# 18207145 26-Mar-2020 Matt Spinler <spinler@us.ibm.com>

PEL: Support CBOR and Text UserData parsing

In the path where the UserData section contents are converted to JSON so
that peltool can print them, add the code to handle UserData sections

PEL: Support CBOR and Text UserData parsing

In the path where the UserData section contents are converted to JSON so
that peltool can print them, add the code to handle UserData sections
that contain CBOR or text.

Signed-off-by: Matt Spinler <spinler@us.ibm.com>
Change-Id: Iced228fdfc1b5e53e4fd864e13927d1c34da9706

show more ...


# bebeb948 12-Mar-2020 Harisuddin Mohamed Isa <harisuddin@gmail.com>

PEL: peltool: Add const strings for section header

Added "Section Version", "Sub-section type" and "Created by" constant strings.

Updated all getJSON() functions to use the new cons

PEL: peltool: Add const strings for section header

Added "Section Version", "Sub-section type" and "Created by" constant strings.

Updated all getJSON() functions to use the new constants.

Signed-off-by: Harisuddin Mohamed Isa <harisuddin@gmail.com>
Change-Id: I434192afed929972845c3cfb8876cc5ef784eec2

show more ...


# acb7c106 10-Jan-2020 Matt Spinler <spinler@us.ibm.com>

PEL: Print the JSON formatted UserData

Override the getJSON() function in the UserData section so it will
support peltool pretty printing when the data has been stored as JSON
(comp

PEL: Print the JSON formatted UserData

Override the getJSON() function in the UserData section so it will
support peltool pretty printing when the data has been stored as JSON
(component phosphor-logging, subtype 1 as defined in
user_data_formats.hpp).

It first converts the original JSON string to a nlohmann::json object to
validate it is valid JSON and then uses nlohmann::json's stream <<
operator to convert it into a pretty string.

This also sets up a framework where other UserData parsing functions can
be called from, and it is all only compiled into peltool, and not into
phosphor-log-manager.

The UserData section created out of the OpenBMC event log's
AdditionalData property already makes use of this format.

Here are some example outputs. Note that the 'Data' key is added by
this code for JSON that isn't already an object (dict) to make it one.

"User Data": {
"OPERATION": "something",
"REGISTER_FFDC": "REG1=0x8|REG2=0x9|REG3=0x55",
"RETURN_VALUE": "-12",
"TIMEOUT_IN_MSEC": "100",
"_PID": "993"
},

"User Data": {
"Data": [
"OPERATION",
"REGISTER_FFDC",
"RETURN_VALUE",
"TIMEOUT_IN_MSEC",
"_PID"
]
},

"User Data": {
"Data": "This is a string"
}

Signed-off-by: Matt Spinler <spinler@us.ibm.com>
Change-Id: I7b034ac24339b5b019db3b57d8e71cb03559363e

show more ...