PEL: Print component name in peltool list
Printing the component name instead of just the component ID was
introduced in a previous commit, though it was just done when displaying
a full PEL.
In this commit, also display the component name of the creator when
listing PELs via peltool -l.
For example:
```
"0x50000032": {
"SRC": "BD5EC101",
...
"CompID": "bmc system dump collector"
}
```
Signed-off-by: Matt Spinler <spinler@us.ibm.com>
Change-Id: If6b503bd3d28a0c1879844a19527cc1f5144d78a
diff --git a/extensions/openpower-pels/tools/peltool.cpp b/extensions/openpower-pels/tools/peltool.cpp
index 3935371..39cb1e5 100644
--- a/extensions/openpower-pels/tools/peltool.cpp
+++ b/extensions/openpower-pels/tools/peltool.cpp
@@ -435,10 +435,11 @@
jsonInsert(listStr, "Sev", severity, 2);
// compID
- jsonInsert(listStr, "CompID",
- getNumberString(
- "0x%X", pel.privateHeader().header().componentID),
- 2);
+ jsonInsert(
+ listStr, "CompID",
+ getComponentName(pel.privateHeader().header().componentID,
+ pel.privateHeader().creatorID()),
+ 2);
auto found = listStr.rfind(",");
if (found != std::string::npos)