Skip to content

Commit

Permalink
ffdc length handling
Browse files Browse the repository at this point in the history
Change-Id: Idc44ef843ce46c17d178ee0d55d76edbc8afda84
Reviewed-on: http://ralgit01.raleigh.ibm.com/gerrit1/37651
Tested-by: Jenkins Server <pfd-jenkins+hostboot@us.ibm.com>
Tested-by: PPE CI <ppe-ci+hostboot@us.ibm.com>
Tested-by: Hostboot CI <hostboot-ci+hostboot@us.ibm.com>
Reviewed-by: Sachin Gupta <sgupta2m@in.ibm.com>
Reviewed-by: RAJA DAS <rajadas2@in.ibm.com>
Reviewed-by: PARVATHI RACHAKONDA <prachako@in.ibm.com>
Reviewed-on: http://ralgit01.raleigh.ibm.com/gerrit1/37712
Reviewed-by: Hostboot Team <hostboot@us.ibm.com>
Tested-by: Jenkins OP Build CI <op-jenkins+hostboot@us.ibm.com>
Tested-by: FSP CI Jenkins <fsp-CI-jenkins+hostboot@us.ibm.com>
Reviewed-by: Daniel M. Crowell <dcrowell@us.ibm.com>
  • Loading branch information
Shakeebbk authored and dcrowell77 committed Mar 10, 2017
1 parent ca16595 commit f45f210
Showing 1 changed file with 31 additions and 9 deletions.
40 changes: 31 additions & 9 deletions src/import/hwpf/fapi2/tools/parseErrorInfo.pl
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,7 @@
my $variable_buffer_ffdc_type = "fapi2::variable_buffer";
my $ffdc_type = "fapi2::ffdc_t";
my $mcast_type = "fapi2::mcast_t";
my $ffdc_count = 0;

# There are some names used in the XML files which exist in either
# c++ keywords (case, for example) or macros (DOMAIN). The one's which
Expand Down Expand Up @@ -310,8 +311,12 @@ sub addFfdcMethod
$method_body .= " {\n fapi2::g_FfdcData.ffdcData[$objectNumber].data= convertType(i_value);\n";
$method_body .= " fapi2::g_FfdcData.ffdcData[$objectNumber].size =";
$method_body .= " fapi2::getErrorInfoFfdcSize(i_value);\n";
$method_body .= " fapi2::g_FfdcData.ffdcLength += sizeof(sbeFfdc_t);\n";
$method_body .= " return *this;\n };\n\n";
# ffdc_count is used to determine the maximum index written in sbe buffer
if( $objectNumber > $ffdc_count)
{
$ffdc_count = $objectNumber;
}
}

}
Expand Down Expand Up @@ -377,12 +382,17 @@ sub addFfdcMethod
$method_body .= " {\n fapi2::g_FfdcData.ffdcData[$objectNumber].data= convertType(i_value);\n";
$method_body .= " fapi2::g_FfdcData.ffdcData[$objectNumber].size =";
$method_body .= " fapi2::getErrorInfoFfdcSize(i_value);\n";
$method_body .= " fapi2::g_FfdcData.ffdcLength += sizeof(sbeFfdc_t);\n";
$method_body .= " return *this;\n };\n\n";
# ffdc_count is used to determine the maximum index written in sbe buffer
if( $objectNumber > $ffdc_count)
{
$ffdc_count = $objectNumber;
}
}
}

$method .= ( $arg_empty_ffdc eq undef ) ? $method_body : " {return *this;}\n\n";
$methods->{$key}{ffdc_count} = $ffdc_count;
$methods->{$key}{method} = $method;
}

Expand Down Expand Up @@ -1430,22 +1440,23 @@ sub addFfdcMethod

# Constructor. This traces the description. If this is too much, we can
# remove it.
my $constructor = '';
if ( $arg_empty_ffdc eq undef )
{
if ( $arg_local_ffdc eq undef )
{
print ECFILE
$constructor .=
" $class_name(fapi2::errlSeverity_t i_sev = fapi2::FAPI2_ERRL_SEV_UNRECOVERABLE, fapi2::ReturnCode& i_rc = fapi2::current_err):\n";
print ECFILE " iv_rc(i_rc),\n";
print ECFILE " iv_sev(i_sev)\n";
print ECFILE " { FAPI_ERR(\"$err->{description}\"); }\n\n";
$constructor .= " iv_rc(i_rc),\n";
$constructor .= " iv_sev(i_sev)\n";
$constructor .= " { FAPI_ERR(\"$err->{description}\"); }\n\n";
}
else
{
print ECFILE " $class_name()\n";
print ECFILE
$constructor .= " $class_name()\n";
$constructor .=
" {\n fapi2::current_err = RC_$class_name;\n FAPI_ERR(\"$err->{description}\");\n";
print ECFILE " fapi2::g_FfdcData.fapiRc = RC_$class_name;\n }\n\n";
$constructor .= " fapi2::g_FfdcData.fapiRc = RC_$class_name;\n";
}
}
else
Expand All @@ -1463,11 +1474,20 @@ sub addFfdcMethod
my $method_count = 0;

# Methods
$ffdc_count = 0;
my $count = 0;
foreach my $key ( keys %methods )
{
print ECFILE $methods{$key}{method};
$method_count++;
# count number of indices written in sbe buffer
if($methods{$key}{ffdc_count} > $count)
{
$count = $methods{$key}{ffdc_count};
}
}
# Actual count is +1, as indices start from 0
$count += 1;
if ( $arg_local_ffdc eq undef )
{
# add a method to adjust the severity if desired
Expand Down Expand Up @@ -1543,11 +1563,13 @@ sub addFfdcMethod
}
else
{
$constructor .= " fapi2::g_FfdcData.ffdcLength = $count * sizeof(sbeFfdc_t);\n }\n\n";
print ECFILE " void execute()\n";
print ECFILE " {\n";
print ECFILE "$executeStr\n";
print ECFILE " }\n";
}
print ECFILE $constructor;

print ECFILE "};\n\n";

Expand Down

0 comments on commit f45f210

Please sign in to comment.