platform-mc: Support CPER Event handler
Handle CPER event(0x07) which is defined in `Table 11 - PLDM Event
Type` and section `16.17 eventData format for CPEREvent` in DSP0248
v1.3.0.
The code supports:
1. Handle the PLDM event which has eventClass as CPEREvent (0x07).
2. Store the CPER data in PLDM CPER event to file at `/var/cper/`.
3. Call `CreateDump` method of `xyz.openbmc_project.Dump.Manager` D-Bus
service to create dump fault log.
4. The user can find the dump fault logs in Redfish FaultLog entries
thru URL `/redfish/v1/Managers/bmc/LogServices/FaultLog/Entries`. Each
CPER entry includes the URL to download the created CPER data file
`/redfish/v1/Managers/bmc/LogServices/FaultLog/Entries/<id>/attachment`.
5. The user can use `cper-parser` in `libcper` to parse the CPER data in
the attached file.
Signed-off-by: Thu Nguyen <thu@os.amperecomputing.com>
Change-Id: I85c53933183178c6b5acdfc12c805e8a4cf1ca2a
diff --git a/pldmd/pldmd.cpp b/pldmd/pldmd.cpp
index 5aae40d..fc2b08d 100644
--- a/pldmd/pldmd.cpp
+++ b/pldmd/pldmd.cpp
@@ -275,6 +275,13 @@
std::make_unique<platform_mc::Manager>(event, reqHandler, instanceIdDb);
pldm::responder::platform::EventMap addOnEventHandlers{
+ {PLDM_CPER_EVENT,
+ {[&platformManager](const pldm_msg* request, size_t payloadLength,
+ uint8_t formatVersion, uint8_t tid,
+ size_t eventDataOffset) {
+ return platformManager->handleCperEvent(
+ request, payloadLength, formatVersion, tid, eventDataOffset);
+ }}},
{PLDM_SENSOR_EVENT,
{[&platformManager](const pldm_msg* request, size_t payloadLength,
uint8_t formatVersion, uint8_t tid,