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


# 5fb575ae 20-Oct-2023 Patrick Williams <patrick@stwcx.xyz>

clang-format: copy latest and re-format

clang-format-17 has some backwards incompatible changes that require
additional settings for best compatibility and re-running the formatter.
Copy the latest

clang-format: copy latest and re-format

clang-format-17 has some backwards incompatible changes that require
additional settings for best compatibility and re-running the formatter.
Copy the latest .clang-format from the docs repository and reformat the
repository.

Change-Id: Ib459ac591ed3031de84d0239948d8daa583ef8a5
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 ...


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

PEL: Use lg2 in Repository class

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


# 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 ...


# ac1ba3f2 10-May-2023 Patrick Williams <patrick@stwcx.xyz>

clang-format: copy latest and re-format

clang-format-16 has some backwards incompatible changes that require
additional settings for best compatibility and re-running the formatter.
Copy the latest

clang-format: copy latest and re-format

clang-format-16 has some backwards incompatible changes that require
additional settings for best compatibility and re-running the formatter.
Copy the latest .clang-format from the docs repository and reformat the
repository.

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

show more ...


# 32a6df6c 12-Jan-2023 Matt Spinler <spinler@us.ibm.com>

PEL: Fix memory leak in GetPEL D-Bus method

The GetPEL D-Bus method returns a file descriptor to the PEL data. While
it was closing the file descriptor so those didn't leak, it wasn't
calling fclose

PEL: Fix memory leak in GetPEL D-Bus method

The GetPEL D-Bus method returns a file descriptor to the PEL data. While
it was closing the file descriptor so those didn't leak, it wasn't
calling fclose() after an fopen() which did leak about 300 bytes per
call, if I interpreted the valgrind output correctly.

Since all the code needs anyway is the file description, just use open()
instead of fopen().

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

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 ...


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

catch exceptions as const

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


# 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 ...


# 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 ...


# ff6b598b 22-Apr-2021 Patrick Williams <patrick@stwcx.xyz>

openpower-pels: repository: fix use-after-free

ERROR: AddressSanitizer: heap-use-after-free
READ of size 4 at 0x60b0000007f0 thread T0
#0 0x55b0e3e2740e in openpower::pels::Repository::r

openpower-pels: repository: fix use-after-free

ERROR: AddressSanitizer: heap-use-after-free
READ of size 4 at 0x60b0000007f0 thread T0
#0 0x55b0e3e2740e in openpower::pels::Repository::remove(
openpower::pels::Repository::LogID const&)
../extensions/openpower-pels/repository.cpp:228

This is caused by using an element out of a vector after it has
already been erased. Modify function to avoid stale use.

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

show more ...


# d26fa3e7 21-Apr-2021 Patrick Williams <patrick@stwcx.xyz>

openpower-pels: clean up various compile warnings

Compile warnings observed when compiling parts of the
openpower-pels (or corresponding tests) under stricter
compiler warning flags of Meson.

Issue

openpower-pels: clean up various compile warnings

Compile warnings observed when compiling parts of the
openpower-pels (or corresponding tests) under stricter
compiler warning flags of Meson.

Issues fixed:
- many unused parameters
- invalid case fall-through
- excess semi-colons
- incorrect 'const' on return-by-value type
- removal of variable length array in test case
- uncaught return from 'system' call in test case

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

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 ...


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

PEL: Remove a debug trace

Now that an inotify watch will tell the Repository to try to delete the
PEL from its index when a PEL file is deleted, it is expected that it
will already have been removed

PEL: Remove a debug trace

Now that an inotify watch will tell the Repository to try to delete the
PEL from its index when a PEL file is deleted, it is expected that it
will already have been removed from the index when it was deleted the
proper way, such as when the OpenBMC event log is deleted.

Therefore, remove a trace from the path where a PEL can't be found in
in the index on removal, as it is expected in the above scenario.

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

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 ...


12