summaryrefslogtreecommitdiffstats
path: root/src/usr/fapi2/platCreateHwpErrParser.pl
diff options
context:
space:
mode:
authorDean Sanner <dsanner@us.ibm.com>2017-02-01 09:05:39 -0600
committerDaniel M. Crowell <dcrowell@us.ibm.com>2017-02-03 10:01:06 -0500
commitb8da45026ffe3597634bdf01ed444b9106ee3f31 (patch)
tree55ec08eb3b9af8d77ba4ef0b5fae3414ce30deed /src/usr/fapi2/platCreateHwpErrParser.pl
parent735a843bbf49a43b79059e562ccb79982474c93c (diff)
downloadtalos-hostboot-b8da45026ffe3597634bdf01ed444b9106ee3f31.tar.gz
talos-hostboot-b8da45026ffe3597634bdf01ed444b9106ee3f31.zip
Improve error output on console
-Reformat the basic output to be more condensed -Fixed parsing of entity path -Added CONSOLE_OUTPUT_FFDCDISPLAY to emit all HWP FFDC Change-Id: I62f5c9f208be8d6f23428baa21d52866588d117c Reviewed-on: http://ralgit01.raleigh.ibm.com/gerrit1/35733 Reviewed-by: Martin Gloff <mgloff@us.ibm.com> Tested-by: Jenkins Server <pfd-jenkins+hostboot@us.ibm.com> Tested-by: FSP CI Jenkins <fsp-CI-jenkins+hostboot@us.ibm.com> Tested-by: Jenkins OP Build CI <op-jenkins+hostboot@us.ibm.com> Reviewed-by: William G. Hoffa <wghoffa@us.ibm.com> Reviewed-by: Daniel M. Crowell <dcrowell@us.ibm.com>
Diffstat (limited to 'src/usr/fapi2/platCreateHwpErrParser.pl')
-rwxr-xr-xsrc/usr/fapi2/platCreateHwpErrParser.pl141
1 files changed, 140 insertions, 1 deletions
diff --git a/src/usr/fapi2/platCreateHwpErrParser.pl b/src/usr/fapi2/platCreateHwpErrParser.pl
index 6271080fe..15b729b5e 100755
--- a/src/usr/fapi2/platCreateHwpErrParser.pl
+++ b/src/usr/fapi2/platCreateHwpErrParser.pl
@@ -6,7 +6,7 @@
#
# OpenPOWER HostBoot Project
#
-# Contributors Listed Below - COPYRIGHT 2015,2016
+# Contributors Listed Below - COPYRIGHT 2015,2017
# [+] International Business Machines Corp.
#
#
@@ -62,9 +62,13 @@ my $xml = new XML::Simple (KeyAttr=>[]);
#------------------------------------------------------------------------------
my $rcFile = $ARGV[0];
$rcFile .= "/";
+my $eDisFile = $rcFile;
$rcFile .= "hbfwPlatHwpErrParser.H";
open(TGFILE, ">", $rcFile);
+$eDisFile .= "hbfwErrDisplayPlatHwpErr.H";
+open(EDISFILE, ">", $eDisFile);
+
#------------------------------------------------------------------------------
# Print start of file information
#------------------------------------------------------------------------------
@@ -83,6 +87,17 @@ print TGFILE " uint32_t l_rc = ntohl(*(static_cast<uint32_t *>(i_pBuffer)));\
print TGFILE " switch(l_rc)\n";
print TGFILE " {\n";
+print EDISFILE "// hbfwErrDisplayPlatHwpErr.H\n";
+print EDISFILE "// This file is generated by perl script platCreateHwpErrParser.pl\n\n";
+print EDISFILE "#ifndef HBFWERRDISPLAYPLATHWPERR_H_\n";
+print EDISFILE "#define HBFWERRDISPLAYPLATHWPERR_H_\n\n";
+print EDISFILE "namespace fapi2\n";
+print EDISFILE "{\n\n";
+print EDISFILE "void hbfwErrDisplayHwpRc(const uint32_t i_hwpRc)\n";
+print EDISFILE "{\n";
+print EDISFILE " switch(i_hwpRc)\n";
+print EDISFILE " {\n";
+
#------------------------------------------------------------------------------
# For each XML file
#------------------------------------------------------------------------------
@@ -125,6 +140,11 @@ foreach my $argnum (1 .. $#ARGV)
print TGFILE " i_parser.PrintString(\"HwpReturnCode\", \"$err->{rc}\");\n";
print TGFILE " i_parser.PrintString(\"HWP Error description\", \"$desc\");\n";
print TGFILE " break;\n";
+
+ print EDISFILE " case 0x$errHash24Bit:\n";
+ print EDISFILE " CONSOLE::displayf(NULL,\" HwpReturnCode : $err->{rc}\");\n";
+ print EDISFILE " CONSOLE::displayf(NULL,\" HWP Error description : $desc\");\n";
+ print EDISFILE " break;\n";
}
}
@@ -137,6 +157,11 @@ print TGFILE " if (i_buflen) {i_parser.PrintHexDump(i_pBuffer, i_buflen);
print TGFILE " }\n";
print TGFILE "}\n\n";
+print EDISFILE " default:\n";
+print EDISFILE " CONSOLE::displayf(NULL,\" Unrecognized Error ID : 0x%x\", i_hwpRc);\n";
+print EDISFILE " }\n";
+print EDISFILE "}\n\n";
+
#------------------------------------------------------------------------------
# Print end of file info
#------------------------------------------------------------------------------
@@ -144,10 +169,14 @@ print TGFILE "}\n\n";
print TGFILE "#endif\n";
print TGFILE "#endif\n";
+print EDISFILE "}\n\n";
+print EDISFILE "#endif\n";
+
#------------------------------------------------------------------------------
# Close output file
#------------------------------------------------------------------------------
close(TGFILE);
+close(EDISFILE);
#------------------------------------------------------------------------------
@@ -155,9 +184,14 @@ close(TGFILE);
#------------------------------------------------------------------------------
my $rcFile = $ARGV[0];
$rcFile .= "/";
+my $eDisFile = $rcFile;
$rcFile .= "hbfwPlatHwpErrParserFFDC.H";
open(TGFILE, ">", $rcFile);
+$eDisFile .= "hbfwErrDisplayPlatHwpFFDC.H";
+open(EDISFILE, ">", $eDisFile);
+
+
#------------------------------------------------------------------------------
# Print start of file information
#------------------------------------------------------------------------------
@@ -170,6 +204,14 @@ print TGFILE "#include <netinet/in.h>\n\n";
print TGFILE "namespace fapi2\n";
print TGFILE "{\n\n";
+print EDISFILE "// hbfwErrDisplayPlatHwpFFDC.H\n";
+print EDISFILE "// This file is generated by perl script platCreateHwpErrParser.pl\n\n";
+print EDISFILE "#ifndef HBFWERRDISPLAYPLATHWPFFDC_H_\n";
+print EDISFILE "#define HBFWERRDISPLAYPLATHWPFFDC_H_\n\n";
+print EDISFILE "#include <stdio.h>\n\n";
+print EDISFILE "namespace fapi2\n";
+print EDISFILE "{\n\n";
+
#------------------------------------------------------------------------------
# Print start of hbfwParseHwpFfdc function
#------------------------------------------------------------------------------
@@ -190,6 +232,39 @@ print TGFILE " l_buflen -= sizeof(l_ffdcId);\n";
print TGFILE " switch(l_ffdcId)\n";
print TGFILE " {\n";
+print EDISFILE "void printHex(uint8_t * i_buf,\n";
+print EDISFILE " const size_t i_size)\n";
+print EDISFILE "{\n";
+print EDISFILE " char hexStr[256] = {0,};\n";
+print EDISFILE " char * pHex = hexStr;\n";
+print EDISFILE " size_t strSize = (i_size < 32) ? (i_size) : 32 ;\n";
+print EDISFILE " size_t pos = 0;\n";
+print EDISFILE "\n";
+print EDISFILE " for(size_t i=0; i < strSize; i++)\n";
+print EDISFILE " {\n";
+print EDISFILE " pos += sprintf(pHex+pos,\"%02X\", i_buf[i]);\n";
+print EDISFILE "\n";
+print EDISFILE " if(((i+1) % 4) == 0)\n";
+print EDISFILE " {\n";
+print EDISFILE " pos += sprintf(pHex+pos,\" \");\n";
+print EDISFILE " }\n";
+print EDISFILE " }\n";
+print EDISFILE " CONSOLE::displayf(NULL,\" %s\",pHex);\n";
+print EDISFILE "}\n\n\n";
+
+print EDISFILE "void hbfwErrDisplayHwpRcFFDC(const uint32_t i_ffdcId,\n";
+print EDISFILE " void * i_pBuffer,\n";
+print EDISFILE " const uint32_t i_buflen)\n";
+print EDISFILE "{\n";
+print EDISFILE " const uint32_t CFAM_DATA_LEN = 4;\n";
+print EDISFILE " const uint32_t SCOM_DATA_LEN = 8;\n";
+print EDISFILE " const uint32_t POS_LEN = 4;\n";
+print EDISFILE " uint8_t * l_pBuffer = static_cast<uint8_t *>(i_pBuffer);\n";
+print EDISFILE " uint32_t l_buflen = i_buflen;\n\n";
+print EDISFILE " switch(i_ffdcId)\n";
+print EDISFILE " {\n";
+
+
#------------------------------------------------------------------------------
# For each XML file
#------------------------------------------------------------------------------
@@ -224,6 +299,12 @@ foreach my $argnum (1 .. $#ARGV)
print TGFILE " i_parser.PrintNumber(\"Failed SCOM address\",\"%#016lX\",l_Address);}\n";
print TGFILE " break;\n";
+ print EDISFILE " case 0x$ffdcHash32Bit:\n";
+ print EDISFILE " { uint64_t l_Address =\n";
+ print EDISFILE " *(reinterpret_cast<uint64_t*>(l_pBuffer));\n";
+ print EDISFILE " CONSOLE::displayf(NULL,\" Failed SCOM address : %#016lX\",l_Address);}\n";
+ print EDISFILE " break;\n";
+
$ffdcName = $err->{rc} . "_pcb_pib_rc";
$ffdcHash128Bit = md5_hex($ffdcName);
$ffdcHash32Bit = substr($ffdcHash128Bit, 0, 8);
@@ -233,6 +314,10 @@ foreach my $argnum (1 .. $#ARGV)
print TGFILE " i_parser.PrintNumber(\"PIB RC:\",\"%#08lX\",l_PibRc);}\n";
print TGFILE " break;\n";
+ print EDISFILE " case 0x$ffdcHash32Bit:\n";
+ print EDISFILE " {uint32_t l_PibRc = *(reinterpret_cast<uint32_t *>(l_pBuffer));\n";
+ print EDISFILE " CONSOLE::displayf(NULL,\" PIB RC : %#08lX\",l_PibRc);}\n";
+ print EDISFILE " break;\n";
}
foreach my $ffdc (@{$err->{ffdc}})
@@ -252,6 +337,14 @@ foreach my $argnum (1 .. $#ARGV)
print TGFILE " if (l_buflen) ";
print TGFILE "{i_parser.PrintHexDump(l_pBuffer, l_buflen);}\n";
print TGFILE " break;\n";
+
+ print EDISFILE " case 0x$ffdcHash32Bit:\n";
+ print EDISFILE " CONSOLE::displayf(NULL,\" HwpReturnCode : $err->{rc}\");\n";
+ print EDISFILE " CONSOLE::displayf(NULL,\" FFDC : $ffdc\");\n";
+ print EDISFILE " if (l_buflen) ";
+ print EDISFILE " {printHex(l_pBuffer, l_buflen);}\n";
+ print EDISFILE " break;\n";
+
}
}
@@ -280,6 +373,21 @@ foreach my $argnum (1 .. $#ARGV)
print TGFILE " l_pBuffer+= POS_LEN;\n";
print TGFILE " l_buflen -= POS_LEN;\n";
print TGFILE " }\n";
+
+ print EDISFILE " case 0x$ffdcHash32Bit:\n";
+ print EDISFILE " CONSOLE::displayf(NULL,\" Register FFDC : $ffdcName\");\n";
+ print EDISFILE " while (l_buflen > 0)\n";
+ print EDISFILE " {\n";
+ print EDISFILE " if (l_buflen >= POS_LEN)\n";
+ print EDISFILE " {\n";
+ print EDISFILE " uint32_t * l_pBufferTemp = reinterpret_cast<uint32_t *>(l_pBuffer);\n";
+ print EDISFILE " CONSOLE::displayf(NULL,\" Chip Position : %X\", *l_pBufferTemp);\n";
+ print EDISFILE " l_pBufferTemp = NULL;\n";
+ print EDISFILE " l_pBuffer+= POS_LEN;\n";
+ print EDISFILE " l_buflen -= POS_LEN;\n";
+ print EDISFILE " }\n";
+
+
foreach my $cfamRegister (@{$registerFfdc->{cfamRegister}})
{
print TGFILE " if (l_buflen >= CFAM_DATA_LEN)\n";
@@ -289,6 +397,14 @@ foreach my $argnum (1 .. $#ARGV)
print TGFILE " l_pBuffer+= CFAM_DATA_LEN;\n";
print TGFILE " l_buflen -= CFAM_DATA_LEN;\n";
print TGFILE " }\n";
+
+ print EDISFILE " if (l_buflen >= CFAM_DATA_LEN)\n";
+ print EDISFILE " {\n";
+ print EDISFILE " CONSOLE::displayf(NULL,\" CFAM Register : $cfamRegister\");\n";
+ print EDISFILE " printHex(l_pBuffer, CFAM_DATA_LEN);\n";
+ print EDISFILE " l_pBuffer+= CFAM_DATA_LEN;\n";
+ print EDISFILE " l_buflen -= CFAM_DATA_LEN;\n";
+ print EDISFILE " }\n";
}
foreach my $scomRegister (@{$registerFfdc->{scomRegister}})
{
@@ -300,9 +416,20 @@ foreach my $argnum (1 .. $#ARGV)
print TGFILE " l_pBuffer+= SCOM_DATA_LEN;\n";
print TGFILE " l_buflen -= SCOM_DATA_LEN;\n";
print TGFILE " }\n";
+
+ print EDISFILE " if (l_buflen >= SCOM_DATA_LEN)\n";
+ print EDISFILE " {\n";
+ print EDISFILE " CONSOLE::displayf(NULL,\" SCOM Register : $scomRegister\");\n";
+ print EDISFILE " printHex(l_pBuffer, SCOM_DATA_LEN);\n";
+ print EDISFILE " l_pBuffer+= SCOM_DATA_LEN;\n";
+ print EDISFILE " l_buflen -= SCOM_DATA_LEN;\n";
+ print EDISFILE " }\n";
}
print TGFILE " }\n";
print TGFILE " break;\n";
+
+ print EDISFILE " }\n";
+ print EDISFILE " break;\n";
}
}
@@ -316,6 +443,14 @@ print TGFILE "{i_parser.PrintHexDump(l_pBuffer, l_buflen);}\n";
print TGFILE " }\n\n";
print TGFILE "}\n\n";
+print EDISFILE " default:\n";
+print EDISFILE " CONSOLE::displayf(NULL,\" Unrecognized FFDC : 0x%x\", i_ffdcId);\n";
+print EDISFILE " if (l_buflen) ";
+print EDISFILE " {printHex(l_pBuffer, l_buflen);}\n";
+print EDISFILE " }\n\n";
+print EDISFILE "}\n\n";
+
+
#------------------------------------------------------------------------------
# Print end of file info
#------------------------------------------------------------------------------
@@ -323,8 +458,12 @@ print TGFILE "}\n\n";
print TGFILE "#endif\n";
print TGFILE "#endif\n";
+print EDISFILE "}\n\n";
+print EDISFILE "#endif\n";
+
#------------------------------------------------------------------------------
# Close output file
#------------------------------------------------------------------------------
close(TGFILE);
+close(EDISFILE);
OpenPOWER on IntegriCloud