History log of /openbmc/phosphor-logging/elog_serialize.cpp (Results 1 – 22 of 22)
Revision Date Author Comments
# 109b4a5c 20-Mar-2025 Patrick Williams <patrick@stwcx.xyz>

entry: remove AdditionalData2

The 'AdditionalData2' property was a temporary addition to ease the
transition from an array to a dictionary for the additional data.
All users have been migrated to us

entry: remove AdditionalData2

The 'AdditionalData2' property was a temporary addition to ease the
transition from an array to a dictionary for the additional data.
All users have been migrated to use the dictionary style and from the
'AdditionalData' property, so the '2' property can be removed.

Tested: Loaded an existing log database and observed dbus objects
are created successfully and with the 'AdditionalData2' field missing.
Created a new event with `log-create` CLI and observed new entry is
created successfully in dbus.

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

show more ...


# 991e2b0d 19-Mar-2025 Matt Spinler <spinler@us.ibm.com>

Catch all exceptions when de-serializing

If an exception were to escape during an event log restore,
phosphor-log-manager would just keep continuously crashing and
restarting.

To prevent this, just

Catch all exceptions when de-serializing

If an exception were to escape during an event log restore,
phosphor-log-manager would just keep continuously crashing and
restarting.

To prevent this, just catch all exceptions and move the file that caused
it to /var/lib/phosphor-logging/corrupt_error so that it is kept around
for debug if desired. Only the most recent bad file is kept.

Tested:

Instead of crashing, the daemon can now stay up:

```
Mar 19 14:10:06 p10bmc phosphor-log-manager[2953]: Failed restoring /var/lib/phosphor-logging/errors/381: std::bad_alloc

/var/lib/phosphor-logging# ls -l /var/lib/phosphor-logging/corrupt_error
-rw-r--r-- 1 root root 374 Mar 19 13:39 /var/lib/phosphor-logging/corrupt_error
```

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

show more ...


# ea6d9c45 11-Dec-2024 Patrick Williams <patrick@stwcx.xyz>

entry: switch AdditionalData to dict

Clients have been switched to use AddtionalData2, which is a
dictionary. Move AdditionalData also to a dictionary so we
can stage a removal of AdditionalData2.

entry: switch AdditionalData to dict

Clients have been switched to use AddtionalData2, which is a
dictionary. Move AdditionalData also to a dictionary so we
can stage a removal of AdditionalData2.

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

show more ...


# 5402fa68 22-Nov-2024 Patrick Williams <patrick@stwcx.xyz>

entry: use AdditionalData2 for serialization

Prefer the `map<std::string, std::string>` for serialization of
metadata over the `vector<std::string>` format. Add backwards
compatible parsing of the

entry: use AdditionalData2 for serialization

Prefer the `map<std::string, std::string>` for serialization of
metadata over the `vector<std::string>` format. Add backwards
compatible parsing of the `vector<std::string>` format.

Tested: Loaded a "version 5" entry. Created a new entry and verified
it was "version 6" in the binary dump. Reloading the daemon restores
both version 5 and 6 objects.

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

show more ...


# e7e741ea 21-Nov-2024 Patrick Williams <patrick@stwcx.xyz>

entry: add AdditionalData2

Support metadata as dict property "AdditionalData2".

Tested: Created a new event and ensured property is created. Reloaded
the daemon with an old event and ensured prope

entry: add AdditionalData2

Support metadata as dict property "AdditionalData2".

Tested: Created a new event and ensured property is created. Reloaded
the daemon with an old event and ensured property exists and is
populated.

```
.AdditionalData2 property a{ss} 8 "READING_VALUE" "98.6" "SENSOR_NAME" "Inlet Temperature" "THRESHOLD_VALUE" "40.0" "UNITS" "xyz.openbmc_project.Sensor.Value.Unit.DegreesC" "_CODE_FILE" "../log_create_main.cpp" "_CODE_FUNC" "int generate_event(const std::string&, const nlohmann::json_abi_v3_11_2::json&)" "_CODE_LINE" "34" "_PID" "2239596" emits-change writable
```

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

show more ...


# 5bc26533 10-Apr-2024 Arya K Padman <aryakpadman@gmail.com>

PEL: Changing the remaining traces to lg2 style

Some of the logging traces of PEL files still uses old style of logging.

Changing the remaining traces in PEL files to lg2 style of logging.Some
of t

PEL: Changing the remaining traces to lg2 style

Some of the logging traces of PEL files still uses old style of logging.

Changing the remaining traces in PEL files to lg2 style of logging.Some
of the traces in phosphor logging code which use the old style is also
considered.

Change-Id: I0daf9589af443881cb61730047c23db17fdec2c3
Signed-off-by: Arya K Padman <aryakpadman@gmail.com>

show more ...


# 6ddbf69e 05-Sep-2023 Willy Tu <wltu@google.com>

Remove SDBUSPP_REMOVE_DEPRECATED_NAMESPACE

Fix the code to support new sdbusplus error without
SDBUSPP_REMOVE_DEPRECATED_NAMESPACE.

