PEL: Print component names in peltool

Every PEL section has a 2 byte component ID field in its header that
peltool prints.  Currently, it just prints the hex version, like
"0x1000".

There are JSON files in the flash already that contain mappings of
component IDs to to component names, and this commit starts looking
up the component names from those files and using those in the peltool
output.

An example of a file is:
/usr/share/phosphor-logging/pels/O_component_ids.json:
{
    "1000": "bmc common function",
    "2000": "bmc error logging",
    ...
}

Where the 'O' in the filename is the creator ID field of the PEL.  There
is also a file for hostboot, which is B_component_ids.json.

Also, for PELs with a PHYP creator ID, just convert the ID to two
characters, like 0x4552 - > "ER" as that is what they are.

peltool output examples:
    "Created by": "bmc error logging",
    "Created by": "hostboot: errl",
    "Created by": "IO",

This matches what is already done by the python peltool.

Signed-off-by: Matt Spinler <spinler@us.ibm.com>
Change-Id: Id616739e1b7ca67c85dc7efa85dc34acf6aca9b5
diff --git a/extensions/openpower-pels/src.cpp b/extensions/openpower-pels/src.cpp
index e195fa7..063c2ad 100644
--- a/extensions/openpower-pels/src.cpp
+++ b/extensions/openpower-pels/src.cpp
@@ -707,8 +707,8 @@
     std::vector<std::string> hexwords;
     jsonInsert(ps, pv::sectionVer, getNumberString("%d", _header.version), 1);
     jsonInsert(ps, pv::subSection, getNumberString("%d", _header.subType), 1);
-    jsonInsert(ps, pv::createdBy, getNumberString("0x%X", _header.componentID),
-               1);
+    jsonInsert(ps, pv::createdBy,
+               getComponentName(_header.componentID, creatorID), 1);
     jsonInsert(ps, "SRC Version", getNumberString("0x%02X", _version), 1);
     jsonInsert(ps, "SRC Format", getNumberString("0x%02X", _hexData[0] & 0xFF),
                1);