From c72b5d677c90ff1e3b17df2ad16f7d5377bc20ca Mon Sep 17 00:00:00 2001 From: Elliott Dahle Date: Mon, 17 Jun 2013 12:10:59 -0500 Subject: Modify Hostboot error logging code to change UD section order. Hostboot error logging code was modified to flatten the user-defined sections in a specific order, where hardware callouts are always first, and traces always last. Change-Id: Ie282869950790a1a8404095ac5e4b6a751a8383c RTC: 45890 Reviewed-on: http://gfw160.austin.ibm.com:8080/gerrit/5048 Tested-by: Jenkins Server Reviewed-by: Brian H. Horton Reviewed-by: MIKE J. JONES Reviewed-by: A. Patrick Williams III --- src/usr/errl/errlentry.C | 84 +++++++++++++++++++++++++++++++++++++++++++----- 1 file changed, 76 insertions(+), 8 deletions(-) (limited to 'src') diff --git a/src/usr/errl/errlentry.C b/src/usr/errl/errlentry.C index ed6986545..d74175446 100644 --- a/src/usr/errl/errlentry.C +++ b/src/usr/errl/errlentry.C @@ -788,20 +788,88 @@ uint64_t ErrlEntry::flatten( void * o_pBuffer, uint64_t i_bufsize ) // flatten the optional user-defined sections + // Flattens in the following order: 1. Hardware Callouts + // 2. Other UD sections (non-trace) + // 3. Traces + // When the user-defined sections exceed 16kB, FSP ERRL discards + // any remaining user-defined sections. Therefore this order + // preserves the callouts, and then gives priority to other + // non-trace sections. std::vector::iterator it; for(it = iv_SectionVector.begin(); it != iv_SectionVector.end(); it++) { - l_cb = (*it)->flatten( pBuffer, i_bufsize ); - if( 0 == l_cb ) + // If UD section is a hardware callout. + if( (ERRL_COMP_ID == (*it)->iv_header.iv_compId) && + (ERRL_UDT_CALLOUT == (*it)->iv_header.iv_sst) ) { - // Rare. - TRACFCOMP( g_trac_errl, ERR_MRK"ud.flatten error"); - l_flatCount = 0; - break; + l_cb = (*it)->flatten( pBuffer, i_bufsize ); + if( 0 == l_cb ) + { + // Rare. + TRACFCOMP( g_trac_errl, ERR_MRK"ud.flatten error"); + l_flatCount = 0; + break; + } + pBuffer += l_cb; + i_bufsize -= l_cb; } - pBuffer += l_cb; - i_bufsize -= l_cb; } + + if( 0 == l_flatCount ) + { + break; + } + + for(it = iv_SectionVector.begin(); it != iv_SectionVector.end(); it++) + { + // If UD section is not a hardware callout and not a trace. + if( !(((ERRL_COMP_ID == (*it)->iv_header.iv_compId) && + (ERRL_UDT_CALLOUT == (*it)->iv_header.iv_sst)) || + ((FIPS_ERRL_COMP_ID == (*it)->iv_header.iv_compId) && + (FIPS_ERRL_UDT_TRACE == (*it)->iv_header.iv_sst))) ) + { + l_cb = (*it)->flatten( pBuffer, i_bufsize ); + if( 0 == l_cb ) + { + // Rare. + TRACFCOMP( g_trac_errl, ERR_MRK"ud.flatten error"); + l_flatCount = 0; + break; + } + pBuffer += l_cb; + i_bufsize -= l_cb; + } + } + + if( 0 == l_flatCount ) + { + break; + } + + for(it = iv_SectionVector.begin(); it != iv_SectionVector.end(); it++) + { + // If UD section is a trace. + if( (FIPS_ERRL_COMP_ID == (*it)->iv_header.iv_compId) && + (FIPS_ERRL_UDT_TRACE == (*it)->iv_header.iv_sst) ) + { + l_cb = (*it)->flatten( pBuffer, i_bufsize ); + if( 0 == l_cb ) + { + // Rare. + TRACFCOMP( g_trac_errl, ERR_MRK"ud.flatten error"); + l_flatCount = 0; + break; + } + pBuffer += l_cb; + i_bufsize -= l_cb; + } + } + + if( 0 == l_flatCount ) + { + break; + } + } while( 0 ); -- cgit v1.2.1