From 1d4c74a0a9c045a4327af60e1edf83398cdbd2e3 Mon Sep 17 00:00:00 2001 From: Matt Spinler Date: Mon, 16 Dec 2019 14:40:21 -0600 Subject: PEL: Trace when event logs don't create PELs To help show which events are missing from the PEL message registry, add a journal entry for when an OpenBMC event log name isn't found in the registry and a PEL won't be created. Eventually, this will be replaced with creating a brand new PEL that contains the event log info. In addition, add a journal entry displaying the SRC ASCII string of newly created PELs. Signed-off-by: Matt Spinler Change-Id: I1228339cfa7d1d5aa60ef3b3ce2b2c0424ab0bf4 --- extensions/openpower-pels/manager.cpp | 25 ++++++++++++++++++++++--- 1 file changed, 22 insertions(+), 3 deletions(-) (limited to 'extensions') diff --git a/extensions/openpower-pels/manager.cpp b/extensions/openpower-pels/manager.cpp index 0c94317..b9c7d94 100644 --- a/extensions/openpower-pels/manager.cpp +++ b/extensions/openpower-pels/manager.cpp @@ -126,6 +126,7 @@ void Manager::createPEL(const std::string& message, uint32_t obmcLogID, const std::vector& associations) { auto entry = _registry.lookup(message); + std::string msg; if (entry) { @@ -135,10 +136,28 @@ void Manager::createPEL(const std::string& message, uint32_t obmcLogID, ad, *_dataIface); _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. + auto src = pel->primarySRC(); + if (src) + { + using namespace std::literals::string_literals; + char id[11]; + sprintf(id, "0x%08X", pel->id()); + msg = "Created PEL "s + id + " with SRC "s + (*src)->asciiString(); + while (msg.back() == ' ') + { + msg.pop_back(); + } + log(msg.c_str()); + } + } + else + { + // TODO ibm-openbmc/dev/1151: Create a new PEL for this case. + // For now, just trace it. + msg = "Event not found in PEL message registry: " + message; + log(msg.c_str()); + } } } // namespace pels -- cgit v1.2.1