From 19ad4d6c88ec8cd5904349319145e6d40ee00174 Mon Sep 17 00:00:00 2001 From: Thi Tran Date: Fri, 21 Jun 2013 09:26:07 -0500 Subject: TULETA Bringup - Add FFDC collection for Centaur SBE fail SW209547 Change-Id: Ia40ec92f1df46252b05f489bd5a151969ce53c53 Reviewed-on: http://gfw160.austin.ibm.com:8080/gerrit/5123 Reviewed-by: Brian H. Horton Tested-by: Jenkins Server Reviewed-by: A. Patrick Williams III --- src/usr/pore/fapiporeve/fapiPoreVe.C | 28 ++++++++++++++++++++++------ src/usr/pore/poreve/porevesrc/pore.C | 19 +++++++++++++++---- src/usr/pore/poreve/porevesrc/pore.H | 15 ++++++++++++++- 3 files changed, 51 insertions(+), 11 deletions(-) (limited to 'src/usr/pore') diff --git a/src/usr/pore/fapiporeve/fapiPoreVe.C b/src/usr/pore/fapiporeve/fapiPoreVe.C index 20294d5d3..6c6c8fd4c 100644 --- a/src/usr/pore/fapiporeve/fapiPoreVe.C +++ b/src/usr/pore/fapiporeve/fapiPoreVe.C @@ -21,7 +21,7 @@ /* */ /* IBM_PROLOG_END_TAG */ // -*- mode: C++; c-file-style: "linux"; -*- -// $Id: fapiPoreVe.C,v 1.29 2012/09/05 20:11:16 jeshua Exp $ +// $Id: fapiPoreVe.C,v 1.32 2013/04/05 19:35:32 jeshua Exp $ // $Source: /afs/awd/projects/eclipz/KnowledgeBase/.cvsroot/eclipz/poreve/working/fapiporeve/fapiPoreVe.C,v $ //------------------------------------------------------------------------------ // *! (C) Copyright International Business Machines Corp. 2011 @@ -75,7 +75,6 @@ using namespace vsbe; const uint32_t MBOX_SBEVITAL_0x0005001C = 0x0005001C; - //****************************************************************************** // fapiPoreVe function //****************************************************************************** @@ -309,7 +308,8 @@ fapi::ReturnCode fapiPoreVe( FapiPoreVeHooksArg *thisArg = (FapiPoreVeHooksArg *)arg; //Load hooks (note: this must be done after poreve is created) - void *handle = dlopen( thisArg->iv_filename, RTLD_NOW); + void *handle = + HookManager::dlopen( thisArg->iv_filename, RTLD_NOW); if (handle == 0) { FAPI_ERR( "dlopen() failed; See dlerror() string below\n%s\n", @@ -635,6 +635,7 @@ fapi::ReturnCode fapiPoreVe( uint32_t & ERROR = haltcode; FAPI_SET_HWP_ERROR(rc, RC_FAPIPOREVE_HALTED_WITH_ERROR); + poreve->iv_pore.dumpOnce(); } else { @@ -664,7 +665,7 @@ fapi::ReturnCode fapiPoreVe( FAPI_ERR( "PORE is stopped due to an architected error\n"); runStatus &= ~PORE_STATUS_ERROR_HALT; FAPI_SET_HWP_ERROR(rc, RC_FAPIPOREVE_ARCHITECTED_ERROR); - poreve->iv_pore.dump(); + poreve->iv_pore.dumpOnce(); } if( runStatus & PORE_STATUS_HARDWARE_STOP ) { @@ -686,7 +687,7 @@ fapi::ReturnCode fapiPoreVe( FAPI_ERR( "PORE is stopped due to a modeling error\n"); runStatus &= ~PORE_STATUS_MODEL_ERROR; FAPI_SET_HWP_ERROR(rc, RC_FAPIPOREVE_MODELING_ERROR); - poreve->iv_pore.dump(); + poreve->iv_pore.dumpOnce(); } if( runStatus & PORE_STATUS_DEBUG_STOP ) { @@ -823,10 +824,14 @@ fapi::ReturnCode fapiPoreVe( } //if extract state //---------------------------------------------------------------------- - // Destroy PoreVe + // Destroy PoreVe and HookManager //---------------------------------------------------------------------- delete poreve; +#ifndef __HOSTBOOT_MODULE + HookManager::destroy(); +#endif + return rc; } //end function @@ -840,6 +845,17 @@ This section is automatically updated by CVS when you check in this file. Be sure to create CVS comments when you commit so that they are included here. $Log: fapiPoreVe.C,v $ +Revision 1.32 2013/04/05 19:35:32 jeshua +Use dumpOnce() instead of trying to track it ourselves + +Revision 1.31 2013/03/27 19:02:48 jeshua +Dump SBE state when SBE executed an unexpected halt instruction + +Revision 1.30 2013/02/05 16:14:29 bcbrock +Added the HookManager::dlopen() and ::destroy() APIs to allow the HookManager +to be deleted and all hook DLLs to be unloaded. This suports the case that +both P8 and Centaur runs of PoreVe need to be made in the same process. + Revision 1.29 2012/09/05 20:11:16 jeshua More robust return code handling Cosmetic updates for things like line length diff --git a/src/usr/pore/poreve/porevesrc/pore.C b/src/usr/pore/poreve/porevesrc/pore.C index f9e0605b6..703645fbf 100644 --- a/src/usr/pore/poreve/porevesrc/pore.C +++ b/src/usr/pore/poreve/porevesrc/pore.C @@ -20,7 +20,7 @@ /* Origin: 30 */ /* */ /* IBM_PROLOG_END_TAG */ -// $Id: pore.C,v 1.17 2013/01/07 16:35:18 bcbrock Exp $ +// $Id: pore.C,v 1.18 2013/04/05 19:34:28 jeshua Exp $ /// \file pore.C /// \brief The implementation of the PoreInterface for the PoreVe environment @@ -249,7 +249,8 @@ Pore::operation(Transaction& io_transaction) Pore::Pore(PoreIbufId i_id) : PoreInterface(i_id), iv_pib(0), - iv_oci(0) + iv_oci(0), + iv_dumpDone(false) { } @@ -269,6 +270,7 @@ Pore::configure(fapi::Target* i_target, Bus* i_pib, Bus* i_oci, iv_target = i_target; iv_pib = i_pib; iv_oci = i_oci; + iv_dumpDone = false; PibSlave::configure(i_target, i_dataBuffer, i_base, i_size, i_permissions); } @@ -300,6 +302,7 @@ Pore::dump() extractState(state); FAPI_ERR(SEPARATOR); + FAPI_ERR("Target %s", iv_target->toEcmdString()); FAPI_ERR("PORE dump after %llu instructions.", getInstructions()); FAPI_ERR(SEPARATOR); @@ -350,9 +353,17 @@ Pore::dump() FAPI_ERR(SEPARATOR); #undef SEPARATOR + iv_dumpDone = true; } - - +// Calls the dump() routine if iv_dumpDone is false + +void +Pore::dumpOnce() +{ + if (!iv_dumpDone) { + dump(); + } +} diff --git a/src/usr/pore/poreve/porevesrc/pore.H b/src/usr/pore/poreve/porevesrc/pore.H index 804974fea..3668f23bb 100644 --- a/src/usr/pore/poreve/porevesrc/pore.H +++ b/src/usr/pore/poreve/porevesrc/pore.H @@ -23,7 +23,7 @@ #ifndef __VSBE_PORE_H #define __VSBE_PORE_H -// $Id: pore.H,v 1.16 2013/01/07 16:35:18 bcbrock Exp $ +// $Id: pore.H,v 1.17 2013/04/05 19:33:28 jeshua Exp $ /// \file pore.H /// \brief The implementation of the PoreInterface for the PoreVe environment @@ -231,6 +231,13 @@ public: void dump(); + /// Call dump() if it hasn't been called yet + /// + /// If iv_dumpDone is false, then dump() will be called. Otherwise it + /// will just return without doing anything. + void + dumpOnce(); + ////////////////////////// Implementation //////////////////////////// @@ -255,6 +262,12 @@ protected: /// routines. fapi::Target* iv_target; + /// Keeps track of whether or not a dump has been printed + /// + /// This will be set to true on the first dump so that subsequent dumps + /// could be skipped + bool iv_dumpDone; + ///////////////////////////// Safety ////////////////////////////////// -- cgit v1.2.1