diff options
| author | Stephen Cprek <smcprek@us.ibm.com> | 2014-10-20 12:14:51 -0500 |
|---|---|---|
| committer | A. Patrick Williams III <iawillia@us.ibm.com> | 2014-10-22 21:36:27 -0500 |
| commit | 7b6c6924750ac0354b851109e362f36c9e8ae51d (patch) | |
| tree | 5e9b93d2817235be97e8bbd6b063c601e244a20f /src/usr/errl/parser | |
| parent | 09096ab2250baf0d9a604e1f4b801b1986d83384 (diff) | |
| download | talos-hostboot-7b6c6924750ac0354b851109e362f36c9e8ae51d.tar.gz talos-hostboot-7b6c6924750ac0354b851109e362f36c9e8ae51d.zip | |
Fix errldipaly compTable to be sorted by numerical compId value
Removed '\n' from errldisplay console prints as they add
an extra new line. Don't see a need to print out label, more
useful target info will be printed out in displayTarget
Change-Id: I8c392f3c84d8acd4bda544e5e5b9668aebbcc0ed
Reviewed-on: http://gfw160.aus.stglabs.ibm.com:8080/gerrit/14082
Reviewed-by: Brian H. Horton <brianh@linux.ibm.com>
Tested-by: Jenkins Server
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 | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/src/usr/errl/parser/genErrlParsers.pl b/src/usr/errl/parser/genErrlParsers.pl index a2ec5f08c..e246e1a8a 100755 --- a/src/usr/errl/parser/genErrlParsers.pl +++ b/src/usr/errl/parser/genErrlParsers.pl @@ -127,6 +127,7 @@ if ($DEBUG) # Process the compIdFile, recording all of the component ID values #------------------------------------------------------------------------------ my %compIdToValueHash; +my %compIdToHexValueHash; open(COMP_ID_FILE, $compIdFile) or die("Cannot open: $compIdFile: $!"); @@ -145,6 +146,8 @@ while (my $line = <COMP_ID_FILE>) if ($compId ne "PRDF_COMP_ID") { $compIdToValueHash{$compId} = $compValue; + # Need the integer value for compId sorting purposes + $compIdToHexValueHash{$compId} = hex $compValue; } } } @@ -1076,12 +1079,20 @@ foreach my $modID (sort keys %displayDataEntries) } } +#------------------------------------------------------------------------------ +# Helper function for sort method, sorts by ascending values +#------------------------------------------------------------------------------ +sub hashValueAsc +{ + $compIdToHexValueHash{$a} <=> $compIdToHexValueHash{$b}; +} + 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) +foreach my $key (sort hashValueAsc (keys(%compIdToHexValueHash))) { $key = substr($key,0,length($key)-3); print OFILE " {" . $key . "_ID, " . $key . "_NAME},\n"; |