Change-Id: I12713ec1757d3835e1acf07c7abf409ff97615e1
Signed-off-b

Remove SDBUSPP_REMOVE_DEPRECATED_NAMESPACE

Fix the code to support new sdbusplus error without
SDBUSPP_REMOVE_DEPRECATED_NAMESPACE.

Change-Id: I12713ec1757d3835e1acf07c7abf409ff97615e1
Signed-off-by: Willy Tu <wltu@google.com>

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


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

Fix some cppcheck warnings

Fix some of the warnings in the base phosphor-logging code.

It doesn't fix all of them - some are false positives and some are just
suggestions, but it does bring down th

Fix some cppcheck warnings

Fix some of the warnings in the base phosphor-logging code.

It doesn't fix all of them - some are false positives and some are just
suggestions, but it does bring down the number a bit to make it easier
to spot real issues.

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

show more ...


# fb978da4 21-Jan-2022 Matt Spinler <spinler@us.ibm.com>

Pull file path into elog Entry constructor

The path property on the FilePath interfaces was previously being set
after the entry object was created, sending a properties changed signal
after the int

Pull file path into elog Entry constructor

The path property on the FilePath interfaces was previously being set
after the entry object was created, sending a properties changed signal
after the interfaces added signal.

Since the path can be known at the time the entry is constructed, pass
it into the constructor instead so no extra signal will be sent.

Change-Id: I1150236d23cecb1df78e3fb4ae641c75b488af37

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


# ef952af2 19-Aug-2021 Matt Spinler <spinler@us.ibm.com>

Stop emitting Entry propChanged before ifacesAdded

Even though the deferSignal parameter was set to true in the event log
entry D-Bus interface constructor, propertiesChanged signals would still
be

Stop emitting Entry propChanged before ifacesAdded

Even though the deferSignal parameter was set to true in the event log
entry D-Bus interface constructor, propertiesChanged signals would still
be emitted when setting the properties to their initial values. These
were being emitted even before the interfacesAdded signal that is sent
when emit_object_added() is called.

As the code was calling emit_object_added() as soon as it initialized
the properties, it can be deduced that the intended plan was that no
propertiesChanged signals were expected to be sent in the first place.

Fix this by using the sdbusplus functions that take a boolean to skip
sending signals when properties are set to their initial values.

Tested: With this change, propertiesChanged signals are not emitted
before the interfacesAdded signal for the
xyz.openbmc_project.Logging.Entry interface when either creating or
restoring event logs.

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

show more ...


# 593a4c66 16-Jun-2021 Vijay Lobo <vijaylobo@gmail.com>

PEL: Support resolution property

Support resolution property to add callouts

Tested: Created new PEL using busctl and checked for the property to
see if the value is updated. The error log daemon w

PEL: Support resolution property

Support resolution property to add callouts

Tested: Created new PEL using busctl and checked for the property to
see if the value is updated. The error log daemon was restarted and the
property is checked again to make sure the value is restored.

Verified serialization of new error log by recreating it on a old code
version to make sure logs are created w/o the new property and the
daemon did not crash.

Result:
root@rainier:~# busctl get-property xyz.openbmc_project.Logging \
/xyz/openbmc_project/logging/entry/1 xyz.openbmc_project.Logging.\
Entry Resolution
s "1. Priority: High, Procedure: BMCSP02\n2. Priority: Medium, PN: \
SVCDOCS\n"

Test with location Code:
root@p10bmc:~# busctl get-property xyz.openbmc_project.Logging \
/xyz/openbmc_project/logging/entry/3 xyz.openbmc_project.Logging.Entry \
Resolution
s "1. Location Code: U78DA.ND0.1234567-P0, Priority: Medium, PN: SVCDOCS\n2. \
Priority: Low, Procedure: BMCSP02\n"

Signed-off-by: Vijay Lobo <vijaylobo@gmail.com>
Change-Id: I44eebbf794efeb8e752fff98de7c638c927982cd

show more ...


# d354a398 01-Jun-2021 Vijay Lobo <vijaylobo@gmail.com>

PEL: Support eventId property

Support eventId property to add SRC and the hex words to the property

Tested by creating the PEL log and to make sure that the eventId
property was updated properly wi

PEL: Support eventId property

Support eventId property to add SRC and the hex words to the property

Tested by creating the PEL log and to make sure that the eventId
property was updated properly with 9 words and then its present in the
right format when the logging daemon is restarted

Test result:
root@rainier# busctl get-property xyz.openbmc_project.Logging
/xyz/openbmc_project/logging/entry/1 xyz.openbmc_project.Logging.Entry EventId
s "BD8D1001 00000055 2E2D0010 00000000 00000000 00000000 00000000
00000000 00000000"

Also tested with old version of error log and new version with the
eventId property to make sure we don't have issues in serialization

Change-Id: I8e39804cd3d47f0e321c1cf533b97bf165c07518
Signed-off-by: Vijay Lobo <vijaylobo@gmail.com>

show more ...


