Skip to content

Commit

Permalink
PRD: Memory leak in prdfScanFacility
Browse files Browse the repository at this point in the history
Change-Id: Iefadbeb4da9bae79d2595c78f02f1e9403f07769
CQ: SW417545
Reviewed-on: http://ralgit01.raleigh.ibm.com/gerrit1/54207
Tested-by: Jenkins Server <pfd-jenkins+hostboot@us.ibm.com>
Reviewed-by: Caleb N. Palmer <cnpalmer@us.ibm.com>
Reviewed-by: Brian J. Stegmiller <bjs@us.ibm.com>
Reviewed-by: Benjamin J. Weisenbeck <bweisenb@us.ibm.com>
Reviewed-by: Zane C. Shelley <zshelle@us.ibm.com>
Reviewed-on: http://ralgit01.raleigh.ibm.com/gerrit1/54310
Tested-by: Jenkins OP Build CI <op-jenkins+hostboot@us.ibm.com>
Tested-by: Jenkins OP HW <op-hw-jenkins+hostboot@us.ibm.com>
Tested-by: FSP CI Jenkins <fsp-CI-jenkins+hostboot@us.ibm.com>
  • Loading branch information
zane131 committed Feb 17, 2018
1 parent 18a7e19 commit 5b1c0a8
Show file tree
Hide file tree
Showing 4 changed files with 39 additions and 7 deletions.
27 changes: 25 additions & 2 deletions src/usr/diag/prdf/common/framework/register/prdfScanFacility.C
Expand Up @@ -5,7 +5,7 @@
/* */
/* OpenPOWER HostBoot Project */
/* */
/* Contributors Listed Below - COPYRIGHT 2012,2017 */
/* Contributors Listed Below - COPYRIGHT 2012,2018 */
/* [+] International Business Machines Corp. */
/* */
/* */
Expand Down Expand Up @@ -189,6 +189,22 @@ void ScanFacility::ResetPluginRegister()

}

//-----------------------------------------------------------------------------

void ScanFacility::reset()
{
iv_scomRegFw.clear();
iv_attnRegFw.clear();
iv_andRegFw.clear();
iv_orRegFw.clear();
iv_notRegFw.clear();
iv_leftRegFw.clear();
iv_sumRegFw.clear();
iv_rightRegFw.clear();
iv_constRegFw.clear();
iv_pluginRegFw.clear();
}

//------------------------------------------------------------------------------
#ifdef FLYWEIGHT_PROFILING
void ScanFacility::printStats()
Expand All @@ -205,7 +221,14 @@ void ScanFacility::printStats()
iv_andRegFw.printStats();
PRDF_TRAC("Or Register");
iv_orRegFw.printStats();

PRDF_TRAC("AttnTypeRegisters FW" );
iv_attnRegFw.printStats();
PRDF_TRAC("SummaryRegisters FW" );
iv_sumRegFw.printStats();
PRDF_TRAC("ConstantRegisters FW" );
iv_constRegFw.printStats();
PRDF_TRAC("PluginRegisters FW" );
iv_pluginRegFw.printStats();
}

#endif
Expand Down
10 changes: 9 additions & 1 deletion src/usr/diag/prdf/common/framework/register/prdfScanFacility.H
Expand Up @@ -5,7 +5,7 @@
/* */
/* OpenPOWER HostBoot Project */
/* */
/* Contributors Listed Below - COPYRIGHT 2012,2017 */
/* Contributors Listed Below - COPYRIGHT 2012,2018 */
/* [+] International Business Machines Corp. */
/* */
/* */
Expand Down Expand Up @@ -172,6 +172,14 @@ public:
* exist.
*/
void ResetPluginRegister();

/**
* @brief Intended to reset all the flyweights if PRD is uninitialized due to
* a reIPL, reset/reload, or failover. This free up the memory and
* avoids memory leaks in the flyweights.
*/
void reset();

#ifdef FLYWEIGHT_PROFILING
/**
* @brief prints memory allocated for object residing on flyweight
Expand Down
Expand Up @@ -5,7 +5,7 @@
/* */
/* OpenPOWER HostBoot Project */
/* */
/* Contributors Listed Below - COPYRIGHT 2012,2015 */
/* Contributors Listed Below - COPYRIGHT 2012,2018 */
/* [+] International Business Machines Corp. */
/* */
/* */
Expand Down Expand Up @@ -307,8 +307,6 @@ void ResolutionFactory::printStats()
iv_flagResolutionFW.printStats( );
PRDF_TRAC("dumpResolution");
iv_dumpResolutionFW.printStats( );
PRDF_TRAC("gardResolution");
iv_gardResolutionFW.printStats( );
PRDF_TRAC("captureResolution");
iv_captureResolutionFW.printStats( );
PRDF_TRAC("clockResolution");
Expand Down
5 changes: 4 additions & 1 deletion src/usr/diag/prdf/common/prdfMain_common.C
Expand Up @@ -5,7 +5,7 @@
/* */
/* OpenPOWER HostBoot Project */
/* */
/* Contributors Listed Below - COPYRIGHT 2013,2017 */
/* Contributors Listed Below - COPYRIGHT 2013,2018 */
/* [+] International Business Machines Corp. */
/* */
/* */
Expand Down Expand Up @@ -84,6 +84,9 @@ void unInitialize()
delete systemPtr;
systemPtr = NULL;
g_initialized = false;

ScanFacility::Access().reset();

// Some Resolutions carry state and must be re-created - this call resets
// what it needs to.
ResolutionFactory::Access().Reset();
Expand Down

0 comments on commit 5b1c0a8

Please sign in to comment.