From c32e5516d2aee1a4069574f915f0946e56ff8427 Mon Sep 17 00:00:00 2001 From: Harisuddin Mohamed Isa Date: Thu, 6 Feb 2020 18:05:21 +0800 Subject: 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 Change-Id: Ic510b4bcae5eba0ac3cf52f83a10dfa3fb48e533 --- extensions/openpower-pels/json_utils.cpp | 2 +- extensions/openpower-pels/src.cpp | 9 ++++++++- 2 files changed, 9 insertions(+), 2 deletions(-) (limited to 'extensions') 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 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); -- cgit v1.2.1