diff options
| author | Brian Horton <brianh@linux.ibm.com> | 2013-02-26 16:40:57 -0600 | 
|---|---|---|
| committer | A. Patrick Williams III <iawillia@us.ibm.com> | 2013-03-13 09:26:19 -0500 | 
| commit | 436bc524c3cada8c1c5c9c64e4c173a77f195410 (patch) | |
| tree | df10a266e972b59fc6470a33ede7d7282e10d0a0 /src/usr/errl | |
| parent | 19d913c39aa031f0f88828b09d581503c7cbdcf2 (diff) | |
| download | blackbird-hostboot-436bc524c3cada8c1c5c9c64e4c173a77f195410.tar.gz blackbird-hostboot-436bc524c3cada8c1c5c9c64e4c173a77f195410.zip  | |
update user-detail errog log parsers
update errolog parsers to format the data for the following:
 . errludtarget
 . errludattribute
 . errludlogregister
 . errludcallout
Change-Id: I8fddb3eefd76413e70f4e894ef19649b74682859
RTC: 41707
Reviewed-on: http://gfw160.austin.ibm.com:8080/gerrit/3350
Tested-by: Jenkins Server
Reviewed-by: A. Patrick Williams III <iawillia@us.ibm.com>
Diffstat (limited to 'src/usr/errl')
| -rw-r--r-- | src/usr/errl/errludlogregister.C | 37 | ||||
| -rw-r--r-- | src/usr/errl/errludtarget.C | 77 | ||||
| -rw-r--r-- | src/usr/errl/makefile | 31 | ||||
| -rw-r--r-- | src/usr/errl/parser/makefile | 2 | ||||
| -rw-r--r-- | src/usr/errl/plugins/errludcallout.H | 140 | ||||
| -rw-r--r-- | src/usr/errl/plugins/errludlogregister.H | 143 | ||||
| -rw-r--r-- | src/usr/errl/plugins/errludtarget.H | 251 | ||||
| -rw-r--r-- | src/usr/errl/test/errltest.H | 2 | ||||
| -rw-r--r-- | src/usr/errl/test/errluserdetailtest.H | 10 | 
9 files changed, 325 insertions, 368 deletions
diff --git a/src/usr/errl/errludlogregister.C b/src/usr/errl/errludlogregister.C index 722b3680a..244b8d5ec 100644 --- a/src/usr/errl/errludlogregister.C +++ b/src/usr/errl/errludlogregister.C @@ -53,10 +53,15 @@ void ErrlUserDetailsLogRegister::setStateLogHUID()      // write the HUID of the target into the error log buffer      uint32_t attrHuid = get_huid(iv_pTarget); -    char *pBuf; -    pBuf = reinterpret_cast<char *>(reallocUsrBuf(sizeof(attrHuid))); -    memcpy(pBuf, &attrHuid, sizeof(attrHuid)); -    iv_dataSize += sizeof(attrHuid); +    uint8_t *pBuf = reinterpret_cast<uint8_t *> +            (reallocUsrBuf(sizeof(uint32_t) + sizeof(uint8_t))); +    memcpy(pBuf, &attrHuid, sizeof(uint32_t)); +    iv_dataSize += sizeof(uint32_t); + +    // add space for the count and initialize to 0 +#define REGISTER_COUNT_OFFSET (sizeof(uint32_t)) +    *(pBuf + REGISTER_COUNT_OFFSET) = 0; +    iv_dataSize += sizeof(uint8_t);  } // setStateLogHUID @@ -97,6 +102,10 @@ void ErrlUserDetailsLogRegister::writeRegisterData(          memcpy(pBuf + iv_dataSize, i_dataBuf, i_dataSize);          iv_dataSize += i_dataSize;      } + +    // increment the count +    *(pBuf + REGISTER_COUNT_OFFSET) += 1; +  } // writeRegisterData  // internal function: @@ -107,7 +116,7 @@ void ErrlUserDetailsLogRegister::readRegister(      //  (DeviceFW::PRESENT is an example, but we chose not to log that type)      int32_t numAddressArgs = -1; -    // do we do the deviceOpValist or not, and how many  +    // do we do the deviceOpValist or not, and how many      //  parameters are there to be logged      switch (i_accessType)      { @@ -165,14 +174,17 @@ void ErrlUserDetailsLogRegister::readRegister(                          i_accessType);              delete errl; // eat the error - just delete it -            reg_size = 0; // in case deviceOpValist didn't reset +            // nothing gets written out +        } +        else +        { +            // internal worker function to put reg data into the log +            writeRegisterData(®_data, reg_size, numAddressArgs, +                    i_accessType, i_args); +            TRACDCOMP(g_trac_errl, "LogRegister: iv_dataSize %d", iv_dataSize);          } - -        // internal worker function to put reg data into the log -        writeRegisterData(®_data, reg_size, numAddressArgs, -                i_accessType, i_args); -        TRACDCOMP(g_trac_errl, "LogRegister: iv_dataSize %d", iv_dataSize);      } +    // else: nothing gets written out  } // readRegister  // internal function: @@ -184,7 +196,7 @@ void ErrlUserDetailsLogRegister::copyRegisterData(      //  (DeviceFW::PRESENT is an example, but we chose not to log that type)      int32_t numAddressArgs = -1; -    // do we do the deviceOpValist or not, and how many  +    // do we do the deviceOpValist or not, and how many      //  parameters are there to be logged      switch (i_accessType)      { @@ -230,6 +242,7 @@ void ErrlUserDetailsLogRegister::copyRegisterData(                  i_accessType, i_args);          TRACDCOMP(g_trac_errl, "LogRegister: iv_dataSize %d", iv_dataSize);      } +    // else: nothing gets written out  } // copyRegisterData  //------------------------------------------------------------------------------ diff --git a/src/usr/errl/errludtarget.C b/src/usr/errl/errludtarget.C deleted file mode 100644 index 4d36f5e7a..000000000 --- a/src/usr/errl/errludtarget.C +++ /dev/null @@ -1,77 +0,0 @@ -/* IBM_PROLOG_BEGIN_TAG                                                   */ -/* This is an automatically generated prolog.                             */ -/*                                                                        */ -/* $Source: src/usr/errl/errludtarget.C $                                 */ -/*                                                                        */ -/* IBM CONFIDENTIAL                                                       */ -/*                                                                        */ -/* COPYRIGHT International Business Machines Corp. 2012,2013              */ -/*                                                                        */ -/* 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 otherwise         */ -/* divested of its trade secrets, irrespective of what has been           */ -/* deposited with the U.S. Copyright Office.                              */ -/*                                                                        */ -/* Origin: 30                                                             */ -/*                                                                        */ -/* IBM_PROLOG_END_TAG                                                     */ -/** - *  @file errludtarget.C - * - *  @brief Implementation of ErrlUserDetailsTarget - */ -#include <errl/errludtarget.H> -#include <errl/errlreasoncodes.H> -#include <targeting/common/target.H> -#include <targeting/common/targetservice.H> -#include <targeting/common/trace.H> - -namespace ERRORLOG -{ - -//------------------------------------------------------------------------------ -ErrlUserDetailsTarget::ErrlUserDetailsTarget( -    const TARGETING::Target * i_pTarget) -{ -    // Set up ErrlUserDetails instance variables -    iv_CompId = ERRL_COMP_ID; -    iv_Version = 1; -    iv_SubSection = ERRL_UDT_TARGET; - -    // override the default of false. -    //iv_merge = true; -    // TODO until the errlparser tool is fixed and the errludtarget parse() -    // function can be fully tested and debugged, we'll leave this as false -    // so that the records are NOT merged to make it less confusing. -    iv_merge = false; - -    if (i_pTarget == TARGETING::MASTER_PROCESSOR_CHIP_TARGET_SENTINEL) -    { -        uint8_t *pBuffer = reinterpret_cast<uint8_t *>( -                                reallocUsrBuf(sizeof(uint8_t))); -        // copy 0x1 to indicate MASTER -        *pBuffer = 1; -    } -    else -    { -        uint32_t bufSize = 0; -        uint8_t *pTargetString = i_pTarget->targetFFDC(bufSize); -        uint8_t *pBuffer = reinterpret_cast<uint8_t *>(reallocUsrBuf(bufSize)); -        memcpy(pBuffer, pTargetString, bufSize); -        free (pTargetString); -    } -} - -//------------------------------------------------------------------------------ -ErrlUserDetailsTarget::~ErrlUserDetailsTarget() -{ - -} - -} - diff --git a/src/usr/errl/makefile b/src/usr/errl/makefile index 7ce89dc70..6535ef642 100644 --- a/src/usr/errl/makefile +++ b/src/usr/errl/makefile @@ -1,25 +1,25 @@ -#   IBM_PROLOG_BEGIN_TAG -#  This is an automatically generated prolog. +# IBM_PROLOG_BEGIN_TAG +# This is an automatically generated prolog.  # -#  $Source: src/usr/errl/makefile $ +# $Source: src/usr/errl/makefile $  # -#  IBM CONFIDENTIAL +# IBM CONFIDENTIAL  # -#  COPYRIGHT International Business Machines Corp. 2011-2012 +# COPYRIGHT International Business Machines Corp. 2011,2013  # -#  p1 +# p1  # -#  Object Code Only (OCO) source materials -#  Licensed Internal Code Source Materials -#  IBM HostBoot Licensed Internal Code +# 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. +# The source code for this program is not published or otherwise +# divested of its trade secrets, irrespective of what has been +# deposited with the U.S. Copyright Office.  # -#  Origin: 30 +# Origin: 30  # -#  IBM_PROLOG_END_TAG +# IBM_PROLOG_END_TAG  ROOTPATH = ../../..  MODULE = errl @@ -32,5 +32,6 @@ SUBDIRS = test.d  parser.d  include ${ROOTPATH}/config.mk -# to find errludattribute.C and .H +# to find errludattribute.[CH] and errludtarget.[CH] - they are generated +#  by src/usr/targeting/common/xmltohb/xmltohb.pl  vpath %.C ${GENDIR} diff --git a/src/usr/errl/parser/makefile b/src/usr/errl/parser/makefile index 10a4060ee..386ab9b5e 100644 --- a/src/usr/errl/parser/makefile +++ b/src/usr/errl/parser/makefile @@ -61,7 +61,7 @@ CODE_PASS: ${IMGDIR}/errlparser  mkdirs:  	mkdir -p ${OBJDIR} -	mkdir -p ${GENDIR} +	mkdir -p ${GENDIR}/plugins  # Generate error log parser code  ${ERRLPARSE_TARGETS} : gen_errl_parsers diff --git a/src/usr/errl/plugins/errludcallout.H b/src/usr/errl/plugins/errludcallout.H index 3346c6487..a4d7590a8 100644 --- a/src/usr/errl/plugins/errludcallout.H +++ b/src/usr/errl/plugins/errludcallout.H @@ -31,6 +31,8 @@   */  #include "errluserdetails.H" +#include "errludtarget.H" // for errlud_parse_entity_path() +#include "../hwas/common/hwasCallout.H"  namespace ERRORLOG  { @@ -66,9 +68,141 @@ public:                         void * i_pBuffer,                         const uint32_t i_buflen) const      { -        // TODO fix when parser fixed -        // RTC 41707 -    } +        HWAS::callout_ud_t *pData; +        pData = static_cast<HWAS::callout_ud_t *>(i_pBuffer); + +        switch (pData->type) +        { +            case HWAS::HW_CALLOUT: +            { +                i_parser.PrintString( "Callout type", "Hardware Callout"); + +                // what follows the pData structure is an entity path +                // print it first +                uint8_t *l_ptr = reinterpret_cast<uint8_t *>(pData+1); +                if (*l_ptr == 0xF0) +                { +                    i_parser.PrintString("Target", +                                "MASTER_PROCESSOR_CHIP_TARGET_SENTINEL"); +                } +                else +                { +                    char outString[128]; +                    l_ptr = errlud_parse_entity_path(l_ptr, outString); +                    i_parser.PrintString("Target", outString); +                } + +                i_parser.PrintNumber( "CPU id", "0x%X", ntohl(pData->cpuid) ); + +                switch (ntohl(pData->deconfigState)) +                { +#define case_DECONFIG_STATE(_type) \ +case HWAS::_type: i_parser.PrintString( "Deconfig State", #_type); break; +                    case_DECONFIG_STATE(NO_DECONFIG) +                    case_DECONFIG_STATE(DECONFIG) +                    case_DECONFIG_STATE(DELAYED_DECONFIG) +                    default: +                        i_parser.PrintNumber( "Deconfig State", "UNKNOWN: 0x%X", +                                        ntohl(pData->deconfigState) ); +                        break; +                } // switch deconfigState + +                switch (ntohl(pData->gardErrorType)) +                { +#define case_GARD_ERROR_TYPE(_type) \ +case HWAS::_type: i_parser.PrintString( "GARD Error Type", #_type); break; +                    case_GARD_ERROR_TYPE(GARD_NULL) +                    case_GARD_ERROR_TYPE(GARD_Pending) +                    case_GARD_ERROR_TYPE(GARD_PendingCmplt) +                    case_GARD_ERROR_TYPE(GARD_Unrecoverable) +                    case_GARD_ERROR_TYPE(GARD_Fatal) +                    case_GARD_ERROR_TYPE(GARD_Fabric) +                    case_GARD_ERROR_TYPE(GARD_Computation) +                    case_GARD_ERROR_TYPE(GARD_ComputationCmplt) +                    case_GARD_ERROR_TYPE(GARD_Predictive) +                    case_GARD_ERROR_TYPE(GARD_PredictiveCmplt) +                    case_GARD_ERROR_TYPE(GARD_ByAssociation) +                    case_GARD_ERROR_TYPE(GARD_ResourceRecovery) +                    case_GARD_ERROR_TYPE(GARD_Cmplt) +                    case_GARD_ERROR_TYPE(GARD_Func) +                    case_GARD_ERROR_TYPE(GARD_FuncCmplt) +                    case_GARD_ERROR_TYPE(GARD_DmaRecoverable) +                    case_GARD_ERROR_TYPE(GARD_DmaUnrecoverable) +                    case_GARD_ERROR_TYPE(GARD_Tod) +                    case_GARD_ERROR_TYPE(GARD_TodCmplt) +                    case_GARD_ERROR_TYPE(GARD_Slb) +                    case_GARD_ERROR_TYPE(GARD_SlbCmplt) +                    case_GARD_ERROR_TYPE(GARD_ProcRecoverable) +                    case_GARD_ERROR_TYPE(GARD_ProcRecoverableCmplt) +                    case_GARD_ERROR_TYPE(GARD_TimeFac) +                    case_GARD_ERROR_TYPE(GARD_TimeFacCmplt) +                    case_GARD_ERROR_TYPE(GARD_GxBusError) +                    case_GARD_ERROR_TYPE(GARD_PowerBusError) +                    case_GARD_ERROR_TYPE(GARD_Withheld) +                    case_GARD_ERROR_TYPE(GARD_PoreError) +                    case_GARD_ERROR_TYPE(GARD_NxError) +                    case_GARD_ERROR_TYPE(GARD_Void) +                    default: +                        i_parser.PrintNumber( "Deconfig State", "UNKNOWN: 0x%X", +                                        ntohl(pData->gardErrorType) ); +                        break; +                } // switch deconfigState + +                break; // HW_CALLOUT +            } +            case HWAS::PROCEDURE_CALLOUT: +                i_parser.PrintString( "Callout type", "Procedure Callout"); +                switch (ntohl(pData->procedure)) +                { +#define case_PROCEDURE(_type) \ +case HWAS::_type: i_parser.PrintString( "Procedure", #_type); break; +                    case_PROCEDURE(EPUB_PRC_NONE) +                    case_PROCEDURE(EPUB_PRC_FIND_DECONFIGURED_PART) +                    case_PROCEDURE(EPUB_PRC_SP_CODE) +                    case_PROCEDURE(EPUB_PRC_PHYP_CODE) +                    case_PROCEDURE(EPUB_PRC_ALL_PROCS) +                    case_PROCEDURE(EPUB_PRC_ALL_MEMCRDS) +                    case_PROCEDURE(EPUB_PRC_INVALID_PART) +                    case_PROCEDURE(EPUB_PRC_LVL_SUPP) +                    case_PROCEDURE(EPUB_PRC_PROCPATH) +                    case_PROCEDURE(EPUB_PRC_NO_VPD_FOR_FRU) +                    case_PROCEDURE(EPUB_PRC_MEMORY_PLUGGING_ERROR) +                    case_PROCEDURE(EPUB_PRC_FSI_PATH) +                    case_PROCEDURE(EPUB_PRC_PROC_AB_BUS) +                    case_PROCEDURE(EPUB_PRC_PROC_XYZ_BUS) +                    case_PROCEDURE(EPUB_PRC_MEMBUS_ERROR) +                    case_PROCEDURE(EPUB_PRC_EIBUS_ERROR) +                    case_PROCEDURE(EPUB_PRC_POWER_ERROR) +                    case_PROCEDURE(EPUB_PRC_PERFORMANCE_DEGRADED) +                    case_PROCEDURE(EPUB_PRC_HB_CODE) +                    default: +                        i_parser.PrintNumber( "Procedure", "UNKNOWN: 0x%X", +                                        ntohl(pData->procedure) ); +                        break; +                } // switch procedure +                break; // PROCEDURE_CALLOUT +            default: +                i_parser.PrintNumber( "Callout type", "UNKNOWN: 0x%X", +                                            ntohl(pData->type) ); +                break; +        } // switch type + +        switch (ntohl(pData->priority)) +        { +#define case_PRIORITY(_type) \ +case HWAS::_type: i_parser.PrintString( "Priority", #_type); break; +            case_PRIORITY(SRCI_PRIORITY_LOW) +            case_PRIORITY(SRCI_PRIORITY_MEDC) +            case_PRIORITY(SRCI_PRIORITY_MEDB) +            case_PRIORITY(SRCI_PRIORITY_MEDA) +            case_PRIORITY(SRCI_PRIORITY_MED) +            case_PRIORITY(SRCI_PRIORITY_HIGH) +        default: +            i_parser.PrintNumber( "Priority", "UNKNOWN: 0x%X", +                                    ntohl(pData->priority) ); +            break; +        } // switch priority +    } // parse  private:      // Disabled diff --git a/src/usr/errl/plugins/errludlogregister.H b/src/usr/errl/plugins/errludlogregister.H index f7f19ae2d..79aa8ba04 100644 --- a/src/usr/errl/plugins/errludlogregister.H +++ b/src/usr/errl/plugins/errludlogregister.H @@ -32,6 +32,9 @@  #include "errluserdetails.H" +#include <../devicefw/userif.H> +#include <../devicefw/driverif.H> +  namespace ERRORLOG  { @@ -66,9 +69,143 @@ public:                         void * i_pBuffer,                         const uint32_t i_buflen) const      { -        // TODO fix when parser if fix -        // RTC 41707 -    } +        uint8_t *pBuf = reinterpret_cast<uint8_t *>(i_pBuffer); + +        // while there is still at least 1 word of data left +        for (; (pBuf + sizeof(uint32_t)) <= ((uint8_t*)i_pBuffer + i_buflen); ) +        { +            // first is the HUID +            uint32_t *pData = reinterpret_cast<uint32_t *>(pBuf); +            if (ntohl(*pData) == 0xFFFFFFFF) +            { +                i_parser.PrintString("LogRegister", +                            "Target: MASTER_PROCESSOR_CHIP_TARGET_SENTINEL"); +            } +            else +            { +                i_parser.PrintNumber( "LogRegister", +                            "Target: HUID = 0x%08X", ntohl(*pData) ); +            } +            pData++; +            pBuf += sizeof(*pData); + +            // next is the count of registers to dump +            const uint8_t count = *pBuf; +            pBuf++; + +            for (uint32_t i = 0; i < count;i++) +            { +                // format of data in the buffer is: +                // i_accessType, regParam[i], uint8_t(i_dataSize), i_dataBuf +                uint8_t l_accessType = *pBuf; +                pBuf++; +                int32_t numArgs = -1; +                std::vector <const char *> addrParams; +                switch (l_accessType) +                { +                    // one parameter +                    case DeviceFW::SCOM:        // userif.H +                        i_parser.PrintString("AccessType", "DeviceFW::SCOM"); +                        numArgs = 1; +                        addrParams.push_back("  Scom address"); +                        break; +                    case DeviceFW::FSI:         // userif.H +                        i_parser.PrintString("AccessType", "DeviceFW::FSI"); +                        numArgs = 1; +                        addrParams.push_back("  FSI address"); +                        break; +                    case DeviceFW::SPD:         // userif.H +                        i_parser.PrintString("AccessType", "DeviceFW::SPD"); +                        numArgs = 1; +                        addrParams.push_back("  SPD keyword enumaration"); +                        break; +                    case DeviceFW::XSCOM:       // driverif.H +                        i_parser.PrintString("AccessType", "DeviceFW::XSCOM"); +                        numArgs = 1; +                        addrParams.push_back("  XScom address"); +                        break; +                    case DeviceFW::FSISCOM:     // driverif.H +                        i_parser.PrintString("AccessType", "DeviceFW::FSISCOM"); +                        numArgs = 1; +                        addrParams.push_back("  FSISCOM address"); +                        break; +                    // two parameters +                    case DeviceFW::MVPD:        // userif.H +                        i_parser.PrintString("AccessType", "DeviceFW::MVPD"); +                        numArgs = 2; +                        addrParams.push_back("  MVPD record"); +                        addrParams.push_back("  MVPD keyword"); +                        break; +                    case DeviceFW::EEPROM:      // driverif.H +                        i_parser.PrintString("AccessType", "DeviceFW::EEPROM"); +                        numArgs = 2; +                        addrParams.push_back("  I2C slave device address"); +                        addrParams.push_back("  EEPROM chip number"); +                        break; +                    // three parameters +                    case DeviceFW::I2C:         // driverif.H +                        i_parser.PrintString("AccessType", "DeviceFW::I2C"); +                        numArgs = 3; +                        addrParams.push_back("  I2C port"); +                        addrParams.push_back("  I2C master engine"); +                        addrParams.push_back("  Device address"); +                        break; +                    // not logged! +                    case DeviceFW::PRESENT:     // userif.H +                        i_parser.PrintString("AccessType", "DeviceFW::PRESENT " +                                                    "- not logged"); +                        break; +                    case DeviceFW::PNOR:        // userif.H +                        i_parser.PrintString("AccessType", "DeviceFW::PNOR " +                                                    "- not logged"); +                        break; +                    case DeviceFW::MAILBOX:     // userif.H +                        i_parser.PrintString("AccessType", "DeviceFW::MAILBOX " +                                                    "- not logged"); +                        break; +                    case DeviceFW::CVPD:     // userif.H +                        i_parser.PrintString("AccessType", "DeviceFW::CVPD " +                                                    "- not logged"); +                        break; +                    case DeviceFW::SCAN:     // userif.H +                        i_parser.PrintString("AccessType", "DeviceFW::SCAN " +                                                    "- not logged"); +                        break; +                    case DeviceFW::IBSCOM:     // userif.H +                        i_parser.PrintString("AccessType", "DeviceFW::IBSCOM " +                                                    "- not logged"); +                        break; +                    default: +                        i_parser.PrintNumber("AccessType", "UNKNOWN 0x%X" +                                                    "- not logged", +                                                    l_accessType); +                        break; +                } // switch l_accessType + +                if (numArgs != -1) +                { +                    uint64_t *pData64 = reinterpret_cast<uint64_t *>(pBuf); +                    for (int32_t i = 0;i < numArgs;i++) +                    { +                        std::vector<char> l_traceEntry(20); +                        sprintf(&(l_traceEntry[0]),"0x%016llX", ntohll(*pData64)); +                        i_parser.PrintString(addrParams[i], &(l_traceEntry[0])); + +                        pData64++; +                        pBuf += sizeof(*pData64); +                    } +                    const uint8_t dataSize = *pBuf; +                    i_parser.PrintNumber("  Register data", "size: 0x%X bytes", +                                            dataSize); +                    pBuf++; + +                    pData64 = reinterpret_cast<uint64_t *>(pBuf); +                    i_parser.PrintHexDump( pData64, dataSize); +                    pBuf += dataSize; +                } // numArgs +            } // for count +        } // for +    } // parse  private:      // Disabled diff --git a/src/usr/errl/plugins/errludtarget.H b/src/usr/errl/plugins/errludtarget.H deleted file mode 100644 index 61a4d8cf9..000000000 --- a/src/usr/errl/plugins/errludtarget.H +++ /dev/null @@ -1,251 +0,0 @@ -/* IBM_PROLOG_BEGIN_TAG                                                   */ -/* This is an automatically generated prolog.                             */ -/*                                                                        */ -/* $Source: src/usr/errl/plugins/errludtarget.H $                         */ -/*                                                                        */ -/* IBM CONFIDENTIAL                                                       */ -/*                                                                        */ -/* COPYRIGHT International Business Machines Corp. 2012,2013              */ -/*                                                                        */ -/* 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 otherwise         */ -/* divested of its trade secrets, irrespective of what has been           */ -/* deposited with the U.S. Copyright Office.                              */ -/*                                                                        */ -/* Origin: 30                                                             */ -/*                                                                        */ -/* IBM_PROLOG_END_TAG                                                     */ -#ifndef ERRL_UDTARGET_H -#define ERRL_UDTARGET_H - -/** - *  @file errludTarget.H - * - *  Defines the ErrlUserDetailsParserTarget class that parses Target FFDC - *  user detail in an error log - */ - -#include "errluserdetails.H" -#include <string.h> - -namespace ERRORLOG -{ - -/** - * @class ErrlUserDetailsParserTarget - * - * Parses Target FFDC user detail in an error log - */ -class ErrlUserDetailsParserTarget : public ErrlUserDetailsParser -{ -public: -    /** -     *  @brief Constructor -     */ -    ErrlUserDetailsParserTarget() {} - -    /** -     *  @brief Destructor -     */ -    virtual ~ErrlUserDetailsParserTarget() {} - -    /** -     *  @brief Parses Target user detail data from an error log -     * -     *  @param  i_version Version of the data -     *  @param  i_parse   ErrlUsrParser object for outputting information -     *  @param  i_pBuffer Pointer to buffer containing detail data -     *  @param  i_buflen  Length of the buffer -     */ -    virtual void parse(errlver_t i_version, -                       ErrlUsrParser & i_parser, -                       void * i_pBuffer, -                       const uint32_t i_buflen) const -    { -        i_parser.PrintString("Target data", NULL); -        const char *attrData; -        uint32_t i = 0; - -        // errlog data -        uint8_t *l_ptr = static_cast<uint8_t *>(i_pBuffer); - -        // TODO: needs to be updated to handle merged records - -        if (*l_ptr == 1) // special - master -        {  -            i_parser.PrintString(NULL, "MASTER_PROCESSOR_CHIP_TARGET_SENTINEL"); -        } -        else -        { -            l_ptr += sizeof(uint8_t); // past the marker - -            // first 4 are always the same -            if (i_buflen >= sizeof(uint32_t) + 3 * sizeof(uint8_t)) -            { -                char sHuid[12]; -                sprintf(sHuid, "0x%x",*((uint32_t *)l_ptr)); -                i_parser.PrintString("ATTR_HUID", sHuid); -                i += sizeof(uint32_t); -                l_ptr += sizeof(uint32_t); - -                // CLASS -                switch (*l_ptr) { -                    case 0x00: { attrData = "CLASS_NA"; break; } -                    case 0x01: { attrData = "CLASS_CARD"; break; } -                    case 0x02: { attrData = "CLASS_ENC"; break; } -                    case 0x03: { attrData = "CLASS_CHIP"; break; } -                    case 0x04: { attrData = "CLASS_UNIT"; break; } -                    case 0x05: { attrData = "CLASS_DEV"; break; } -                    case 0x06: { attrData = "CLASS_SYS"; break; } -                    case 0x07: { attrData = "CLASS_LOGICAL_CARD"; break; } -                    case 0x08: { attrData = "CLASS_MAX"; break; } -                    default:   { attrData = "UNKNOWN CLASS"; break; } -                } // switch -                i_parser.PrintString("ATTR_CLASS", attrData); -                i ++; -                l_ptr ++; - -                // TYPE -                switch (*l_ptr) { -                    // TODO: RTC 50828: make these build-time dynamic based -                    //  on values in obj/genfiles/attributeenums.H -                    case 0x00: { attrData = "TYPE_NA"; break; } -                    case 0x01: { attrData = "TYPE_SYS"; break; } -                    case 0x02: { attrData = "TYPE_NODE"; break; } -                    case 0x03: { attrData = "TYPE_DIMM"; break; } -                    case 0x04: { attrData = "TYPE_MEMBUF"; break; } -                    case 0x05: { attrData = "TYPE_PROC"; break; } -                    case 0x06: { attrData = "TYPE_EX"; break; } -                    case 0x07: { attrData = "TYPE_CORE"; break; } -                    case 0x08: { attrData = "TYPE_L2"; break; } -                    case 0x09: { attrData = "TYPE_L3"; break; } -                    case 0x0A: { attrData = "TYPE_L4"; break; } -                    case 0x0B: { attrData = "TYPE_MCS"; break; } -                    case 0x0C: { attrData = "TYPE_MBS"; break; } -                    case 0x0D: { attrData = "TYPE_MBA"; break; } -                    case 0x0E: { attrData = "TYPE_XBUS"; break; } -                    case 0x0F: { attrData = "TYPE_ABUS"; break; } -                    case 0x10: { attrData = "TYPE_PCI"; break; } -                    case 0x11: { attrData = "TYPE_DPSS"; break; } -                    case 0x12: { attrData = "TYPE_APSS"; break; } -                    case 0x13: { attrData = "TYPE_OCC"; break; } -                    case 0x14: { attrData = "TYPE_PSI"; break; } -                    case 0x15: { attrData = "TYPE_FSP"; break; } -                    case 0x16: { attrData = "TYPE_PNOR"; break; } -                    case 0x17: { attrData = "TYPE_LAST_IN_RANGE"; break; } -                    default:   { attrData = "UNKNOWN TYPE"; break; } -                } // switch -                i_parser.PrintString("ATTR_TYPE", attrData); -                i++; -                l_ptr++; - -                // MODEL -                switch (*l_ptr) { -                    // TODO: RTC 50828: make these build-time dynamic based -                    //  on values in obj/genfiles/attributeenums.H -                    case 0x00: { attrData = "MODEL_NA"; break; } -                    case 0x10: { attrData = "MODEL_RESERVED"; break; } -                    case 0x11: { attrData = "MODEL_VENICE"; break; } -                    case 0x12: { attrData = "MODEL_MURANO"; break; } -                    case 0x30: { attrData = "MODEL_CENTAUR"; break; } -                    case 0x50: { attrData = "MODEL_JEDEC"; break; } -                    case 0x51: { attrData = "MODEL_CDIMM"; break; } -                    case 0x70: { attrData = "MODEL_POWER8"; break; } -                    default:   { attrData = "UNKNOWN MODEL"; break; } -                } // switch -                i_parser.PrintString("ATTR_MODEL", attrData); -                i++; -                l_ptr++; -            } - -// TODO RTC 50828 The following for loop hangs -#if 0 -            for (; i < i_buflen; ) -            { -                if ((*l_ptr == 0x15) || // ATTR_PHYS_PATH -                    (*l_ptr == 0x16))   // ATTR_AFFINITY_PATH -                { -                    l_ptr++; -                    const char *pathString; -                    char outString[128]; -                    // from targeting/common/entitypath.[CH] -                    // entityPath is PATH_TYPE:4, NumberOfElements:4,  -                    //          [Element, Instance#] -                    // PATH_TYPE -                    const uint8_t pathTypeLength = *((uint8_t *)l_ptr); -                    l_ptr++; -                    const uint8_t pathType = (pathTypeLength & 0xF0) >> 4; -                    switch (pathType) { -                        case 0x01: pathString = "Logical:"; break; -                        case 0x02: pathString = "Physical:"; break; -                        case 0x03: pathString = "Device:"; break; -                        case 0x04: pathString = "Power:"; break; -                        default:   pathString = "Unknown:"; break; -                    } -                    uint32_t dataSize = sprintf(outString, "%s",pathString); -                    const uint8_t pathSize = (pathTypeLength & 0x0F); -                    uint8_t *lElementInstance = ((uint8_t *)l_ptr); -                    l_ptr += pathSize * sizeof(uint8_t); -                    for (uint32_t j=0;j<pathSize;j += 2) { -                        switch (lElementInstance[j]) { -                            // TODO: RTC 50828: make these build-time dynamic based -                            //  on values in obj/genfiles/attributeenums.H -                            case 0x01: pathString = "/Sys"; break; -                            case 0x02: pathString = "/Node"; break; -                            case 0x03: pathString = "/DIMM"; break; -                            case 0x04: pathString = "/Membuf"; break; -                            case 0x05: pathString = "/Proc"; break; -                            case 0x06: pathString = "/EX"; break; -                            case 0x07: pathString = "/Core"; break; -                            case 0x08: pathString = "/L2"; break; -                            case 0x09: pathString = "/L3"; break; -                            case 0x0A: pathString = "/L4"; break; -                            case 0x0B: pathString = "/MCS"; break; -                            case 0x0C: pathString = "/MBS"; break; -                            case 0x0D: pathString = "/MBA"; break; -                            case 0x0E: pathString = "/XBUS"; break; -                            case 0x0F: pathString = "/ABUS"; break; -                            case 0x10: pathString = "/PCI"; break; -                            case 0x11: pathString = "/DPSS"; break; -                            case 0x12: pathString = "/APSS"; break; -                            case 0x13: pathString = "/OCC"; break; -                            case 0x14: pathString = "/PSI"; break; -                            case 0x15: pathString = "/FSP"; break; -                            case 0x16: pathString = "/PNOR"; break; -                            default: pathString = "/Unknown"; break; -                        } // switch -                        // copy next part in, overwritting previous terminator -                        dataSize += sprintf(outString + dataSize, -                                            "%s%d", pathString, -                                            lElementInstance[j+1]); -                    } // for -                    if (*l_ptr == 0x15) // ATTR_PHYS_PATH -                    { -                      i_parser.PrintString("ATTR_PHYS_PATH", outString); -                    } -                    else -                    { -                      i_parser.PrintString("ATTR_AFFINITY_PATH", outString); -                    } -                } -            } // for -#endif -        } -    } // parse() - -private: -    // Disabled -    ErrlUserDetailsParserTarget(const ErrlUserDetailsParserTarget &); -    ErrlUserDetailsParserTarget & operator=( -        const ErrlUserDetailsParserTarget &); -}; - -} - -#endif - diff --git a/src/usr/errl/test/errltest.H b/src/usr/errl/test/errltest.H index 598d29b01..f02a8ca98 100644 --- a/src/usr/errl/test/errltest.H +++ b/src/usr/errl/test/errltest.H @@ -435,7 +435,7 @@ public:              // SENTINEL not logged properly // deconfigCount++;              errl->addProcedureCallout( -                    HWAS::EPUB_PRC_MEMORY_UE, +                    HWAS::EPUB_PRC_MEMORY_PLUGGING_ERROR,                      HWAS::SRCI_PRIORITY_HIGH);              errlCommit(errl, CXXTEST_COMP_ID); diff --git a/src/usr/errl/test/errluserdetailtest.H b/src/usr/errl/test/errluserdetailtest.H index 825ff5e49..9349d82e8 100644 --- a/src/usr/errl/test/errluserdetailtest.H +++ b/src/usr/errl/test/errluserdetailtest.H @@ -39,7 +39,7 @@  #include <errl/errludtarget.H>  #include <errl/errludlogregister.H>  #include <errl/errludcallout.H> -#include <errludattribute.H> +#include <errl/errludattribute.H>  #include <targeting/common/targetservice.H>  #include <targeting/common/iterators/rangefilter.H>  #include <targeting/common/predicates/predicates.H> @@ -142,17 +142,17 @@ public:          c_target = *pProc;          TS_TRACE( "testAttribute pProc %p", c_target);          ErrlUserDetailsTarget(c_target).addToLog(errl); -        ErrlUserDetailsTarget( -            TARGETING::MASTER_PROCESSOR_CHIP_TARGET_SENTINEL).addToLog(errl);          // all attributes          ErrlUserDetailsAttribute(c_target).addToLog(errl);          // HUID repeated for each addToLog() +        ErrlUserDetailsTarget(c_target).addToLog(errl);          ErrlUserDetailsAttribute(c_target,ATTR_EC).addToLog(errl);          ErrlUserDetailsAttribute(c_target,ATTR_CHIP_ID).addToLog(errl);          // 1 HUID only +        ErrlUserDetailsTarget(c_target).addToLog(errl);          ErrlUserDetailsAttribute(c_target,ATTR_HUID).addToLog(errl);          // HUID only - not there @@ -234,7 +234,7 @@ public:          // done - write it out          pDimmEUDA.addToLog(errl); -#if 1 +#if 0          // extended test          uint32_t i = 0;          for (TargetIterator target = targetService().begin(); @@ -561,7 +561,7 @@ public:              gardCount++;              ErrlUserDetailsCallout( -                        HWAS::EPUB_PRC_MEMORY_UE, +                        HWAS::EPUB_PRC_FSI_PATH,                          HWAS::SRCI_PRIORITY_HIGH).addToLog(errl);              // commit the errorlog  | 

