History log of /openbmc/phosphor-logging/extensions/openpower-pels/repository.hpp (Results 1 – 25 of 31)
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 ...


# 1cb59f70 20-Jul-2023 Matt Spinler <spinler@us.ibm.com>

PEL: Update Deconfig D-Bus property after clear

When a fan or power supply is replaced, the deconfig flag field in the
PEL is cleared. There is also a Deconfig property on D-Bus that should
match t

PEL: Update Deconfig D-Bus property after clear

When a fan or power supply is replaced, the deconfig flag field in the
PEL is cleared. There is also a Deconfig property on D-Bus that should
match the PEL field, but the code to clear that was missed, so add it.

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

show more ...


# 0dd22c83 04-May-2023 Matt Spinler <spinler@us.ibm.com>

PEL: Clear deconfig flag after callout replaced

Making use of the previous commit's framework to call a function when a
fan or power supply becomes present, add code to the Manager class to
register

PEL: Clear deconfig flag after callout replaced

Making use of the previous commit's framework to call a function when a
fan or power supply becomes present, add code to the Manager class to
register a callback that will clear the deconfig flag for all PELs
created with the power-thermal or fan component ID that have the
location code of the replaced fan/PS as a callout.

This way, the degraded mode reporting code will no longer pick up those
PELs in its report as since the hardware was replaced those PELs are no
longer relevant.

This is necessary only for fans or power supplies because they're the
only N+1 hardware that can be hot plugged at runtime. And also because
this is what the IBM service team wants.

Tested:
Simulated missing hardware (changed present D-Bus property for fans,
toggled PSU presence GPIO in the simulator for PSs). Saw errors get
created for it, then simulated replacing it and saw those errors have
their deconfig flag cleared, verifying before and after with peltool:

```
// Remove and replace fan
phosphor-fan-monitor: Fan /system/chassis/motherboard/fan0 presence state change to false
phosphor-log-manager: Created PEL 0x50000002 (BMC ID 2) with SRC 110076F1
phosphor-fan-monitor: Fan /system/chassis/motherboard/fan0 presence state change to true
phosphor-log-manager: Detected FRU /xyz/openbmc_project/inventory/system/chassis/motherboard/fan0 (U78DB.ND0.1234567-A0) present
phosphor-log-manager: Clearing deconfig flag in PEL 0x50000002 with SRC 110076F1 because U78DB.ND0.1234567-A0 was replaced

// Remove and replace PS
phosphor-log-manager: Created PEL 0x50000003 (BMC ID 3) with SRC 110015F6
...
phosphor-psu-monitor: Updating inventory present property. present:true invpath:/system/chassis/motherboard/powersupply0 name:powersupply0
phosphor-log-manager: Detected FRU /xyz/openbmc_project/inventory/system/chassis/motherboard/powersupply0 (U78DB.ND0.1234567-E0) present
phosphor-log-manager: Clearing deconfig flag in PEL 0x50000003 with SRC 110015F6 because U78DB.ND0.1234567-E0 was replaced
```

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

show more ...


# d0ccda3c 04-May-2023 Matt Spinler <spinler@us.ibm.com>

PEL: Modify Repo::updatePEL behavior

The Repository class's updatePEL function takes a PEL and then
calls a passed in function to update it.

Change the behavior slightly so the callback returns a b

PEL: Modify Repo::updatePEL behavior

The Repository class's updatePEL function takes a PEL and then
calls a passed in function to update it.

Change the behavior slightly so the callback returns a bool - true if
the PEL was actually updated, and false else. That way the code knows
if the PEL needs to be written back out or not.

There is also a minor change to refresh the PEL attributes map for the
PEL inside the updatePEL function so it doesn't need to be done outside
of it.

This is all to support upcoming functionality where an updatePEL call
won't know if the PEL needs to be updated until the PEL fields can be
checked.

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

show more ...


# 8e65f4ea 02-May-2023 Matt Spinler <spinler@us.ibm.com>

PEL: New D-Bus properties on PEL entry iface

Fill in the 4 newly added properties on the PEL entry D-Bus interface:
- Platform log ID (PLID)
- Deconfig flag from the SRC section
- Guard flag from th

PEL: New D-Bus properties on PEL entry iface

Fill in the 4 newly added properties on the PEL entry D-Bus interface:
- Platform log ID (PLID)
- Deconfig flag from the SRC section
- Guard flag from the SRC section
- Creation timestamp

These were also added to the PELAttributes map in the Repository class
so that each PEL wouldn't have to be reconstructed from a file again
when creating the D-Bus objects.

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

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


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

