diff options
| author | Stephen Cprek <smcprek@us.ibm.com> | 2013-06-21 16:34:25 -0700 |
|---|---|---|
| committer | A. Patrick Williams III <iawillia@us.ibm.com> | 2014-10-16 10:42:46 -0500 |
| commit | 60a6933fb818b282fb7aa50b4a7f4d98ebd4657f (patch) | |
| tree | 67d0b14ec56b358e004c10526bb61135b7dd6f56 /src/usr/errl/parser | |
| parent | 1ca3b284749604f3984b002fb292e68e86b1227a (diff) | |
| download | blackbird-hostboot-60a6933fb818b282fb7aa50b4a7f4d98ebd4657f.tar.gz blackbird-hostboot-60a6933fb818b282fb7aa50b4a7f4d98ebd4657f.zip | |
Add human-readable dumps of error log entries as they are committed.
Origin: Google Shared Technology
Change-Id: I1d0a30faa27c0b8bd1b76418706e24378a5da7eb
RTC: 97491
Reviewed-on: http://gfw160.aus.stglabs.ibm.com:8080/gerrit/11266
Tested-by: Jenkins Server
Reviewed-by: Brian Silver <bsilver@us.ibm.com>
Reviewed-by: A. Patrick Williams III <iawillia@us.ibm.com>
Diffstat (limited to 'src/usr/errl/parser')
| -rwxr-xr-x | src/usr/errl/parser/genErrlParsers.pl | 64 | ||||
| -rw-r--r-- | src/usr/errl/parser/makefile | 2 |
2 files changed, 66 insertions, 0 deletions
diff --git a/src/usr/errl/parser/genErrlParsers.pl b/src/usr/errl/parser/genErrlParsers.pl index 626b6b763..7fb516683 100755 --- a/src/usr/errl/parser/genErrlParsers.pl +++ b/src/usr/errl/parser/genErrlParsers.pl @@ -7,6 +7,7 @@ # OpenPOWER HostBoot Project # # Contributors Listed Below - COPYRIGHT 2013,2014 +# [+] Google Inc. # [+] International Business Machines Corp. # # @@ -442,6 +443,7 @@ close(OFILE); my %compValueToParseHash; my %rcModValuesUsed; my %srcList; +my %displayDataEntries; foreach my $file (@filesToParse) { @@ -479,6 +481,7 @@ foreach my $file (@filesToParse) my $rc = ""; my $rcValue = ""; my @userData; + my @userDataTextOnly; my $desc = ""; my $cdesc = ""; @@ -607,6 +610,7 @@ foreach my $file (@filesToParse) my $udString = "\"$udDesc\", \"$udText\""; push(@userData, $udString); + push(@userDataTextOnly, $udText); } elsif ($line =~ /\@devdesc\s+(\S+.*)/i) { @@ -740,12 +744,26 @@ foreach my $file (@filesToParse) } $parserCode .= " break;\n\n"; + # Create the data entry code for this error + my $dataEntryCode = " {\n" + . " 0x$modIdValue, // Module Id\n" + . " 0x$rcValue, // ReasonCode\n" + . " \"$desc\",\n" + . " \"$modId\",\n" + . " \"$rc\",\n" + . " \"$userDataTextOnly[0]\",\n" + . " \"$userDataTextOnly[1]\"\n" + . " },\n\n"; + # The component value is the first two characters of the 4 character rc my $compValue = $rcValue; $compValue =~ s/..$//; # Add the parser code to compValueToParseHash $compValueToParseHash{$compValue} .= $parserCode; + + # Add the data entry code to displayDataEntries + $displayDataEntries{$modIdValue}{$rcValue} = $dataEntryCode; } } @@ -1028,6 +1046,52 @@ print OFILE "\n\n.include<\${RULES_MK}>\n"; close(OFILE); #------------------------------------------------------------------------------ +# Generate the errldisplaydata.C file that contains the set of Hostboot +# component IDs and detailed error data. +# Note: This file is placed one directory up from the other generated files +# because this is actually part of hostboot. +#------------------------------------------------------------------------------ +$outputFileName = $outputDir . "/../errldisplaydata.C"; +open(OFILE, ">", $outputFileName) or die("Cannot open: $outputFileName: $!"); + +print OFILE "/*\n"; +print OFILE " * Automatically generated by Hostboot's $0\n"; +print OFILE " * Do not modify this file in the hostboot tree, it is automatically\n"; +print OFILE " * generated every build.\n"; +print OFILE " *\n"; +print OFILE " * TimeStamp: $timestamp\n"; +print OFILE " * Image Id: $imageId\n"; +print OFILE " *\n"; +print OFILE " */\n\n"; +print OFILE "#include <errldisplay/errldisplay.H>\n"; +print OFILE "#include <stdlib.h>\n\n"; +print OFILE "namespace ERRORLOGDISPLAY\n{\n\n"; +print OFILE "// Error Info Table\n"; +print OFILE "ErrLogDisplay::errLogInfo ErrLogDisplay::errorInfo [] = {\n"; +foreach my $modID (sort keys %displayDataEntries) +{ + foreach my $rc (sort keys %{$displayDataEntries{$modID}}) + { + print OFILE $displayDataEntries{$modID}{$rc}; + } +} + +print OFILE "};\n"; +print OFILE "uint16_t ErrLogDisplay::errorInfoTableSize = sizeof(errorInfo) / sizeof(errorInfo[0]);\n\n"; +print OFILE "\n\n// Component Id Table\n"; +print OFILE "#include <hbotcompid.H>\n"; +print OFILE "ErrLogDisplay::compTableInfo ErrLogDisplay::compTable [] = {\n"; +foreach my $key (sort keys %compIdToValueHash) +{ + $key = substr($key,0,length($key)-3); + print OFILE " {" . $key . "_ID, " . $key . "_NAME},\n"; +} +print OFILE "};\n"; +print OFILE "uint16_t ErrLogDisplay::compTableSize = sizeof(compTable) / sizeof(compTable[0]);\n\n"; +print OFILE "} // End Namespace\n"; +close(OFILE); + +#------------------------------------------------------------------------------ # Subroutine that prints the usage #------------------------------------------------------------------------------ sub usage diff --git a/src/usr/errl/parser/makefile b/src/usr/errl/parser/makefile index e008e6974..05a3ab0fa 100644 --- a/src/usr/errl/parser/makefile +++ b/src/usr/errl/parser/makefile @@ -6,6 +6,7 @@ # OpenPOWER HostBoot Project # # Contributors Listed Below - COPYRIGHT 2011,2014 +# [+] Google Inc. # [+] International Business Machines Corp. # # @@ -96,6 +97,7 @@ clean: rm -f ${GENDIR}/comps.C rm -f ${IMGDIR}/errlparser rm -fr ${OBJDIR} + rm -f ${GENDIR}/errldisplaydata.C debug: ls -l ${GENDIR} |

