From 5c9e8309715c863c3d24263fc38efa53462f59b0 Mon Sep 17 00:00:00 2001 From: Stephen Cprek Date: Fri, 7 Nov 2014 15:34:54 -0600 Subject: Fix errldisplay errorInfo hex string compare to be numeric This will fix those "unknown" strings in the errldisplay Change-Id: Id231948fc7d235e427cbbbe88d3c4477109e239b Reviewed-on: http://gfw160.aus.stglabs.ibm.com:8080/gerrit/14405 Tested-by: Jenkins Server Reviewed-by: ANDRES A. LUGO-REYES Reviewed-by: A. Patrick Williams III --- src/usr/errl/parser/genErrlParsers.pl | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) (limited to 'src/usr/errl') diff --git a/src/usr/errl/parser/genErrlParsers.pl b/src/usr/errl/parser/genErrlParsers.pl index e246e1a8a..fde5799a5 100755 --- a/src/usr/errl/parser/genErrlParsers.pl +++ b/src/usr/errl/parser/genErrlParsers.pl @@ -1058,6 +1058,14 @@ $outputFileName = $outputDir . "/../errldisplaydata.C"; open(OFILE, ">", $outputFileName . ".tmp") or die("Cannot open: $outputFileName.tmp: $!"); +#------------------------------------------------------------------------------ +# Helper function for sort method, convert hex string to decimal and compare +#------------------------------------------------------------------------------ +sub hexToDecCmp +{ + hex($a) <=> hex($b); +} + 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"; @@ -1071,9 +1079,9 @@ print OFILE "#include \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 $modID (sort hexToDecCmp keys(%displayDataEntries)) { - foreach my $rc (sort keys %{$displayDataEntries{$modID}}) + foreach my $rc (sort hexToDecCmp keys(%{$displayDataEntries{$modID}})) { print OFILE $displayDataEntries{$modID}{$rc}; } -- cgit v1.2.1