PEL: Fix some cppcheck warnings

This is the first 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 some cppcheck warnings

This is the first 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: I75937797a6920611b136d600e9efd6c694e4209c

show more ...


# 027bf285 24-Jan-2022 Sumit Kumar <sumit_kumar@in.ibm.com>

PEL: Skip purging PEL if it has associated hw isolation entry

When PELs reaches to certain limits, either in total size or
total number of them, the code starts removing older pels
based on certain

PEL: Skip purging PEL if it has associated hw isolation entry

When PELs reaches to certain limits, either in total size or
total number of them, the code starts removing older pels
based on certain criteria. During this process make sure
no pel is removed that has an associated hardware isolation
entry record or error_log event record.

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

show more ...


# afb1b46f 21-Jul-2021 Vijay Lobo <vijaylobo@gmail.com>

PEL: Add hidden and subsystem properties

This story adds a new PELEntry interface
org.open_power.Logging.PEL.Entry on existing PEL entry. Then we add 2
properties with their values initialized durin

PEL: Add hidden and subsystem properties

This story adds a new PELEntry interface
org.open_power.Logging.PEL.Entry on existing PEL entry. Then we add 2
properties with their values initialized during the creation of the Interface.

Tested:
1. Verified that the new PEL creation with recoverable error sets the new
attribute in the PEL.entry Interface.
2. Restarted the phosphor-log-manager daemon and made sure the flag is set
with the new Interface created for d-bus
3. Tested with passing a RAWPEL to create from file system and verified
that the hidden attribute is set accordingly on the PEL.entry Interface.
4. Copied the new format error to a system with old code and restored
the error log to make sure it does not crash.
5. Validated both hidden and subsystem properties.

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

show more ...


# 2ccdcef9 31-Jul-2021 Sumit Kumar <sumit_kumar@in.ibm.com>

PEL: Guard against hostboot sending down duplicate PEL Ids

This commit is to guard against hostboot sending down PEL Id
that we already have in our repository. This caused PEL to
get orphaned in the

PEL: Guard against hostboot sending down duplicate PEL Ids

This commit is to guard against hostboot sending down PEL Id
that we already have in our repository. This caused PEL to
get orphaned in the filesystem without a corresponding valid
openbmc event log Id.
The action is to move such PELs to archive folder.

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

show more ...


# c296692b 21-Jul-2021 Sumit Kumar <sumit_kumar@in.ibm.com>

PEL: Fix to remove files from archive folder

Archive folder contains the PEL logs (corresponding to deleted event
logs) that are deleted first, if the repo logs size exceeds the warning
size. Variab

PEL: Fix to remove files from archive folder

Archive folder contains the PEL logs (corresponding to deleted event
logs) that are deleted first, if the repo logs size exceeds the warning
size. Variable _archiveSize is used to keep track of size of archive
folder. After all logs in archive folder are deleted the _ardchiveSize
wasn't reset to zero as a result it would keep entering this function
trying to delete the logs again under archive folder.
The fix here is to reset the _archiveSize and also use robust remove
API for deletion instead of system command.

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

show more ...


# 99f3717c 24-Jun-2021 Ramesh Iyyar <rameshi1@in.ibm.com>

PEL: Repository: Added getLogID() as public method

Currently, don't have any public method to get LogID from
the Repository class so added an api "getLogID()" which can be
used to get the LogID by u

PEL: Repository: Added getLogID() as public method

Currently, don't have any public method to get LogID from
the Repository class so added an api "getLogID()" which can be
used to get the LogID by using either OpenBMC event log id or
PEL id (aka Entry ID (EID)).

Tested:
- Tested by below unit test cases.
- GetLogIDFoundTC
- With valid PEL ID
- With valid OpenBMC Event Log ID
- GetLogIDNotFoundTC
- With invalid PEL ID
- With invalid OpenBMC Event Log ID

Signed-off-by: Ramesh Iyyar <rameshi1@in.ibm.com>
Change-Id: Ia621c46f67198fccd88ec5b00c32d4f65be05743

show more ...


# 1d8835bb 07-Jun-2021 Sumit Kumar <sumit_kumar@in.ibm.com>

PEL: Deleted PELs moved to new folder under logs

- PELs whose corresponding event logs have been deleted
will be available in the archive folder.
- Archive folder size is tracked under sizeWarn

PEL: Deleted PELs moved to new folder under logs

- PELs whose corresponding event logs have been deleted
will be available in the archive folder.
- Archive folder size is tracked under sizeWarning() function.
- Archived PELs log can be viewed using peltool with flag --archive.
- PELs deleted using peltool is not archived.
- Updated README.md

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

