PEL: peltool: Print all PELs into JSON array

Added -a option to display all PELS at once into a JSON array.

Read message registry once to parse SRC sections in PELs.

Signed-off-by: Harisuddin Mohamed Isa <harisuddin@gmail.com>
Change-Id: I19690a866a3348cf2d8a9a89be38bc09e3eb7f9f
diff --git a/extensions/openpower-pels/src.cpp b/extensions/openpower-pels/src.cpp
index 4067fe8..6619d3f 100644
--- a/extensions/openpower-pels/src.cpp
+++ b/extensions/openpower-pels/src.cpp
@@ -428,7 +428,7 @@
     return printOut;
 }
 
-std::optional<std::string> SRC::getJSON() const
+std::optional<std::string> SRC::getJSON(message::Registry& registry) const
 {
     std::string ps;
     jsonInsert(ps, "Section Version", getNumberString("%d", _header.version),
@@ -462,8 +462,7 @@
         jsonInsert(ps, "Backplane CCIN", ccinString, 1);
     }
 
-    rg::Registry registry(getMessageRegistryPath() / rg::registryFileName);
-    auto errorDetails = getErrorDetails(registry, DetailLevel::json);
+    auto errorDetails = getErrorDetails(registry, DetailLevel::json, true);
     if (errorDetails)
     {
         ps.append(errorDetails.value());