summaryrefslogtreecommitdiffstats
path: root/extensions
diff options
context:
space:
mode:
authorMatt Spinler <spinler@us.ibm.com>2019-12-16 14:40:21 -0600
committerMatt Spinler <spinler@us.ibm.com>2020-01-15 21:24:34 +0000
commit1d4c74a0a9c045a4327af60e1edf83398cdbd2e3 (patch)
tree4d3b72f8cb101abc2cda9dfecae44ac993ecd782 /extensions
parent2ecb465b0bd5249a3107fb1ee0ee5384bf1fdc4c (diff)
downloadphosphor-logging-1d4c74a0a9c045a4327af60e1edf83398cdbd2e3.tar.gz
phosphor-logging-1d4c74a0a9c045a4327af60e1edf83398cdbd2e3.zip
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 <spinler@us.ibm.com> Change-Id: I1228339cfa7d1d5aa60ef3b3ce2b2c0424ab0bf4
Diffstat (limited to 'extensions')
-rw-r--r--extensions/openpower-pels/manager.cpp25
1 files changed, 22 insertions, 3 deletions
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<std::string>& 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<level::INFO>(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<level::INFO>(msg.c_str());
+ }
}
} // namespace pels
OpenPOWER on IntegriCloud