show more ...


# 44893cc9 26-Aug-2020 Matt Spinler <spinler@us.ibm.com>

PEL: Implement CreatePELWithFFDCFiles

This D-Bus method on the org.open_power.Logging.PEL interface is the
same as the already existing createWithFFDCFiles method on the
xyz.openbmc_project.Logging.

PEL: Implement CreatePELWithFFDCFiles

This D-Bus method on the org.open_power.Logging.PEL interface is the
same as the already existing createWithFFDCFiles method on the
xyz.openbmc_project.Logging.Create interface, except it also returns the
IDs of the newly created OpenBMC event log and PEL.

Code was added to track the IDs of the most recently added event log and
PEL so they they can be returned by the function.

Change-Id: I3a1e0d93f97aa1953ff8b10293b47e28f79edfb1

show more ...


# ff9cec25 15-Jul-2020 Matt Spinler <spinler@us.ibm.com>

PEL: Watch for manually deleted PEL files

Currently, if someone were to manually delete a PEL file, the Repository
class would not know to remove it from its _pelAttributes index which
will lead to

PEL: Watch for manually deleted PEL files

Currently, if someone were to manually delete a PEL file, the Repository
class would not know to remove it from its _pelAttributes index which
will lead to problems down the line.

To fix this, create an inotify watch that looks for files to be deleted
in the PEL directory. When one or more is deleted, remove it from the
Repository class and also remove the OpenBMC event log for it.

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

show more ...


# 52602e35 15-Jul-2020 Matt Spinler <spinler@us.ibm.com>

PEL: On remove() call, return the removed LogID

Have Repository::remove(const LogID& id), which is used to remove
a PEL, return the full LogID of the removed PEL instead of not
returning anything.

PEL: On remove() call, return the removed LogID

Have Repository::remove(const LogID& id), which is used to remove
a PEL, return the full LogID of the removed PEL instead of not
returning anything.

That input id only has to have a filled in PEL ID or OpenBMC event log
ID field, but not both, so returning the full LogID of the removed PEL
ensure the calling code will have both values.

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

show more ...


# 7e727a39 07-Jul-2020 Matt Spinler <spinler@us.ibm.com>

PEL: Check if PEL pruning necessary on a new PEL

When a new PEL is added check if the size of all PELs is now more than
95% of the maximum capacity. If it is, call the repository's prune()
function

PEL: Check if PEL pruning necessary on a new PEL

When a new PEL is added check if the size of all PELs is now more than
95% of the maximum capacity. If it is, call the repository's prune()
function from the event loop to make more space. Also delete the
OpenBMC event logs corresponding to the PELs that were just deleted.

It's called from the event loop so that the current D-Bus method
response that the code is in now can return to the caller first.

It tops out at 95% to ensure that we never go over. It's possible this
can be tuned in the future, but at the current 20MB limit that still
allows 19MB before pruning will take it down to at most 18MB.

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

show more ...


# b0a8df5b 07-Jul-2020 Matt Spinler <spinler@us.ibm.com>

PEL: Implement respository pruning

This adds a prune() public method on the Repository class to remove PELs
down to at most 90% of capacity and then down to 80% of the maximum
number of PELs if ther

PEL: Implement respository pruning

This adds a prune() public method on the Repository class to remove PELs
down to at most 90% of capacity and then down to 80% of the maximum
number of PELs if there were more than the maximum.

It does the first set of pruning by placing each PEL is one of 4
categories, and then reducing the total size of each category. The
categories are:
* BMC informational PELs - reduced to 15% of max
* BMC non-informational PELs - reduced to 30% of max
* non-BMC informational PELs - reduced to 15% of max
* non-BMC non-informational PELs - reduced to 30% of max

Within each category, PELs are removed oldest first, and also 4 passes
are made through the PELs, only removing PELs that meet a specific
requirement each pass, stopping as soon as the category limit is
reached.

The pass requirements are:
* Pass 1: Only remove HMC acked PELs
* Pass 2: Only remove OS acked PELs
* Pass 3: Only remove host sent PELs
* Pass 4: Remove any PEL

After the 4 passes on the 4 categories are done then the number of PELs
remaining is checked against the maximum number. If it is more than the
maximum, it will remove the PELs down to 80% of that limit using the
same 4 passes as above. This is done to keep the number of PELs down to
a manageable number when there are a lot of small PELs that don't engage
the size based pruning.

The pruning code doesn't just bring the size or number of PELs to just
below their limit, but rather a percentage below, so that it won't get
into a situation where the algorithm has to run on the repository every
single time a PEL is added.

