diff options
author | Bilicon Patil <bilpatil@in.ibm.com> | 2014-12-08 03:07:13 -0600 |
---|---|---|
committer | A. Patrick Williams III <iawillia@us.ibm.com> | 2015-02-27 23:22:19 -0600 |
commit | fca9a43c5dc3fa58105141949e5ef4108862b0f0 (patch) | |
tree | ba60d5f58be8edc9faf10ea19d608dfd3f8fb127 | |
parent | 6c9eac071a9a79921c4b360af53e023dad19666f (diff) | |
download | talos-hostboot-fca9a43c5dc3fa58105141949e5ef4108862b0f0.tar.gz talos-hostboot-fca9a43c5dc3fa58105141949e5ef4108862b0f0.zip |
PRD: Remove thresholds from prdfMfgThresholds.lst
This change is part of a broader change to move PRD Mfg thresholds
from being maintained in a file to being maintained as system attributes.
Here, we remove the file that maintains the thresholds and update
the perl script that processed the threshold file
Change-Id: I343f0e69b3f1d583a2c0b838b58db3e3935874ac
RTC: 118150
CMVC-Prereq: 945073
Reviewed-on: http://gfw160.aus.stglabs.ibm.com:8080/gerrit/14774
Reviewed-by: Zane Shelley <zshelle@us.ibm.com>
Tested-by: Jenkins Server
Reviewed-on: http://gfw160.aus.stglabs.ibm.com:8080/gerrit/15874
Reviewed-by: Sachin Gupta <sgupta2m@in.ibm.com>
Reviewed-by: A. Patrick Williams III <iawillia@us.ibm.com>
23 files changed, 189 insertions, 599 deletions
diff --git a/src/usr/diag/prdf/common/framework/rule/prdrCompile.C b/src/usr/diag/prdf/common/framework/rule/prdrCompile.C index 47d4758e2..1aa356f19 100755 --- a/src/usr/diag/prdf/common/framework/rule/prdrCompile.C +++ b/src/usr/diag/prdf/common/framework/rule/prdrCompile.C @@ -504,9 +504,9 @@ uint32_t prdrActionArgMap(const std::string & i_arg) // Initialize MFG thresholds. #define PRDF_MFGTHRESHOLD_TABLE_BEGIN #define PRDF_MFGTHRESHOLD_TABLE_END - #define PRDF_MFGTHRESHOLD_ENTRY(a,b,c) \ + #define PRDF_MFGTHRESHOLD_ENTRY(a,b) \ g_ActionArgMap[#a] = b; - #include <prdfMfgThresholds.H> + #include <prdfMfgThresholdAttrs.H> l_initialized = true; diff --git a/src/usr/diag/prdf/common/mnfgtools/prdfMfgThresholdFile_common.C b/src/usr/diag/prdf/common/mnfgtools/prdfMfgThreshold.C index c60c4037b..fa250b278 100755 --- a/src/usr/diag/prdf/common/mnfgtools/prdfMfgThresholdFile_common.C +++ b/src/usr/diag/prdf/common/mnfgtools/prdfMfgThreshold.C @@ -1,11 +1,13 @@ /* IBM_PROLOG_BEGIN_TAG */ /* This is an automatically generated prolog. */ /* */ -/* $Source: src/usr/diag/prdf/common/mnfgtools/prdfMfgThresholdFile_common.C $ */ +/* $Source: src/usr/diag/prdf/common/mnfgtools/prdfMfgThreshold.C $ */ /* */ /* OpenPOWER HostBoot Project */ /* */ -/* COPYRIGHT International Business Machines Corp. 2013,2014 */ +/* Contributors Listed Below - COPYRIGHT 2014,2015 */ +/* [+] International Business Machines Corp. */ +/* */ /* */ /* Licensed under the Apache License, Version 2.0 (the "License"); */ /* you may not use this file except in compliance with the License. */ @@ -21,26 +23,17 @@ /* */ /* IBM_PROLOG_END_TAG */ -#include <prdfMfgThresholdFile_common.H> - -#ifdef NO_FSP - // Can't use PRD implementation of - // assert() in standalone tool code. - #include <assert.h> - #define PRDF_ASSERT(x) assert(x) - #define PRDF_ENTER(args...) // no-op in tool compilation - #define PRDF_EXIT(args...) // no-op in tool compilation - #define PRDF_TRAC(args...) // no-op in tool compilation -#else - #include <prdfAssert.h> - #include <prdfTrace.H> -#endif - +#include <prdfMfgThreshold.H> +#include <prdfAssert.h> +#include <prdfTrace.H> +#include <prdfTargetServices.H> namespace PRDF { -uint8_t MfgThresholdFileCommon::getThreshold(uint32_t i_thrName) +using namespace TARGETING; + +uint8_t MfgThreshold::getThreshold(uint32_t i_thrName) { if (iv_thresholds.end() == iv_thresholds.find(i_thrName)) return INFINITE_LIMIT_THR; @@ -48,44 +41,53 @@ uint8_t MfgThresholdFileCommon::getThreshold(uint32_t i_thrName) return iv_thresholds[i_thrName]; } -void MfgThresholdFileCommon::setThreshold(uint32_t i_thrName, uint8_t i_value) +void MfgThreshold::setThreshold(uint32_t i_thrName, uint8_t i_value) { iv_thresholds[i_thrName] = i_value; } -void MfgThresholdFileCommon::clearThresholds() +void MfgThreshold::clearThresholds() { iv_thresholds.clear(); } -void MfgThresholdFileCommon::unpackThresholdDataFromBuffer( - uint8_t* & i_buffer, - uint32_t i_sizeOfBuf) +void MfgThreshold::setup() { - #define FUNC "[MfgThresholdFileCommon::unpackThresholdDataFromBuffer]" - PRDF_ENTER(FUNC" number of entries: %d", - i_sizeOfBuf / sizeof(SyncThreshold_t)); - - PRDF_ASSERT(NULL != i_buffer); - - uint32_t l_entryNum = i_sizeOfBuf / sizeof(SyncThreshold_t); - - SyncThreshold_t* l_ptr = reinterpret_cast<SyncThreshold_t*>(i_buffer); - - uint32_t hash = 0; - uint8_t value = 0; - - for(uint32_t i = 0; i < l_entryNum && l_ptr != NULL; ++i, l_ptr++) + #define PRDF_FUNC "[MfgThreshold::setup] " + do { - hash = ntohl(l_ptr->hash); - value = l_ptr->value; - PRDF_TRAC("threshold: %d, count: %d", hash, value); - iv_thresholds[hash] = value; - } - - PRDF_EXIT(FUNC); - #undef FUNC + // Get top level target + TargetHandle_t l_sysTarget = NULL; + l_sysTarget = PlatServices::getSystemTarget(); + if(NULL == l_sysTarget) + { + PRDF_ERR(PRDF_FUNC"No System target!"); + break; + } + + // Set the thresholds + #ifdef __PRDF_PRDFMFGTHRESHOLDS_H + #undef __PRDF_PRDFMFGTHRESHOLDS_H + #endif + + #ifdef PRDF_MFGTHRESHOLD_ENTRY + #undef PRDF_MFGTHRESHOLD_TABLE_BEGIN + #undef PRDF_MFGTHRESHOLD_TABLE_END + #undef PRDF_MFGTHRESHOLD_ENTRY + #endif + + #define PRDF_MFGTHRESHOLD_TABLE_BEGIN + #define PRDF_MFGTHRESHOLD_TABLE_END + #define PRDF_MFGTHRESHOLD_ENTRY(a,b) \ + { \ + uint8_t l_threshold = l_sysTarget->getAttr<a>(); \ + this->setThreshold(a, l_threshold); \ + } + #include <prdfMfgThresholdAttrs.H> + + }while(0); + + #undef PRDF_FUNC } - } // end namespace PRDF diff --git a/src/usr/diag/prdf/mnfgtools/prdfMfgThresholdFile.C b/src/usr/diag/prdf/common/mnfgtools/prdfMfgThreshold.H index bff4152e7..849a8a5d6 100755 --- a/src/usr/diag/prdf/mnfgtools/prdfMfgThresholdFile.C +++ b/src/usr/diag/prdf/common/mnfgtools/prdfMfgThreshold.H @@ -1,11 +1,11 @@ /* IBM_PROLOG_BEGIN_TAG */ /* This is an automatically generated prolog. */ /* */ -/* $Source: src/usr/diag/prdf/mnfgtools/prdfMfgThresholdFile.C $ */ +/* $Source: usr/diag/prdf/common/mnfgtools/prdfMfgThreshold.H $ */ /* */ /* OpenPOWER HostBoot Project */ /* */ -/* Contributors Listed Below - COPYRIGHT 2013,2015 */ +/* Contributors Listed Below - COPYRIGHT 2014,2015 */ /* [+] International Business Machines Corp. */ /* */ /* */ @@ -23,43 +23,71 @@ /* */ /* IBM_PROLOG_END_TAG */ -#include <prdfMfgThresholdFile.H> -#include <prdfGlobal.H> -#include <prdfAssert.h> -#include <prdfMfgSync.H> -#include <prdfErrlUtil.H> -#include <prdfPlatServices.H> -#include <prdfTrace.H> +#ifndef __PRDFMFGTHRESHOLD_H +#define __PRDFMFGTHRESHOLD_H + +#include <stdint.h> +#include <map> namespace PRDF { -void MfgThresholdFile::setup() +class MfgThreshold { - syncFromFsp(); -} + public: -void MfgThresholdFile::syncFromFsp() -{ - #define FUNC "[MfgThresholdFile::syncFromFsp]" - PRDF_ENTER(FUNC); + /** + * @brief threshold map + */ + typedef std::map<uint32_t, uint8_t> Threshold_t; - PRDF_TRAC(FUNC" Threshold sync no longer supported"); + /** + * @brief Infinite threshold enum + */ + enum { INFINITE_LIMIT_THR = 0xff }; - PRDF_EXIT(FUNC); - #undef FUNC -} + /** + * @brief constructor + */ + MfgThreshold() {}; -void MfgThresholdFile::packThresholdDataIntoBuffer( - uint8_t* & o_buffer, - uint32_t i_sizeOfBuf) -{ - #define FUNC "[MfgThresholdFile::packThresholdDataIntoBuffer]" + /** + * @brief destructor + */ + ~MfgThreshold() {}; + + /** + * @brief setup the thresholds + */ + void setup(); - PRDF_ERR(FUNC" not used in hostboot"); + /** + * @brief get threshold value from name + * @param[in] i_thrName - threshold name + * + * @return corresponding threshold value + */ + uint8_t getThreshold(uint32_t i_thrName); - #undef FUNC -} + /** + * @brief set threshold name/value + * @param[in] i_thrName - threshold name + * @param[in] i_value - threshold value + */ + void setThreshold(uint32_t i_thrName, uint8_t i_value); + /** + * @brief clear all thresholds + * + */ + void clearThresholds(); + + protected: + + Threshold_t iv_thresholds; + +}; } // end namespace PRDF + +#endif diff --git a/src/usr/diag/prdf/common/mnfgtools/prdfMfgThresholds.pl b/src/usr/diag/prdf/common/mnfgtools/prdfMfgThresholdAttrs.pl index 2d65620a6..6231a541f 100755 --- a/src/usr/diag/prdf/common/mnfgtools/prdfMfgThresholds.pl +++ b/src/usr/diag/prdf/common/mnfgtools/prdfMfgThresholdAttrs.pl @@ -2,11 +2,13 @@ # IBM_PROLOG_BEGIN_TAG # This is an automatically generated prolog. # -# $Source: src/usr/diag/prdf/common/mnfgtools/prdfMfgThresholds.pl $ +# $Source: src/usr/diag/prdf/common/mnfgtools/prdfMfgThresholdAttrs.pl $ # # OpenPOWER HostBoot Project # -# COPYRIGHT International Business Machines Corp. 2009,2014 +# Contributors Listed Below - COPYRIGHT 2014,2015 +# [+] International Business Machines Corp. +# # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -24,42 +26,26 @@ use strict; -sub adler32_sum -{ - my $a = 1; - my $b = 0; - foreach (split //, shift) - { - $a = $a + ord($_); - $b = $a + $b; - - $a = $a % 65521; - $b = $b % 65521; - } - - return (($b << 16) | $a) & 0x7FFFFFFF; -} - if (0 != $#ARGV) { - print "prdfMfgThresholds.pl <threshold list>\n"; + print "prdfMfgThresholdAttrs.pl <threshold list>\n"; exit; } -if (not -e $ARGV[0]) +unless (-e $ARGV[0]) { die "Couldn't find ".$ARGV[0]; } -print "#ifndef __PRDF_PRDFMFGTHRESHOLDS_H\n"; -print "#define __PRDF_PRDFMFGTHRESHOLDS_H\n"; +print "#ifndef __PRDF_PRDFMFGTHRESHOLDATTRS_H\n"; +print "#define __PRDF_PRDFMFGTHRESHOLDATTRS_H\n"; print "#ifndef PRDF_MFGTHRESHOLD_ENTRY\n"; print "#define PRDF_MFGTHRESHOLD_TABLE_BEGIN \\\n"; -print "\tenum PrdfMfgThresholds {\n"; +print "\tenum PrdfMfgThresholdAttrs {\n"; print "#define PRDF_MFGTHRESHOLD_TABLE_END \\\n"; print "\t};\n"; -print "#define PRDF_MFGTHRESHOLD_ENTRY(a,b,c) \\\n"; -print "\tPRDF_##a = b,\n"; +print "#define PRDF_MFGTHRESHOLD_ENTRY(a,b) \\\n"; +print "\ta = b,\n"; print "#endif\n"; print "\n"; print "PRDF_MFGTHRESHOLD_TABLE_BEGIN\n"; @@ -74,12 +60,21 @@ while (my $line = <THRESHOLDS>) { next; } - my ($name, $value) = split ' ',$line; - $value =~ s/unlimited/0/i; - my $hash_value = adler32_sum($name); + if (($line !~ "ATTR_MNFG_TH_") and ($line !~ "ATTR_FIELD_TH_")) + { + next; + } + + # Remove the blank spaces + $line =~ s/ //g; + + # Remove the token "," + $line =~ s/,//g; + + my ($name, $value) = split '=',$line; - print "\tPRDF_MFGTHRESHOLD_ENTRY($name, $hash_value, $value)\n"; + print "\tPRDF_MFGTHRESHOLD_ENTRY($name, $value)\n"; } close(THRESHOLDS); diff --git a/src/usr/diag/prdf/common/mnfgtools/prdfMfgThresholdFile_common.H b/src/usr/diag/prdf/common/mnfgtools/prdfMfgThresholdFile_common.H deleted file mode 100755 index 6d012d6ff..000000000 --- a/src/usr/diag/prdf/common/mnfgtools/prdfMfgThresholdFile_common.H +++ /dev/null @@ -1,152 +0,0 @@ -/* IBM_PROLOG_BEGIN_TAG */ -/* This is an automatically generated prolog. */ -/* */ -/* $Source: src/usr/diag/prdf/common/mnfgtools/prdfMfgThresholdFile_common.H $ */ -/* */ -/* OpenPOWER HostBoot Project */ -/* */ -/* COPYRIGHT International Business Machines Corp. 2013,2014 */ -/* */ -/* Licensed under the Apache License, Version 2.0 (the "License"); */ -/* you may not use this file except in compliance with the License. */ -/* You may obtain a copy of the License at */ -/* */ -/* http://www.apache.org/licenses/LICENSE-2.0 */ -/* */ -/* Unless required by applicable law or agreed to in writing, software */ -/* distributed under the License is distributed on an "AS IS" BASIS, */ -/* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or */ -/* implied. See the License for the specific language governing */ -/* permissions and limitations under the License. */ -/* */ -/* IBM_PROLOG_END_TAG */ - -#ifndef __PRDFMFGTHRESHOLDFILECOMMON -#define __PRDFMFGTHRESHOLDFILECOMMON - -#include <stdint.h> -#include <map> - -#ifdef __HOSTBOOT_MODULE - - // FIXME: RTC 73204 was opened to add support for these in hostboot. They will - // need to be removed once the issue has been resolved. - #ifndef htonl - #define htonl(foo) (foo) - #endif - - #ifndef ntohl - #define ntohl(foo) (foo) - #endif - -#else - - #include <netinet/in.h> - -#endif - - -namespace PRDF -{ - -class MfgThresholdFileCommon -{ - public: - - /** - * @brief Structure of threshold to sync - */ - struct SyncThreshold_t - { - uint32_t hash; - uint8_t value; - SyncThreshold_t() - { - hash = 0; - value = 0; - } - }__attribute__ ((packed)); - - /** - * @brief threshold map - */ - typedef std::map<uint32_t, uint8_t> Threshold_t; - - /** - * @brief Infinite threshold enum - */ - enum { INFINITE_LIMIT_THR = 0xff }; - - /** - * @brief constructor - */ - MfgThresholdFileCommon() {}; - - /** - * @brief destructor - */ - virtual ~MfgThresholdFileCommon() {}; - - /** - * @brief configure MfgThresholdFile - */ - virtual void setup() = 0; - - /** - * @brief get threshold value from name - * @param[in] i_thrName - threshold name - * - * @return corresponding threshold value - */ - uint8_t getThreshold(uint32_t i_thrName); - - /** - * @brief set threshold name/value - * @param[in] i_thrName - threshold name - * @param[in] i_value - threshold value - */ - void setThreshold(uint32_t i_thrName, uint8_t i_value); - - /** - * @brief clear all thresholds - * - */ - void clearThresholds(); - - /** - * @brief get number of thresholds - * - * @return number of predefined thresholds - */ - inline uint32_t getThresholdSize() - { - return iv_thresholds.size() * sizeof(SyncThreshold_t); - } - - /** - * @brief serialize threshold data into data buffer - * @param[in/out] o_buffer - data buffer - * @param[in] i_sizeOfBuf - size of buffer - */ - virtual void packThresholdDataIntoBuffer( - uint8_t* & o_buffer, - uint32_t i_sizeOfBuf) = 0; - - /** - * @brief deserialize data buffer into threshold data - * @param[in/out] o_buffer - data buffer - * @param[in] i_sizeOfBuf - size of buffer - */ - virtual void unpackThresholdDataFromBuffer( - uint8_t* & o_buffer, - uint32_t i_sizeOfBuf); - - protected: - - Threshold_t iv_thresholds; - -}; - -} // end namespace PRDF - -#endif diff --git a/src/usr/diag/prdf/common/mnfgtools/prdfMfgThresholdMgr.C b/src/usr/diag/prdf/common/mnfgtools/prdfMfgThresholdMgr.C index e7c047314..a5be8e190 100755 --- a/src/usr/diag/prdf/common/mnfgtools/prdfMfgThresholdMgr.C +++ b/src/usr/diag/prdf/common/mnfgtools/prdfMfgThresholdMgr.C @@ -5,7 +5,7 @@ /* */ /* OpenPOWER HostBoot Project */ /* */ -/* Contributors Listed Below - COPYRIGHT 2013,2014 */ +/* Contributors Listed Below - COPYRIGHT 2013,2015 */ /* [+] International Business Machines Corp. */ /* */ /* */ @@ -30,19 +30,14 @@ namespace PRDF { MfgThresholdMgr::MfgThresholdMgr() : - iv_file(NULL) + iv_mfgThres(NULL) { } - MfgThresholdMgr::~MfgThresholdMgr() { - if(NULL != iv_file) - { - delete iv_file; - iv_file = NULL; - } + reset(); } MfgThresholdMgr * MfgThresholdMgr::getInstance() @@ -53,14 +48,12 @@ MfgThresholdMgr * MfgThresholdMgr::getInstance() uint8_t MfgThresholdMgr::getThreshold(uint32_t i_thrName) { - this->setupFile(); + this->setupThresholds(); - uint8_t l_thr = iv_file->getThreshold(i_thrName); + uint8_t l_thr = iv_mfgThres->getThreshold(i_thrName); - if ((MfgThresholdFileCommon::INFINITE_LIMIT_THR) <= l_thr) - return getThresholdDefault(i_thrName); - else if (0 == l_thr) // zero is the "infinite" threshold. - return (MfgThresholdFileCommon::INFINITE_LIMIT_THR); + if (0 == l_thr) // zero is the "infinite" threshold. + return (MfgThreshold::INFINITE_LIMIT_THR); else return l_thr; } @@ -71,7 +64,7 @@ ThresholdResolution::ThresholdPolicy* uint8_t threshold = getThreshold(i_thrName); uint32_t interval = ThresholdResolution::NONE; - if( (MfgThresholdFileCommon::INFINITE_LIMIT_THR) <= threshold ) + if( (MfgThreshold::INFINITE_LIMIT_THR) <= threshold ) { PRDF_TRAC("MfgThresholdMgr::getThresholdP: " "infinite threshold: 0x%x", i_thrName); @@ -87,46 +80,25 @@ void MfgThresholdMgr::reset() { iv_thrs.clear(); - if(NULL != iv_file) + if(NULL != iv_mfgThres) { - delete iv_file; - iv_file = NULL; + delete iv_mfgThres; + iv_mfgThres = NULL; } } -MfgThresholdFile * MfgThresholdMgr::getMfgThresholdFile() +MfgThreshold * MfgThresholdMgr::getMfgThreshold() { - setupFile(); - return iv_file; -} - -uint8_t MfgThresholdMgr::getThresholdDefault(uint32_t i_thrName) -{ - uint8_t l_value = 0; - -#define PRDF_MFGTHRESHOLD_TABLE_BEGIN if -#define PRDF_MFGTHRESHOLD_TABLE_END \ - (true) l_value = (MfgThresholdFileCommon::INFINITE_LIMIT_THR); -#define PRDF_MFGTHRESHOLD_ENTRY(a,b,c) \ - (i_thrName == b) { l_value = c; } else if -#include <prdfMfgThresholds.H> - - // zero is a special "infinite limit" value. - if (0 == l_value) - l_value = (MfgThresholdFileCommon::INFINITE_LIMIT_THR); - - return l_value; + setupThresholds(); + return iv_mfgThres; } -void MfgThresholdMgr::setupFile() +void MfgThresholdMgr::setupThresholds() { - if(NULL == iv_file) + if(NULL == iv_mfgThres) { -// TODO: RTC 118150 Will be refactored. -#ifndef __HOSTBOOT_RUNTIME - iv_file = new MfgThresholdFile(); - iv_file->setup(); -#endif + iv_mfgThres = new MfgThreshold(); + iv_mfgThres->setup(); } } diff --git a/src/usr/diag/prdf/common/mnfgtools/prdfMfgThresholdMgr.H b/src/usr/diag/prdf/common/mnfgtools/prdfMfgThresholdMgr.H index 53549b52f..59c30bb0c 100755 --- a/src/usr/diag/prdf/common/mnfgtools/prdfMfgThresholdMgr.H +++ b/src/usr/diag/prdf/common/mnfgtools/prdfMfgThresholdMgr.H @@ -5,7 +5,9 @@ /* */ /* OpenPOWER HostBoot Project */ /* */ -/* COPYRIGHT International Business Machines Corp. 2009,2014 */ +/* Contributors Listed Below - COPYRIGHT 2013,2015 */ +/* [+] International Business Machines Corp. */ +/* */ /* */ /* Licensed under the Apache License, Version 2.0 (the "License"); */ /* you may not use this file except in compliance with the License. */ @@ -25,7 +27,7 @@ #define __PRDF_PRDFMFGTHRESHOLDMGR_H #include <stdint.h> -#include <prdfMfgThresholdFile.H> +#include <prdfMfgThreshold.H> #include <prdfThresholdResolutions.H> #include <prdfFlyWeight.H> @@ -44,7 +46,7 @@ class MfgThresholdMgr /** * @brief destructor */ - virtual ~MfgThresholdMgr(); + ~MfgThresholdMgr(); /** * @brief get MfgThresholdMgr singleton @@ -75,30 +77,22 @@ class MfgThresholdMgr void reset(); /** - * @brief get MfgThresholdFile + * @brief get MfgThreshold * - * @return MfgThresholdFile pointer + * @return MfgThreshold pointer */ - MfgThresholdFile * getMfgThresholdFile(); + MfgThreshold* getMfgThreshold(); private: /** - * @brief get default threshold value from name - * @param[in] i_thrName - threshold name - * - * @return corresponding threshold value - */ - uint8_t getThresholdDefault(uint32_t i_thrName); - - /** - * @brief set up MfgThresholdFile + * @brief set up MfgThreshold */ - virtual void setupFile(); + virtual void setupThresholds(); FlyWeight<ThresholdResolution::ThresholdPolicy, 10> iv_thrs; - MfgThresholdFile * iv_file; + MfgThreshold* iv_mfgThres; }; } // end namespace PRDF diff --git a/src/usr/diag/prdf/common/mnfgtools/prdfMfgThresholds.lst b/src/usr/diag/prdf/common/mnfgtools/prdfMfgThresholds.lst deleted file mode 100755 index 1819b972b..000000000 --- a/src/usr/diag/prdf/common/mnfgtools/prdfMfgThresholds.lst +++ /dev/null @@ -1,23 +0,0 @@ -# P8 EX Thresholds -P8EX_L2_CACHE_CES 1 -P8EX_L2_DIR_CES 1 -P8EX_L3_CACHE_CES 255 -P8EX_L3_DIR_CES 1 -P8EX_L2_LINE_DELETES 6 -P8EX_L3_LINE_DELETES 6 -P8EX_L2_COL_REPAIRS 7 -P8EX_L3_COL_REPAIRS 7 -P8EX_MFG_L2_LINE_DELETES 0 -P8EX_MFG_L3_LINE_DELETES 0 -P8EX_MFG_L2_COL_REPAIRS 0 -P8EX_MFG_L3_COL_REPAIRS 0 - -# P8 Chip Thresholds -P8CHIP_ONNODE_BUS_CES 1 -P8CHIP_OFFNODE_BUS_CES 1 - -# P8 Centaur Mba thresholds -CEN_MBA_RT_SOFT_CE_TH_ALGO 2 -CEN_MBA_IPL_SOFT_CE_TH_ALGO 2 -CEN_MBA_RT_RCE_PER_RANK 2 -CEN_L4_CACHE_CES 2 diff --git a/src/usr/diag/prdf/common/plat/pegasus/CommonActions.rule b/src/usr/diag/prdf/common/plat/pegasus/CommonActions.rule index 100227bab..a4488f1af 100755 --- a/src/usr/diag/prdf/common/plat/pegasus/CommonActions.rule +++ b/src/usr/diag/prdf/common/plat/pegasus/CommonActions.rule @@ -93,12 +93,6 @@ actionclass threshold5pday threshold( field(5 / day) ); }; -/** Threshold OnNode Bus CE */ -actionclass thresholdOnNode -{ - threshold( field(32 / day), mfg_file(P8CHIP_ONNODE_BUS_CES)); -}; - ################################################################################ # Threshold and Mask policy ################################################################################ diff --git a/src/usr/diag/prdf/common/plat/pegasus/Ex.rule b/src/usr/diag/prdf/common/plat/pegasus/Ex.rule index 8af77c687..8fa05539c 100755 --- a/src/usr/diag/prdf/common/plat/pegasus/Ex.rule +++ b/src/usr/diag/prdf/common/plat/pegasus/Ex.rule @@ -1974,7 +1974,7 @@ actionclass analyzeNcuFir actionclass L3DirCE { calloutSelfHigh; - threshold( field(32 / day), mfg_file(P8EX_L3_DIR_CES) ); + threshold( field(32 / day), mfg_file(ATTR_MNFG_TH_P8EX_L3_DIR_CES) ); }; actionclass L3UE @@ -1989,14 +1989,14 @@ actionclass L3UE actionclass L3CE { calloutSelfHigh; - threshold( field(32 / day), mfg_file(P8EX_L3_CACHE_CES) ); + threshold( field(32 / day), mfg_file(ATTR_MNFG_TH_P8EX_L3_CACHE_CES) ); funccall("L3CE"); # This is no-operation for Hostboot }; actionclass L2CE { calloutSelfHigh; - threshold( field(32 / day), mfg_file(P8EX_L2_CACHE_CES) ); + threshold( field(32 / day), mfg_file(ATTR_MNFG_TH_P8EX_L2_CACHE_CES) ); funccall("L2CE"); # This is no-operation for Hostboot }; @@ -2009,7 +2009,7 @@ actionclass L2UE actionclass L2DirCE { calloutSelfHigh; - threshold( field(32 / day), mfg_file(P8EX_L2_DIR_CES) ); + threshold( field(32 / day), mfg_file(ATTR_MNFG_TH_P8EX_L2_DIR_CES) ); }; actionclass L2ChipLevel2 diff --git a/src/usr/diag/prdf/common/plat/pegasus/Membuf_acts_NEST.rule b/src/usr/diag/prdf/common/plat/pegasus/Membuf_acts_NEST.rule index d8557d306..2f7939ae0 100755 --- a/src/usr/diag/prdf/common/plat/pegasus/Membuf_acts_NEST.rule +++ b/src/usr/diag/prdf/common/plat/pegasus/Membuf_acts_NEST.rule @@ -5,7 +5,7 @@ # # OpenPOWER HostBoot Project # -# Contributors Listed Below - COPYRIGHT 2012,2014 +# Contributors Listed Below - COPYRIGHT 2012,2015 # [+] International Business Machines Corp. # # @@ -1386,7 +1386,7 @@ actionclass analyzeFetchUe1 actionclass clearSecMbsBitsAndLineDelete { calloutL4; - threshold( field(32 / day), mfg_file(CEN_L4_CACHE_CES)); + threshold( field(32 / day), mfg_file(ATTR_MNFG_TH_CEN_L4_CACHE_CES)); funccall("CaptureL4CacheErr"); funccall("ClearServiceCallFlag"); funccall("ClearMbsSecondaryBits"); @@ -1396,7 +1396,7 @@ actionclass clearSecMbsBitsAndLineDelete actionclass clearSecMbaCalBitsAndLineDelete { calloutL4; - threshold( field(32 / day), mfg_file(CEN_L4_CACHE_CES)); + threshold( field(32 / day), mfg_file(ATTR_MNFG_TH_CEN_L4_CACHE_CES)); funccall("CaptureL4CacheErr"); funccall("ClearServiceCallFlag"); funccall("ClearMbaCalSecondaryBits"); diff --git a/src/usr/diag/prdf/common/plat/pegasus/prdfCenMbaThresholds_common.C b/src/usr/diag/prdf/common/plat/pegasus/prdfCenMbaThresholds_common.C index 08957194a..bac2f74b2 100755 --- a/src/usr/diag/prdf/common/plat/pegasus/prdfCenMbaThresholds_common.C +++ b/src/usr/diag/prdf/common/plat/pegasus/prdfCenMbaThresholds_common.C @@ -5,7 +5,7 @@ /* */ /* OpenPOWER HostBoot Project */ /* */ -/* Contributors Listed Below - COPYRIGHT 2013,2014 */ +/* Contributors Listed Below - COPYRIGHT 2013,2015 */ /* [+] International Business Machines Corp. */ /* */ /* */ @@ -29,7 +29,6 @@ // Framework includes #include <prdfExtensibleChip.H> -#include <prdfMfgThresholds.H> #include <prdfMfgThresholdMgr.H> #include <prdfPlatServices.H> @@ -59,7 +58,7 @@ ThresholdResolution::ThresholdPolicy getRceThreshold() if ( mfgMode() ) { th = MfgThresholdMgr::getInstance()-> - getThreshold( PRDF_CEN_MBA_RT_RCE_PER_RANK ); + getThreshold( ATTR_MNFG_TH_CEN_MBA_RT_RCE_PER_RANK ); if( th > MBA_RCE_NON_MNFG_TH ) th = MBA_RCE_NON_MNFG_TH; } @@ -87,7 +86,7 @@ int32_t getMnfgMemCeTh( ExtensibleChip * i_mbaChip, const CenRank & i_rank, if ( 0 == baseTh ) { o_cePerDram = o_cePerHalfRank = o_cePerDimm = - MfgThresholdFileCommon::INFINITE_LIMIT_THR; + MfgThreshold::INFINITE_LIMIT_THR; break; } diff --git a/src/usr/diag/prdf/common/plat/pegasus/prdfP8Ex.C b/src/usr/diag/prdf/common/plat/pegasus/prdfP8Ex.C index 6c03e4f74..4d62ea095 100644 --- a/src/usr/diag/prdf/common/plat/pegasus/prdfP8Ex.C +++ b/src/usr/diag/prdf/common/plat/pegasus/prdfP8Ex.C @@ -5,7 +5,9 @@ /* */ /* OpenPOWER HostBoot Project */ /* */ -/* COPYRIGHT International Business Machines Corp. 2012,2014 */ +/* Contributors Listed Below - COPYRIGHT 2012,2015 */ +/* [+] International Business Machines Corp. */ +/* */ /* */ /* Licensed under the Apache License, Version 2.0 (the "License"); */ /* you may not use this file except in compliance with the License. */ @@ -32,8 +34,7 @@ #include <prdfExtensibleChip.H> #include <prdfPluginMap.H> #include <prdfMfgThresholdMgr.H> -#include <prdfMfgThresholds.H> -#include <prdfMfgThresholdFile_common.H> +#include <prdfMfgThreshold.H> #include <prdfPlatServices.H> using namespace TARGETING; diff --git a/src/usr/diag/prdf/common/prdf_common_fsp_and_hb.mk b/src/usr/diag/prdf/common/prdf_common_fsp_and_hb.mk index 888c628fb..834f68958 100644 --- a/src/usr/diag/prdf/common/prdf_common_fsp_and_hb.mk +++ b/src/usr/diag/prdf/common/prdf_common_fsp_and_hb.mk @@ -115,7 +115,7 @@ prd_obj += prdfTargetServices.o prd_obj += xspprdsdbug.o # common/mnfgtools/ -prd_obj += prdfMfgThresholdFile_common.o +prd_obj += prdfMfgThreshold.o prd_obj += prdfMfgThresholdMgr.o # common/plat/ diff --git a/src/usr/diag/prdf/mnfgtools/prdfMfgSync.H b/src/usr/diag/prdf/mnfgtools/prdfMfgSync.H index 9b465a01a..d902b261e 100755 --- a/src/usr/diag/prdf/mnfgtools/prdfMfgSync.H +++ b/src/usr/diag/prdf/mnfgtools/prdfMfgSync.H @@ -27,7 +27,7 @@ #define __PRDF_MFGSYNC_H #include <prdfGlobal.H> -#include <prdfMfgThresholdFile.H> +#include <prdfMfgThreshold.H> #include <prdfErrorSignature.H> #include <prdfPfa5Data.h> diff --git a/src/usr/diag/prdf/mnfgtools/prdfMfgThresholdFile.H b/src/usr/diag/prdf/mnfgtools/prdfMfgThresholdFile.H deleted file mode 100755 index 61edce699..000000000 --- a/src/usr/diag/prdf/mnfgtools/prdfMfgThresholdFile.H +++ /dev/null @@ -1,61 +0,0 @@ -/* IBM_PROLOG_BEGIN_TAG */ -/* This is an automatically generated prolog. */ -/* */ -/* $Source: src/usr/diag/prdf/mnfgtools/prdfMfgThresholdFile.H $ */ -/* */ -/* OpenPOWER HostBoot Project */ -/* */ -/* COPYRIGHT International Business Machines Corp. 2009,2014 */ -/* */ -/* Licensed under the Apache License, Version 2.0 (the "License"); */ -/* you may not use this file except in compliance with the License. */ -/* You may obtain a copy of the License at */ -/* */ -/* http://www.apache.org/licenses/LICENSE-2.0 */ -/* */ -/* Unless required by applicable law or agreed to in writing, software */ -/* distributed under the License is distributed on an "AS IS" BASIS, */ -/* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or */ -/* implied. See the License for the specific language governing */ -/* permissions and limitations under the License. */ -/* */ -/* IBM_PROLOG_END_TAG */ - -#ifndef __PRDF_PRDFMFGTHRESHOLDFILE_H -#define __PRDF_PRDFMFGTHRESHOLDFILE_H - -#include <prdfMfgThresholdFile_common.H> - -namespace PRDF -{ - -class MfgThresholdFile : public MfgThresholdFileCommon -{ - public: - - /** - * @brief configure MfgThresholdFile - */ - virtual void setup(); - - /** - * @brief serialize threshold data into data buffer - * @param[in/out] o_buffer - data buffer - * @param[in] i_sizeOfBuf - size of buffer - */ - virtual void packThresholdDataIntoBuffer( - uint8_t* & o_buffer, - uint32_t i_sizeOfBuf); - - private: - - /** - * @brief sync MFG thresholds from FSP - */ - void syncFromFsp(); - -}; - -} // end namespace PRDF - -#endif diff --git a/src/usr/diag/prdf/plat/pegasus/prdfCenMbaThresholds.H b/src/usr/diag/prdf/plat/pegasus/prdfCenMbaThresholds.H index f1bb83442..37475792f 100755 --- a/src/usr/diag/prdf/plat/pegasus/prdfCenMbaThresholds.H +++ b/src/usr/diag/prdf/plat/pegasus/prdfCenMbaThresholds.H @@ -5,7 +5,9 @@ /* */ /* OpenPOWER HostBoot Project */ /* */ -/* COPYRIGHT International Business Machines Corp. 2013,2014 */ +/* Contributors Listed Below - COPYRIGHT 2013,2015 */ +/* [+] International Business Machines Corp. */ +/* */ /* */ /* Licensed under the Apache License, Version 2.0 (the "License"); */ /* you may not use this file except in compliance with the License. */ @@ -31,7 +33,6 @@ #include <prdfCenMbaThresholds_common.H> #include <prdfMfgThresholdMgr.H> -#include <prdfMfgThresholds.H> namespace PRDF { @@ -44,7 +45,7 @@ class ExtensibleChip; inline uint8_t getMnfgCeTh() { return MfgThresholdMgr::getInstance()-> - getThreshold( PRDF_CEN_MBA_IPL_SOFT_CE_TH_ALGO ); + getThreshold( TARGETING::ATTR_MNFG_TH_CEN_MBA_IPL_SOFT_CE_TH_ALGO ); } diff --git a/src/usr/diag/prdf/prdf_hb_only.mk b/src/usr/diag/prdf/prdf_hb_only.mk index 142a93a91..c071a4a8b 100644 --- a/src/usr/diag/prdf/prdf_hb_only.mk +++ b/src/usr/diag/prdf/prdf_hb_only.mk @@ -5,7 +5,7 @@ # # OpenPOWER HostBoot Project # -# Contributors Listed Below - COPYRIGHT 2013,2014 +# Contributors Listed Below - COPYRIGHT 2013,2015 # [+] International Business Machines Corp. # # @@ -103,8 +103,7 @@ prd_obj += prdfMbaDomain.o prd_obj += prdfPlatServices_ipl.o # mnfgtools/ -prd_obj += prdfMfgSync.o # TODO: RTC 118150 Will be refactored. -prd_obj += prdfMfgThresholdFile.o # TODO: RTC 118150 Will be refactored. +prd_obj += prdfMfgSync.o # plat/pegasus/ (non-rule plugin related) prd_obj += prdfCenMbaIplCeStats.o @@ -146,16 +145,14 @@ endif # Rule for generated MNFG threshold header file ################################################################################ -MFG_THRES = prdfMfgThresholds +MFG_THRES = prdfMfgThresholdAttrs MFG_THRES_H = ${MFG_THRES}.H MFG_THRES_PL = ${PRD_SRC_PATH}/common/mnfgtools/${MFG_THRES}.pl -MFG_THRES_LIST = ${PRD_SRC_PATH}/common/mnfgtools/${MFG_THRES}.lst +MFG_THRES_ATTR_H = ${ROOTPATH}/obj/genfiles/attributeenums.H MFG_THRES_PATH = ${ROOTPATH}/obj/genfiles/${MFG_THRES_H} -GENFILES += ${MFG_THRES_H} +CODE_PASS_PRE += ${MFG_THRES_PATH} -${MFG_THRES_PATH} : ${MFG_THRES_LIST} +${MFG_THRES_PATH} : ${MFG_THRES_ATTR_H} ${MFG_THRES_PL} $^ > $@ - EXTRA_CLEAN += ${MFG_THRES_PATH} - diff --git a/src/usr/diag/prdf/test/makefile b/src/usr/diag/prdf/test/makefile index 976a7a7c8..b9229e11d 100755 --- a/src/usr/diag/prdf/test/makefile +++ b/src/usr/diag/prdf/test/makefile @@ -40,7 +40,6 @@ PRD_USR_PATH = ${ROOTPATH}/src/usr/diag/prdf #------------------------------------------------------------------------------ OBJS += prdfsimMfgSync.o OBJS += prdfsimFspSyncSvc.o -OBJS += prdfsimFspMfgThresholdFile.o TESTS += prdfTest_MfgSync.H diff --git a/src/usr/diag/prdf/test/prdfsimFspMfgThresholdFile.C b/src/usr/diag/prdf/test/prdfsimFspMfgThresholdFile.C deleted file mode 100644 index 68d7ac673..000000000 --- a/src/usr/diag/prdf/test/prdfsimFspMfgThresholdFile.C +++ /dev/null @@ -1,94 +0,0 @@ -/* IBM_PROLOG_BEGIN_TAG */ -/* This is an automatically generated prolog. */ -/* */ -/* $Source: src/usr/diag/prdf/test/prdfsimFspMfgThresholdFile.C $ */ -/* */ -/* OpenPOWER HostBoot Project */ -/* */ -/* COPYRIGHT International Business Machines Corp. 2009,2014 */ -/* */ -/* Licensed under the Apache License, Version 2.0 (the "License"); */ -/* you may not use this file except in compliance with the License. */ -/* You may obtain a copy of the License at */ -/* */ -/* http://www.apache.org/licenses/LICENSE-2.0 */ -/* */ -/* Unless required by applicable law or agreed to in writing, software */ -/* distributed under the License is distributed on an "AS IS" BASIS, */ -/* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or */ -/* implied. See the License for the specific language governing */ -/* permissions and limitations under the License. */ -/* */ -/* IBM_PROLOG_END_TAG */ - -#include <prdfsimFspMfgThresholdFile.H> -#include <prdfMfgThresholdMgr.H> -#include <prdfGlobal.H> -#include <prdfErrlUtil.H> -#include <prdfTrace.H> - -namespace PRDF -{ - -void SimFspMfgThresholdFile::packThresholdDataIntoBuffer( - uint8_t* & o_buffer, - uint32_t i_sizeOfBuf) -{ - #define FUNC "[SimFspMfgThresholdFile::packThresholdDataIntoBuffer]" - PRDF_ENTER(FUNC" i_sizeOfBuf: %d", i_sizeOfBuf); - PRDF_TRAC("iv_thresholds.size: %d, sizeof(SyncThreshold_t): %d, total: %d", - iv_thresholds.size(), sizeof(SyncThreshold_t), - iv_thresholds.size() * sizeof(SyncThreshold_t)); - - assert(i_sizeOfBuf == - (iv_thresholds.size() * sizeof(SyncThreshold_t))); - - assert(NULL != o_buffer); - - SyncThreshold_t* l_ptr = reinterpret_cast<SyncThreshold_t*>(o_buffer); - - for(Threshold_t::iterator i = iv_thresholds.begin(); - i != iv_thresholds.end(); - ++i) - { - PRDF_TRAC("threshold: %d, count: %d", i->first, i->second); - l_ptr->hash = htonl(i->first); - l_ptr->value = i->second; - l_ptr++; - } - - PRDF_EXIT(FUNC); - - #undef FUNC -} - -void SimFspMfgThresholdFile::overrideThreshold() -{ - #define FUNC "[SimFspMfgThresholdFile::overrideThreshold]" - PRDF_ENTER(FUNC); - - // just hardcode the default override value for now - static const uint8_t MFG_THRES_OVERRIDE_VALUE = 10; - -#define PRDF_MFGTHRESHOLD_TABLE_BEGIN -#define PRDF_MFGTHRESHOLD_TABLE_END -#define PRDF_MFGTHRESHOLD_ENTRY(a,b,c) \ - iv_thresholds[b] = MFG_THRES_OVERRIDE_VALUE; -#include <prdfMfgThresholds.H> - - for(Threshold_t::iterator i = iv_thresholds.begin(); - i != iv_thresholds.end(); - ++i) - { - uint16_t value = MfgThresholdMgr::getInstance()-> - getThreshold(i->first); - PRDF_TRAC("hash: %d, value - override: %d, " - "default: %d", i->first, i->second, value); - } - - PRDF_EXIT(FUNC); - - #undef FUNC -} - -} // end namespace PRDF diff --git a/src/usr/diag/prdf/test/prdfsimFspMfgThresholdFile.H b/src/usr/diag/prdf/test/prdfsimFspMfgThresholdFile.H deleted file mode 100755 index bd9a9413c..000000000 --- a/src/usr/diag/prdf/test/prdfsimFspMfgThresholdFile.H +++ /dev/null @@ -1,63 +0,0 @@ -/* IBM_PROLOG_BEGIN_TAG */ -/* This is an automatically generated prolog. */ -/* */ -/* $Source: src/usr/diag/prdf/test/prdfsimFspMfgThresholdFile.H $ */ -/* */ -/* OpenPOWER HostBoot Project */ -/* */ -/* COPYRIGHT International Business Machines Corp. 2009,2014 */ -/* */ -/* Licensed under the Apache License, Version 2.0 (the "License"); */ -/* you may not use this file except in compliance with the License. */ -/* You may obtain a copy of the License at */ -/* */ -/* http://www.apache.org/licenses/LICENSE-2.0 */ -/* */ -/* Unless required by applicable law or agreed to in writing, software */ -/* distributed under the License is distributed on an "AS IS" BASIS, */ -/* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or */ -/* implied. See the License for the specific language governing */ -/* permissions and limitations under the License. */ -/* */ -/* IBM_PROLOG_END_TAG */ - -#ifndef __PRDF_SimFspMfgThresholdFile_H -#define __PRDF_SimFspMfgThresholdFile_H - -#include <prdfMfgThresholdFile.H> - -namespace PRDF -{ - -class SimFspMfgThresholdFile : public MfgThresholdFile -{ - public: - - /** - * @brief constructor - */ - SimFspMfgThresholdFile() {}; - - /** - * @brief destructor - */ - virtual ~SimFspMfgThresholdFile() {}; - - /** - * @brief serialize threshold data into data buffer - * @param[in/out] o_buffer - data buffer - * @param[in] i_sizeOfBuf - size of buffer - */ - void packThresholdDataIntoBuffer(uint8_t* & o_buffer, - uint32_t i_sizeOfBuf); - - void overrideThreshold(); - - private: - -}; - - -} // end namespace PRDF - -#endif diff --git a/src/usr/diag/prdf/test/prdfsimFspSyncSvc.C b/src/usr/diag/prdf/test/prdfsimFspSyncSvc.C index 06b4d9d18..6336858e8 100755 --- a/src/usr/diag/prdf/test/prdfsimFspSyncSvc.C +++ b/src/usr/diag/prdf/test/prdfsimFspSyncSvc.C @@ -25,7 +25,6 @@ #include <prdfsimFspSyncSvc.H> #include <prdfMfgThresholdMgr.H> -#include <prdfsimFspMfgThresholdFile.H> #include <prdfAssert.h> #include <prdfEnums.H> #include <prdfErrlUtil.H> diff --git a/src/usr/diag/prdf/test/prdfsimFspSyncSvc.H b/src/usr/diag/prdf/test/prdfsimFspSyncSvc.H index bdb51072d..f4508c0eb 100755 --- a/src/usr/diag/prdf/test/prdfsimFspSyncSvc.H +++ b/src/usr/diag/prdf/test/prdfsimFspSyncSvc.H @@ -5,7 +5,9 @@ /* */ /* OpenPOWER HostBoot Project */ /* */ -/* COPYRIGHT International Business Machines Corp. 2009,2014 */ +/* Contributors Listed Below - COPYRIGHT 2013,2015 */ +/* [+] International Business Machines Corp. */ +/* */ /* */ /* Licensed under the Apache License, Version 2.0 (the "License"); */ /* you may not use this file except in compliance with the License. */ @@ -25,7 +27,7 @@ #define __PRDF_SimFspSyncSvc_H -#include <prdfMfgThresholdFile.H> +#include <prdfMfgThreshold.H> #include <prdfGlobal.H> #include <mbox/mbox_queues.H> |