diff options
| author | Caleb Palmer <cnpalmer@us.ibm.com> | 2019-01-10 08:35:50 -0600 |
|---|---|---|
| committer | Daniel M. Crowell <dcrowell@us.ibm.com> | 2019-01-15 15:36:46 -0600 |
| commit | c7d8ac0a078bd1e01ce591c3515a68737da7795f (patch) | |
| tree | e8e56a7fd961d5ed5762a8bfe9e037369881178e /src/usr/errl/parser | |
| parent | 451596eb83df36f128b80153d173d8dbcbde741c (diff) | |
| download | blackbird-hostboot-c7d8ac0a078bd1e01ce591c3515a68737da7795f.tar.gz blackbird-hostboot-c7d8ac0a078bd1e01ce591c3515a68737da7795f.zip | |
Add PRD files SRCs to srcListing
Change-Id: Idc79b63214f24e4dc0d97d61be208288fe011b45
CQ: SW431064
Reviewed-on: http://rchgit01.rchland.ibm.com/gerrit1/70399
Tested-by: Jenkins Server <pfd-jenkins+hostboot@us.ibm.com>
Tested-by: Jenkins OP Build CI <op-jenkins+hostboot@us.ibm.com>
Tested-by: Jenkins OP HW <op-hw-jenkins+hostboot@us.ibm.com>
Tested-by: FSP CI Jenkins <fsp-CI-jenkins+hostboot@us.ibm.com>
Reviewed-by: Zane C. Shelley <zshelle@us.ibm.com>
Reviewed-by: Brian J. Stegmiller <bjs@us.ibm.com>
Reviewed-by: Daniel M. Crowell <dcrowell@us.ibm.com>
Diffstat (limited to 'src/usr/errl/parser')
| -rwxr-xr-x | src/usr/errl/parser/genErrlParsers.pl | 200 |
1 files changed, 186 insertions, 14 deletions
diff --git a/src/usr/errl/parser/genErrlParsers.pl b/src/usr/errl/parser/genErrlParsers.pl index 1d3af664d..19be84266 100755 --- a/src/usr/errl/parser/genErrlParsers.pl +++ b/src/usr/errl/parser/genErrlParsers.pl @@ -6,7 +6,7 @@ # # OpenPOWER HostBoot Project # -# Contributors Listed Below - COPYRIGHT 2013,2018 +# Contributors Listed Below - COPYRIGHT 2013,2019 # [+] Google Inc. # [+] International Business Machines Corp. # @@ -91,6 +91,7 @@ my $errlTypes = $compIncPath."/errl/hberrltypes.H"; #------------------------------------------------------------------------------ my @reasonCodeFiles; my @filesToParse; +my @prdfFilesToParse; my @pluginDirsToParse; getReasonCodeFiles($compIncPath); getReasonCodeFiles($compBlIncPath); @@ -782,6 +783,178 @@ foreach my $file (@filesToParse) close(PARSE_FILE); } +# For PRDF files we only need to get the SRC list +foreach my $prdfFile (@prdfFilesToParse) +{ + open(PRDF_PARSE_FILE, $prdfFile) or die("Cannot open: $prdfFile: $!"); + + my @namespaces; + push(@namespaces, "NO_NS"); + while (my $line = <PRDF_PARSE_FILE>) + { + + if ($line =~ /namespace\s+(\w+)/) + { + # Found a namespace, record it to be used when searching for + # moduleid and reasoncode values + push(@namespaces, $1); + next; + } + + if ($line =~ /\/\*\@/) + { + # Found the start of an error log tag + my $desc = ""; + my $cdesc = ""; + my $rc = ""; + my $rcValue = ""; + + # Read the entire error log tag into an array + my @tag; + + while ($line = <PRDF_PARSE_FILE>) + { + if ($line =~ /\*\//) + { + # Found the end of an error log tag + last; + } + push(@tag, $line); + } + + # Process the error log tag + my $numLines = scalar (@tag); + + for (my $lineNum = 0; $lineNum < $numLines; $lineNum++) + { + $line = $tag[$lineNum]; + + if ($line =~ /\@reasoncode\s+(\S+)/i) + { + # Found a reasoncode, figure out the value + $rc = $1; + + if ($rc =~ /(\w+)::(\w+)/) + { + # The namespace was provided + if ((exists $rcToValueHash{$1}) && + (exists ${rcToValueHash{$1}->{$2}})) + { + $rcValue = ${rcToValueHash{$1}->{$2}}; + } + } + else + { + # The namespace was not provided, look through all + # namespaces mentioned in the file + foreach my $namespace(@namespaces) + { + if ((exists $rcToValueHash{$namespace}) && + (exists ${rcToValueHash{$namespace}->{$rc}})) + { + $rcValue = ${rcToValueHash{$namespace}->{$rc}}; + last; + } + } + } + + if ($rcValue eq "") + { + print ("$0: Error finding reasoncode value for '$prdfFile:$line'\n"); + exit(1); + } + } + elsif ($line =~ /\@devdesc\s+(\S+.*)/i) + { + # Found a description, strip out any double-quotes and + # trailing whitespace + $desc = $1; + $desc =~ s/\"//g; + $desc =~ s/\s+$//; + + # Look for follow-on lines + for ($lineNum++; $lineNum < $numLines; $lineNum++) + { + $line = $tag[$lineNum]; + + if ($line =~ /\@/) + { + # Found the next element, rewind + $lineNum--; + last; + } + + # Continuation of description, strip out any double- + # quotes and leading / trailing whitespace + $line =~ s/^.+\*\s+//; + $line =~ s/\"//g; + $line =~ s/\s+$//; + + if ($line ne "") + { + $desc = $desc . " " . $line; + } + } + } + elsif ($line =~ /\@custdesc\s+(\S+.*)/i) + { + # Found a customer description. Strip out any + # double-quotes and trailing whitespace + $cdesc = $1; + $cdesc =~ s/\"//g; + $cdesc =~ s/\s+$//; + + # Look for follow-on lines + for ($lineNum++; $lineNum < $numLines; $lineNum++) + { + $line = $tag[$lineNum]; + + if ($line =~ /\@/) + { + # Found the next element, rewind + $lineNum--; + last; + } + + # Continuation of description, strip out any + # double-quotes and leading / trailing + # whitespace + $line =~ s/^.+\*\s+//; + $line =~ s/\"//g; + $line =~ s/\s+$//; + + if ($line ne "") + { + $cdesc = $cdesc . " " . $line; + } + } + } + } + + # if no customer desc is provided, then use $desc + if ($cdesc eq "") + { + $cdesc = + "During processor/memory subsystem initialization," + . " an error was encountered: $desc"; + } + + # SRC list - Don't add testcase SRCs + if(not $prdfFile =~ /\/test\//) + { + my $srcText = sprintf("%04X", hex($rcValue)); + # eliminate dups + if($srcList{$srcText} eq "") + { + $srcList{$srcText} .= $cdesc; + } + } + } + } + + close(PRDF_PARSE_FILE); +} + #------------------------------------------------------------------ # Load the sybsystem values for the System Reference Codes (SRCs) #------------------------------------------------------------------ @@ -1217,12 +1390,8 @@ sub getReasonCodeFiles if (-d $dirEntryPath) { - # Exclude PRD directory - if ( !($dirEntryPath =~ /prdf/) ) - { - # Recursively call this function - getReasonCodeFiles($dirEntryPath); - } + # Recursively call this function + getReasonCodeFiles($dirEntryPath); } elsif( (($dirEntry =~ /reasoncodes/i) || ($dirEntry =~ /service_codes/i) || @@ -1255,18 +1424,21 @@ sub getFilesToParse if (-d $dirEntryPath) { - # Exclude PRD directory - if ( !($dirEntryPath =~ /prdf/) ) - { - # Recursively call this function - getFilesToParse($dirEntryPath); - } + # Recursively call this function + getFilesToParse($dirEntryPath); } - elsif($dirEntry =~ /\.[H|C]$/) + elsif($dirEntry =~ /\.[H|C]$/ && !($dirEntryPath =~ /prdf/) ) { # Found file to parse push(@filesToParse, $dirEntryPath); } + # We will keep the prdf files separate from the rest of the list as we + # only want to get the SRC listing from them and nothing else. + elsif($dirEntry =~ /\.[H|C]$/ && $dirEntryPath =~ /prdf/ ) + { + # Found prdf file to parse + push(@prdfFilesToParse, $dirEntryPath); + } } } |