# f40323d0 16-Apr-2021 Patrick Williams <patrick@stwcx.xyz>

fix various warnings

Fix various warnings emitted by -Werror:

- Unused parameters.
- Excess semi-colons.
- Missing initializer.

Signed-off-by: Patrick Williams <patrick@stwcx.xyz>
Chan

fix various warnings

Fix various warnings emitted by -Werror:

- Unused parameters.
- Excess semi-colons.
- Missing initializer.

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

show more ...


# 1e71a4dc 04-Mar-2020 Matt Spinler <spinler@us.ibm.com>

Support UpdateTimestamp log entry property

The UpdateTimestamp property says when an event log property was last
updated. On log creation, this field is initialized with the time that
the log was c

Support UpdateTimestamp log entry property

The UpdateTimestamp property says when an event log property was last
updated. On log creation, this field is initialized with the time that
the log was created.

The only other time a log entry property can change is when the Resolved
property changes, so also added support there to update the new
UpdateTimestamp property.

While technically every property of the Entry interface is writeable,
there is no use case nor code for changing those in the field, so
UpdateTimestamp does not support those.

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

show more ...


# f18bf836 26-Oct-2018 Patrick Venture <venture@google.com>

add .clang-format

Change-Id: I2c36b7886a25d0b235693b0776019d29608e1d52
Signed-off-by: Patrick Venture <venture@google.com>


# 375ac9b9 01-May-2018 Matt Spinler <spinler@us.ibm.com>

Add the BMC code version to error logs

Add the xyz.openbmc_project.Software.Version interface to
the elog entries. This allows a user to know what BMC code
level was running when the error was crea

Add the BMC code version to error logs

Add the xyz.openbmc_project.Software.Version interface to
the elog entries. This allows a user to know what BMC code
level was running when the error was created. The level is
persisted along with the other elog fields.

If this code is flashed on a system that was running older code,
and there were existing error logs, the version property will
be left empty in the restored log entries.

Older code is still able to restore logs created by this code
as the version property is at the end of the serialized data
and so is just ignored by Cereal.

Resolves openbmc/openbmc#3133

Tested: Check that new error logs have the code level, and that
restarting phosphor-log-manager preserves that property
on the existing logs. Various incantations of running
the older code with logs created by this code, and running
this code with logs created by older code.

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

show more ...


# 37af9bac 28-Sep-2017 Vishwanatha Subbanna <vishwa@linux.vnet.ibm.com>

Enable Cereal class versioning

Cereal class versioning helps to handle data de-serialization
across different class versions that differ in the way, a
particular data is serialized.

Change-Id: Ica0

Enable Cereal class versioning

Cereal class versioning helps to handle data de-serialization
across different class versions that differ in the way, a
particular data is serialized.

Change-Id: Ica01c4cb0c213e0dca8824fcfcfaa5cb43c5bc2e
Signed-off-by: Vishwanatha Subbanna <vishwa@linux.vnet.ibm.com>

show more ...


# 9c7f03a7 20-Sep-2017 Jayanth Othayoth <ojayanth@in.ibm.com>

phosphor-log-manager: Fix for deserialize cereal exception

This commit provides a fix for an issue in which the cereal
deserialize() would crash the phosphor-log-manager incase
persistence file is e

phosphor-log-manager: Fix for deserialize cereal exception

This commit provides a fix for an issue in which the cereal
deserialize() would crash the phosphor-log-manager incase
persistence file is empty in restore path.

Resolves openbmc/openbmc#2337

Change-Id: Id9d8c066d0dc50cba62a67060c1ee8d43d046ff1
Signed-off-by: Jayanth Othayoth <ojayanth@in.ibm.com>

show more ...


# f1630eaa 25-Jun-2017 Deepak Kodihalli <dkodihal@in.ibm.com>

Move serialization template functions

Move serialization template functions from elog_serialize.hpp to
elog.serialize.cpp, since they are called only within the cpp.

Change-Id: I8df216e1d4a745d1386

Move serialization template functions

Move serialization template functions from elog_serialize.hpp to
elog.serialize.cpp, since they are called only within the cpp.

Change-Id: I8df216e1d4a745d1386fc310fc5d4d9535a8b7c3
Signed-off-by: Deepak Kodihalli <dkodihal@in.ibm.com>

show more ...


# 72654f10 12-Jun-2017 Deepak Kodihalli <dkodihal@in.ibm.com>

Persist error d-bus objects

Use Cereal to implement serialization and de-serialization of
properties of error d-bus objects.

Serialize and persist error d-bus objects as they are put on the bus.
De

Persist error d-bus objects

Use Cereal to implement serialization and de-serialization of
properties of error d-bus objects.

Serialize and persist error d-bus objects as they are put on the bus.
De-serialize and restore them (if persistent ones exist) when
phosphor-log-manager starts up.

Change-Id: I1f5df1abbe74bfdb86e3e82a78ff7115e90e2112
Signed-off-by: Deepak Kodihalli <dkodihal@in.ibm.com>

show more ...