path: root/extensions/openpower-pels/manager.cpp
diff options
authorMatt Spinler <>2019-12-18 13:48:08 -0600
committerMatt Spinler <>2020-02-14 19:15:42 +0000
commitf682b40dcde8badb7029a063e299e1bdf1501444 (patch)
tree00bec044d02c3d5190e84a1a976640dce294678d /extensions/openpower-pels/manager.cpp
parent7ae2fa69f2bd15cbd22be54aeefbb49d3ad06fc5 (diff)
PEL: Add ability to create event logs
There are cases where the PEL code wants to be able to create OpenBMC event logs (and thus PELs) for problems it encounters when trying to create or import other PELs. For example, if the host were to send down a malformed PEL, this code would like to create a new event log and capture part of that bad PEL in the new PEL for debug purposes, as the malformed PEL cannot be reported anywhere since it is malformed. To handle this, create the EventLogger class that provides a log() function that allows the PEL extension code to create OpenBMC event logs (and thus PELs) from within. The underlying function to do the event log creating is passed in via the constructor so that it can be changed for testing. The sd_event_add_defer function (wrapped by sdeventplus) is used to dispatch the creation of a single event, so that the entry point is from the event loop. If there are still events left on the queue after that, then they will be also be scheduled with sd_event_add_defer so that the events are always created from event loop calls. EventLogger does not allow events to be added to the queue if it is being done from within the creation function so that the code can't get stuck in a loop of creating a new event every time an event is created. Signed-off-by: Matt Spinler <> Change-Id: I6a9062074dc62cfb6043139ff0a9f3dfcd06c708
Diffstat (limited to 'extensions/openpower-pels/manager.cpp')
0 files changed, 0 insertions, 0 deletions
OpenPOWER on IntegriCloud