Support for callout list FFDC

The FFDC contains relevent fields to a callout that otherwise would not
be displayed in the callout user data section.

Signed-off-by: Zane Shelley <zshelle@us.ibm.com>
Change-Id: Iadb71587b7219c4d352fa583ddd86f290de4a747
diff --git a/analyzer/create_pel.cpp b/analyzer/create_pel.cpp
index 558af52..f1c245f 100644
--- a/analyzer/create_pel.cpp
+++ b/analyzer/create_pel.cpp
@@ -27,6 +27,7 @@
 {
     FFDC_SIGNATURES    = 0x01,
     FFDC_REGISTER_DUMP = 0x02,
+    FFDC_CALLOUT_FFDC  = 0x03,
 
     // For the callout section, the value of '0xCA' is required per the
     // phosphor-logging openpower-pel extention spec.
@@ -94,6 +95,20 @@
 
 //------------------------------------------------------------------------------
 
+void __addCalloutFFDC(const ServiceData& i_servData,
+                      std::vector<util::FFDCFile>& io_userDataFiles)
+{
+    // Create a new entry for the user data section containing the FFDC.
+    io_userDataFiles.emplace_back(util::FFDCFormat::Custom, FFDC_CALLOUT_FFDC,
+                                  FFDC_VERSION1);
+
+    // Use a file stream to write the JSON to file.
+    std::ofstream o{io_userDataFiles.back().getPath()};
+    o << i_servData.getCalloutFFDC();
+}
+
+//------------------------------------------------------------------------------
+
 void __captureSignatureList(const libhei::IsolationData& i_isoData,
                             std::vector<util::FFDCFile>& io_userDataFiles)
 {
@@ -264,6 +279,9 @@
     // Add the list of callouts to the PEL.
     __addCalloutList(i_servData, userDataFiles);
 
+    // Add the callout FFDC to the PEL.
+    __addCalloutFFDC(i_servData, userDataFiles);
+
     // Capture the complete signature list.
     __captureSignatureList(i_isoData, userDataFiles);