The OpenBMC event log corresponding to the PELs are not removed. That
is left to other code.

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

show more ...


# b188f78a 07-Jul-2020 Matt Spinler <spinler@us.ibm.com>

PEL: Keep size statistics of PEL repo

Keep a running total of several size statistics of the PEL repository.

The statistics are:
* Total size of all PELs
* Total size of BMC created PELs
* Total si

PEL: Keep size statistics of PEL repo

Keep a running total of several size statistics of the PEL repository.

The statistics are:
* Total size of all PELs
* Total size of BMC created PELs
* Total size of BMC created informational PELs
* Total size of BMC created non-informational PELs
* Total size of non-BMC created PELs
* Total size of non-BMC created informational PELs
* Total size of non-BMC created non-informational PELs

Here, size refers to the disk size the PEL uses, which is different than
the file size. The disk size is retrieved from the stat() function and
is the number of 512B blocks used.

The term 'informational' above doesn't strictly refer to the
informational severity value (0x0), but also includes other cases, such
as hidden recovered PELs.

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

show more ...


# dd325c32 07-Jul-2020 Matt Spinler <spinler@us.ibm.com>

PEL: Add size, creator, sev to repo attributes

Have the Repository class track the disk usage, creator ID and severity
of each PEL along with the attributes already tracked so that they can
be used

PEL: Add size, creator, sev to repo attributes

Have the Repository class track the disk usage, creator ID and severity
of each PEL along with the attributes already tracked so that they can
be used in the future for categorizing PELs to prune.

Note the size field is the amount of space the PEL file uses on disk, as
determined by the stat() function call, and not just the regular file
size, as the pruning algorithm is based on disk usage.

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

show more ...


# 8d5f3a2b 07-Jul-2020 Matt Spinler <spinler@us.ibm.com>

PEL: Add PEL repository capping related fields

If not capped, the PEL repository would keep taking up more and more
space as more PELs are added. In preparation for handling this, add
a field to th

PEL: Add PEL repository capping related fields

If not capped, the PEL repository would keep taking up more and more
space as more PELs are added. In preparation for handling this, add
a field to the Repository class to track the total size that all PELs can
take up and a field to track the maximum number of PELs that can be
stored.

The size value is hardcoded to be 20MB (and 100KB in unit test), though
a Repository class constructor allows the number to use to be passed in.
The max number of PELs field is hardcoded to 3000 (100 in test) and this
can also be changed in the constructor.

In the future if different systems or configurations require different
values, then this could be set at configure time. This isn't done now
because I want to only add PEL options to the common phosphor-logging
configure.ac if absolutely necessary as the majority of phosphor-logging
users don't use PELs.

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

show more ...


# 6d51224b 09-Dec-2019 Matt Spinler <spinler@us.ibm.com>

PEL: Add repo function to get a PEL FD

Add Repository::getPELFD() to return a file descriptor to a PEL data
file based on its ID.

This will be used by a future D-Bus method to return the descriptor

PEL: Add repo function to get a PEL FD

Add Repository::getPELFD() to return a file descriptor to a PEL data
file based on its ID.

This will be used by a future D-Bus method to return the descriptor to
the PLDM daemon.

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

show more ...


# 29d18c11 21-Nov-2019 Matt Spinler <spinler@us.ibm.com>

PEL: Add Repo API to update transmission states

Provided APIs for the Repository class to update the host and HMC
transmission states on a PEL it contains. It saves the updated PEL data
in the file

PEL: Add Repo API to update transmission states

Provided APIs for the Repository class to update the host and HMC
transmission states on a PEL it contains. It saves the updated PEL data
in the filesystem.

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

show more ...


# 346f99a1 21-Nov-2019 Matt Spinler <spinler@us.ibm.com>

PEL: Save tran states in the repo attributes

Save the host and HMC (Hardware Management Console) transmission
states in the PEL attributes map so that external callers can
get to them without having

PEL: Save tran states in the repo attributes

Save the host and HMC (Hardware Management Console) transmission
states in the PEL attributes map so that external callers can
get to them without having to unflatten a PEL from the filesystem.

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

show more ...


# ab1b97fe 07-Nov-2019 Matt Spinler <spinler@us.ibm.com>

PEL: Repository: Add write() function

Pull the code that writes a PEL object to a file into a separate
function so that it can be called in multiple places.

Signed-off-by: Matt Spinler <spinler@us.

PEL: Repository: Add write() function

Pull the code that writes a PEL object to a file into a separate
function so that it can be called in multiple places.

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

show more ...


12