From 67456c2baa53c96118cd0565a8ec0f3814b38f68 Mon Sep 17 00:00:00 2001 From: Matt Spinler Date: Mon, 21 Oct 2019 12:22:49 -0500 Subject: PEL: Start creating PELs from event logs Look up incoming OpenBMC event logs in the message registry and create PELs for them if a registry entry is found. What happens when an event log can't be found in the message registry, such as creating a different PEL, will be addressed in a separate commit. Signed-off-by: Matt Spinler Change-Id: I45c634830021fdf2efb54e3cbfd6d496fd3d7d01 --- extensions/openpower-pels/manager.cpp | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) (limited to 'extensions/openpower-pels/manager.cpp') diff --git a/extensions/openpower-pels/manager.cpp b/extensions/openpower-pels/manager.cpp index fd3670c..2141a71 100644 --- a/extensions/openpower-pels/manager.cpp +++ b/extensions/openpower-pels/manager.cpp @@ -110,7 +110,20 @@ void Manager::createPEL(const std::string& message, uint32_t obmcLogID, const std::vector& additionalData, const std::vector& associations) { - // TODO: look up the error in _registry and create a PEL + auto entry = _registry.lookup(message); + + if (entry) + { + AdditionalData ad{additionalData}; + + auto pel = + std::make_unique(*entry, obmcLogID, timestamp, severity, ad); + + _repo.add(pel); + } + + // TODO ibm-openbmc/dev/1151: When the message registry is actually filled + // in, handle the case where an error isn't in it. } } // namespace pels -- cgit v1.2.1