summaryrefslogtreecommitdiffstats
path: root/extensions/openpower-pels/entry_points.cpp
Commit message (Collapse)AuthorAgeFilesLines
* PEL: Add ability to create event logsMatt Spinler2020-02-141-3/+10
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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 <spinler@us.ibm.com> Change-Id: I6a9062074dc62cfb6043139ff0a9f3dfcd06c708
* PEL: Create the PLDMInterface classMatt Spinler2020-01-271-0/+9
| | | | | | | | | | | | | | Create the PLDMInterface class and pass it into the constructor of the Manager class. This is done at this level so that it can be easily mocked for testing. Add a --enable-dont-send-pels-to-host configure option for systems that don't need PELs sent to the host. If this is set, then don't create and pass in the PLDMInterface class, and then the Manager class won't create a HostNotifier class to do the sending. Signed-off-by: Matt Spinler <spinler@us.ibm.com> Change-Id: I34059470ee117e65c5c02b684a9d916571135bfd
* PEL: Put back in the default error log capsMatt Spinler2019-12-101-2/+0
| | | | | | | | | | Since there is no code in place yet to purge old logs after some amount of total space is consumed, it will be safest to put back in the default cap of 200. If more than 200 is needed in the short term, we can use the currently available configure option to increase the cap. Signed-off-by: Matt Spinler <spinler@us.ibm.com> Change-Id: Ide1af5432271817f30bfaf0b065c35906aaa05cf
* PEL: Add license prologue to source filesMatt Spinler2019-11-061-0/+15
| | | | | Signed-off-by: Matt Spinler <spinler@us.ibm.com> Change-Id: I31b12f509d32b79064a8a427af35e6a310273051
* PEL: Interface to collect system dataMatt Spinler2019-09-271-1/+5
| | | | | | | | | | | | | | | | | There are PEL fields that contain information that must be obtained from various places throughout the BMC, such as the machine type/model/SN from VPD, a few types of codes levels, etc. Create a DataInterface class that will provide the APIs for collecting this information. It has an abstract base class so that its functions can be mocked to return specific data in test cases. This commit provides APIs to read and present the machine type-model and machine serial number. These will be used in the FailingMTM and ExtendedUserHeader PEL sections. Signed-off-by: Matt Spinler <spinler@us.ibm.com> Change-Id: Iec41fea8d9510ba711475154f019bd59f0028d2e
* PEL: Add PEL Manager classMatt Spinler2019-07-261-2/+7
| | | | | | | | | | | This class will have the logic for how to handle PELs. It will also eventually provide D-Bus interfaces. This first commit has stubs, plus some basic code to find if a PEL is being passed in with the OpenBMC event log. Signed-off-by: Matt Spinler <spinler@us.ibm.com> Change-Id: I55a5da4d2239c688fded31c112895c3c92bab56d
* OpenPower PEL Extension support frameworkMatt Spinler2019-07-161-0/+42
The goal of extensions is to extend phosphor-logging's `xyz.openbmc_project.Logging.Entry` log support to allow other log formats to be created without incurring extra D-Bus call overhead. The README.md change in this commit provides additional documentation on how extensions work. The summary is that they allow code that resides in this repository to provide functions that can be called at certain points (startup, log creation/deletion) such that the code can then create their own logs based on the contents of an OpenBMC log. A specific extension's code is compiled in using a --enable configure option, so platforms that did not use those log formats would incur no performance/size penalties. This commit provides the support for extensions, plus a basic OpenPower PEL (Platform Event Log) extension as the first extension. PELs are event logs used only on some OpenPower systems. Signed-off-by: Matt Spinler <spinler@us.ibm.com> Change-Id: Ifbb31325261c157678c29bbebc7f6d32d282582f
OpenPOWER on IntegriCloud