summaryrefslogtreecommitdiffstats
path: root/extensions
diff options
context:
space:
mode:
authorHarisuddin Mohamed Isa <harisuddin@gmail.com>2020-02-06 18:05:21 +0800
committerHarisuddin Mohamed Isa <harisuddin@gmail.com>2020-02-06 18:05:21 +0800
commitc32e5516d2aee1a4069574f915f0946e56ff8427 (patch)
tree7c29a5d21eb37e22e39fd7340a9aaf9e21ad0d07 /extensions
parent0f717e1063154f0baec62f80e043d4d1c3317ce0 (diff)
downloadphosphor-logging-c32e5516d2aee1a4069574f915f0946e56ff8427.tar.gz
phosphor-logging-c32e5516d2aee1a4069574f915f0946e56ff8427.zip
PEL: Fix SRC Format and more SRC flags in peltool
"Primary SRC": { "Section Version": "1", "Sub-section type": "0", "Created by": "0x4552", "SRC Version": "0x02", "SRC Format": "0x60", "Virtual Progress SRC": "False", "I5/OS Service Event Bit": "False", "Hypervisor Dump Initiated":"False", "Power Control Net Fault": "False", "Valid Word Count": "0x04", "Reference Code": "B700F142", "Hex Word 2": "00000060", "Hex Word 3": "00000001", "Hex Word 4": "00000005" } Testing: Manually run peltool and verified output. All unit tests passed. Signed-off-by: Harisuddin Mohamed Isa <harisuddin@gmail.com> Change-Id: Ic510b4bcae5eba0ac3cf52f83a10dfa3fb48e533
Diffstat (limited to 'extensions')
-rw-r--r--extensions/openpower-pels/json_utils.cpp2
-rw-r--r--extensions/openpower-pels/src.cpp9
2 files changed, 9 insertions, 2 deletions
diff --git a/extensions/openpower-pels/json_utils.cpp b/extensions/openpower-pels/json_utils.cpp
index a25311c..cd41804 100644
--- a/extensions/openpower-pels/json_utils.cpp
+++ b/extensions/openpower-pels/json_utils.cpp
@@ -145,7 +145,7 @@ void jsonInsert(std::string& jsonStr, const std::string& fieldName,
colAlign - (indentCount * indentLevel) - fieldName.length() - 3;
const std::string jsonIndent(indentCount * indentLevel, 0x20);
jsonStr.append(jsonIndent + "\"" + fieldName + "\":");
- if (spacesToAppend > 0)
+ if (spacesToAppend >= 0)
{
jsonStr.append(spacesToAppend, 0x20);
}
diff --git a/extensions/openpower-pels/src.cpp b/extensions/openpower-pels/src.cpp
index 570c6c6..db84347 100644
--- a/extensions/openpower-pels/src.cpp
+++ b/extensions/openpower-pels/src.cpp
@@ -401,7 +401,14 @@ std::optional<std::string> SRC::getJSON() const
jsonInsert(ps, "Created by", getNumberString("0x%X", _header.componentID),
1);
jsonInsert(ps, "SRC Version", getNumberString("0x%02X", _version), 1);
- jsonInsert(ps, "SRC Format", getNumberString("0x%02X", _hexData[0]), 1);
+ jsonInsert(ps, "SRC Format", getNumberString("0x%02X", _hexData[0] & 0xFF),
+ 1);
+ jsonInsert(ps, "Virtual Progress SRC",
+ pv::boolString.at(_flags & virtualProgressSRC), 1);
+ jsonInsert(ps, "I5/OS Service Event Bit",
+ pv::boolString.at(_flags & i5OSServiceEventBit), 1);
+ jsonInsert(ps, "Hypervisor Dump Initiated",
+ pv::boolString.at(_flags & hypDumpInit), 1);
jsonInsert(ps, "Power Control Net Fault",
pv::boolString.at(isPowerFaultEvent()), 1);
rg::Registry registry(getMessageRegistryPath() / rg::registryFileName);
OpenPOWER on IntegriCloud