From b014251663729bd8a6beaf4245f08ec3a04fbdd1 Mon Sep 17 00:00:00 2001 From: Matt Derksen Date: Tue, 4 Dec 2018 11:40:32 -0600 Subject: Update WOF errl parser to allow for padding Noticed padding to 4-byte boundaries which throws off this error log parsing. Parsing updated to just output the expected entries and ignore the additional padding. Change-Id: I238a1466919005069a36cc9c61b3d3f5f7b02278 Reviewed-on: http://rchgit01.rchland.ibm.com/gerrit1/69405 Tested-by: Jenkins Server Tested-by: Jenkins OP Build CI Tested-by: Jenkins OP HW Tested-by: FSP CI Jenkins Reviewed-by: Christian R. Geddes Reviewed-by: Roland Veloz Reviewed-by: Daniel M. Crowell --- src/usr/errl/plugins/errludwofdata.H | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'src/usr/errl/plugins') diff --git a/src/usr/errl/plugins/errludwofdata.H b/src/usr/errl/plugins/errludwofdata.H index f757c91d2..f792c5485 100644 --- a/src/usr/errl/plugins/errludwofdata.H +++ b/src/usr/errl/plugins/errludwofdata.H @@ -118,10 +118,9 @@ public: tableEntries = actualTableCount; // don't go over buffer length } - // Check that the remaining data breaks down into parsable - // wofTableCompareData_t entries - if ( (i_buflen - sizeof(tableEntries)) - % sizeof(wofTableCompareData_t) == 0 ) + // Verify the buffer contains at least the specified number of entries + if ( (i_buflen - sizeof(tableEntries) - + tableEntries * sizeof(wofTableCompareData_t)) >= 0 ) { i_parser.PrintString("---------------------------------------", "---------------------------------------"); @@ -185,7 +184,9 @@ public: } else { + i_parser.PrintString("Unable to parse too small buffer",""); i_parser.PrintNumber("WOF Buffer length", "0x%X", i_buflen); + i_parser.PrintNumber("Total entry count", "0x%X", tableEntries); i_parser.PrintString("Expected buffer format:", "uint16_t count, match this entry, unmatched entries"); i_parser.PrintNumber("Each entry size", "%d", -- cgit v1.2.1