diff options
author | Brian Horton <brianh@linux.ibm.com> | 2012-06-26 16:30:33 -0500 |
---|---|---|
committer | A. Patrick Williams III <iawillia@us.ibm.com> | 2012-08-13 12:25:09 -0500 |
commit | 11c8a7dc6e0ec3c31f081d1e30a04a6e7038f918 (patch) | |
tree | c1e8babefc8a5447d606a4d13a43f914c50bce95 /src/usr/errl/test | |
parent | 99f217daf307b3cd963bcbce8eb7b025d58f734e (diff) | |
download | talos-hostboot-11c8a7dc6e0ec3c31f081d1e30a04a6e7038f918.tar.gz talos-hostboot-11c8a7dc6e0ec3c31f081d1e30a04a6e7038f918.zip |
ERRL: Hardware Callouts
Support for HW and Procedure Callouts, including GARD and
deconfigure information.
. Add errl functions to get the information;
. Add errlog userdetail code to package callout data;
. Add to errlog commit function to find callout user-detail
sections and call a HWAS:common function to process
the callout.
. Remove gardLevel from Targeting hwasState field
Change-Id: I01c7c3721e6fd843a0ba2ad4df8399f6db68b590
RTC: 41276
Reviewed-on: http://gfw160.austin.ibm.com:8080/gerrit/1266
Tested-by: Jenkins Server
Reviewed-by: Daniel M. Crowell <dcrowell@us.ibm.com>
Reviewed-by: A. Patrick Williams III <iawillia@us.ibm.com>
Diffstat (limited to 'src/usr/errl/test')
-rw-r--r-- | src/usr/errl/test/errltest.H | 124 | ||||
-rw-r--r-- | src/usr/errl/test/errluserdetailtest.H | 69 |
2 files changed, 171 insertions, 22 deletions
diff --git a/src/usr/errl/test/errltest.H b/src/usr/errl/test/errltest.H index 2abca0d09..31d128b75 100644 --- a/src/usr/errl/test/errltest.H +++ b/src/usr/errl/test/errltest.H @@ -1,25 +1,26 @@ -// IBM_PROLOG_BEGIN_TAG -// This is an automatically generated prolog. -// -// $Source: src/usr/errl/test/errltest.H $ -// -// IBM CONFIDENTIAL -// -// COPYRIGHT International Business Machines Corp. 2011 -// -// p1 -// -// Object Code Only (OCO) source materials -// Licensed Internal Code Source Materials -// IBM HostBoot Licensed Internal Code -// -// The source code for this program is not published or other- -// wise divested of its trade secrets, irrespective of what has -// been deposited with the U.S. Copyright Office. -// -// Origin: 30 -// -// IBM_PROLOG_END +/* IBM_PROLOG_BEGIN_TAG + * This is an automatically generated prolog. + * + * $Source: src/usr/errl/test/errltest.H $ + * + * IBM CONFIDENTIAL + * + * COPYRIGHT International Business Machines Corp. 2011-2012 + * + * p1 + * + * Object Code Only (OCO) source materials + * Licensed Internal Code Source Materials + * IBM HostBoot Licensed Internal Code + * + * The source code for this program is not published or other- + * wise divested of its trade secrets, irrespective of what has + * been deposited with the U.S. Copyright Office. + * + * Origin: 30 + * + * IBM_PROLOG_END_TAG + */ #ifndef __ERRLTEST_H #define __ERRLTEST_H @@ -36,6 +37,12 @@ #include <trace/trace.H> #include <hbotcompid.H> +#include <errl/errludtarget.H> +#include <targeting/common/target.H> +#include <targeting/common/iterators/rangefilter.H> +#include <targeting/common/predicates/predicates.H> +#include <hwas/common/hwasCallout.H> + #define TEST_SEVERITY ERRORLOG::ERRL_SEV_INFORMATIONAL @@ -331,6 +338,79 @@ public: } } + + /** + * @brief Test callouts + */ + void testErrl3(void) + { + TS_TRACE( "test testErrl3"); + do + { + // Create an error log + errlHndl_t errl = new ERRORLOG::ErrlEntry( + ERRORLOG::ERRL_SEV_UNRECOVERABLE, + HBERRL_TEST_MOD_ID, + HBERRL_TEST_REASON_CODE); + + // Make sure log is created + if (errl == NULL) + { + TS_FAIL("testErrl3: createErrlLog() returns NULL pointer!"); + break; + } + + // test the different callout types + + // find a proc target + TARGETING::PredicateCTM procChipFilter( + TARGETING::CLASS_CHIP, TARGETING::TYPE_PROC); + TARGETING::TargetRangeFilter pProc( + TARGETING::targetService().begin(), + TARGETING::targetService().end(), + &procChipFilter); + + // find a membuf target + TARGETING::PredicateCTM membufChipFilter( + TARGETING::CLASS_CHIP,TARGETING::TYPE_MEMBUF); + TARGETING::TargetRangeFilter pMembuf( + TARGETING::targetService().begin(), + TARGETING::targetService().end(), + &membufChipFilter); + + TS_TRACE( "test callout pProc %p", *pProc); + ERRORLOG::ErrlUserDetailsTarget(*pProc).addToLog(errl); + + errl->addHwCallout(*pProc, + HWAS::SRCI_PRIORITY_LOW, + HWAS::DECONFIG, + HWAS::GARD_Fatal); + + errl->addHwCallout(*pMembuf, + HWAS::SRCI_PRIORITY_MED, + HWAS::DECONFIG, + HWAS::GARD_NULL); + + errl->addHwCallout(TARGETING::MASTER_PROCESSOR_CHIP_TARGET_SENTINEL, + HWAS::SRCI_PRIORITY_LOW, + HWAS::DECONFIG, + HWAS::GARD_PoreError); + + errl->addHwCallout(TARGETING::MASTER_PROCESSOR_CHIP_TARGET_SENTINEL, + HWAS::SRCI_PRIORITY_MED, + HWAS::DECONFIG, + HWAS::GARD_NULL); + + errl->addProcedureCallout( + HWAS::EPUB_PRC_MEMORY_UE, + HWAS::SRCI_PRIORITY_HIGH); + + errlCommit(errl, CXXTEST_COMP_ID); + TS_TRACE( "test callout done"); + + } + while(0); + } }; #endif diff --git a/src/usr/errl/test/errluserdetailtest.H b/src/usr/errl/test/errluserdetailtest.H index 2adeefd86..34401ae35 100644 --- a/src/usr/errl/test/errluserdetailtest.H +++ b/src/usr/errl/test/errluserdetailtest.H @@ -39,6 +39,7 @@ #include <errl/errludbacktrace.H> #include <errl/errludtarget.H> #include <errl/errludlogregister.H> +#include <errl/errludcallout.H> #include <errludattribute.H> #include <targeting/common/targetservice.H> #include <targeting/common/iterators/rangefilter.H> @@ -445,6 +446,74 @@ public: errlCommit(errl, CXXTEST_COMP_ID); TS_TRACE( "testLogRegister errorlog user detail data - complete"); } // testLogRegister + + /** + * @test testCallout - Capture a callout + */ + void testCallout(void) + { + errlHndl_t errl = NULL; + + TS_TRACE( "testCallout errorlog user detail data"); + /*@ + * @errortype + * @severity ERRORLOG_SEV_INFORMATIONAL + * @moduleid HBERRL_USERDATA_TEST_MOD_ID + * @reasoncode HBERRL_TEST_CALLOUT_UD + * @userdata1 Test data 1 + * @userdata2 Test data 2 + * @devdesc User Details unit test - create callout user detail data + */ + errl = new ERRORLOG::ErrlEntry( + ERRORLOG::ERRL_SEV_INFORMATIONAL, + HBERRL_USERDATA_TEST_MOD_ID, + HBERRL_TEST_CALLOUT_UD, + 0x0001002300450067, // user1 + 0x008900AB00CD00EF ); // user2 + + using namespace TARGETING; + ErrlUserDetailsString("Callout test").addToLog(errl); + + // first test with Master + ErrlUserDetailsCallout( + &HWAS::TARGET_IS_SENTINEL, + sizeof(HWAS::TARGET_IS_SENTINEL), + HWAS::SRCI_PRIORITY_LOW, + HWAS::DECONFIG, + HWAS::GARD_PoreError).addToLog(errl); + + ErrlUserDetailsCallout( + &HWAS::TARGET_IS_SENTINEL, + sizeof(HWAS::TARGET_IS_SENTINEL), + HWAS::SRCI_PRIORITY_MED, + HWAS::DECONFIG, + HWAS::GARD_NULL).addToLog(errl); + + // find a proc target + PredicateCTM procChipFilter(CLASS_CHIP,TYPE_PROC); + TargetRangeFilter pProc( + targetService().begin(), targetService().end(), + &procChipFilter); + TARGETING::EntityPath ep; + ep = pProc->getAttr<TARGETING::ATTR_PHYS_PATH>(); + + ErrlUserDetailsCallout( + &ep, + sizeof(ep), + HWAS::SRCI_PRIORITY_LOW, + HWAS::DECONFIG, + HWAS::GARD_Fatal).addToLog(errl); + + ErrlUserDetailsCallout( + HWAS::EPUB_PRC_MEMORY_UE, + HWAS::SRCI_PRIORITY_HIGH).addToLog(errl); + + // commit the errorlog + errlCommit(errl, CXXTEST_COMP_ID); + TS_TRACE( "testCallout done"); + + } // testCallout + }; #endif |