PEL: Only hexdump the UserData data, not header

In the case where this is no built in or user defined parser for a
UserData PEL section, peltool will hexdump it.

Instead of hexdumping the whole section, which includes the header,
print the  component ID, subtype, and version fields from the section
header separately, and only hexdump the data:

"User Data 5": {
    "Section Version":          "3",
    "Sub-section type":         "2",
    "Created by":               "0x1000",
    "Data": [
        "01 02 03 04 05 06 07 08  09 0A 0B 0C 0D 22 5C 41  |  .............\"\\A",
    ]
}

Signed-off-by: Matt Spinler <spinler@us.ibm.com>
Change-Id: Ie6c791fcc5c23565ca55d0bbf8d0cbb643234f66
diff --git a/extensions/openpower-pels/pel.cpp b/extensions/openpower-pels/pel.cpp
index 625546e..5114761 100644
--- a/extensions/openpower-pels/pel.cpp
+++ b/extensions/openpower-pels/pel.cpp
@@ -235,19 +235,35 @@
         auto json = (sectionID == "PS" || sectionID == "SS")
                         ? section.getJSON(registry)
                         : section.getJSON();
+
+        buf += "\"" + sectionName + "\": {\n";
+
         if (json)
         {
-            buf += "\"" + sectionName + "\": {\n";
             buf += *json + "\n},\n";
         }
         else
         {
-            buf += "\"" + sectionName + "\": [\n";
+            jsonInsert(buf, pv::sectionVer,
+                       getNumberString("%d", section.header().version), 1);
+            jsonInsert(buf, pv::subSection,
+                       getNumberString("%d", section.header().subType), 1);
+            jsonInsert(buf, pv::createdBy,
+                       getNumberString("0x%X", section.header().componentID),
+                       1);
+
             std::vector<uint8_t> data;
             Stream s{data};
             section.flatten(s);
-            std::string dstr = dumpHex(std::data(data), data.size());
-            buf += dstr + "],\n";
+            std::string dstr =
+                dumpHex(std::data(data) + SectionHeader::flattenedSize(),
+                        data.size(), 2);
+
+            std::string jsonIndent(indentLevel, 0x20);
+            buf += jsonIndent + "\"Data\": [\n";
+            buf += dstr;
+            buf += jsonIndent + "]\n";
+            buf += "},\n";
         }
     }
     else