-
Notifications
You must be signed in to change notification settings - Fork 97
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Log Hostboot state information in all error logs
Add the Istep number and substep number to Hostboot Error Logs to assist in problem debug. These items will be added as a user data record to all Hostboot Error Logs prior to Runtime. Change-Id: Ib5d269f3c1853d6d6856669744630dc130fa7094 Reviewed-on: http://ralgit01.raleigh.ibm.com/gerrit1/57172 Tested-by: Jenkins Server <pfd-jenkins+hostboot@us.ibm.com> Tested-by: Jenkins OP Build CI <op-jenkins+hostboot@us.ibm.com> Tested-by: Jenkins OP HW <op-hw-jenkins+hostboot@us.ibm.com> Reviewed-by: Daniel M. Crowell <dcrowell@us.ibm.com>
- Loading branch information
1 parent
c78530b
commit 38ec776
Showing
11 changed files
with
366 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,69 @@ | ||
/* IBM_PROLOG_BEGIN_TAG */ | ||
/* This is an automatically generated prolog. */ | ||
/* */ | ||
/* $Source: src/include/usr/errl/errludstate.H $ */ | ||
/* */ | ||
/* OpenPOWER HostBoot Project */ | ||
/* */ | ||
/* Contributors Listed Below - COPYRIGHT 2017,2018 */ | ||
/* [+] 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. */ | ||
/* 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 ERRL_UDSYSSTATE_H | ||
#define ERRL_UDSYSSTATE_H | ||
|
||
/** | ||
* @file errludsysstate.H | ||
* | ||
* Defines the ErrlUserDetailsState class that adds system state | ||
* information to an error log as user detail data | ||
*/ | ||
|
||
#include <errl/errluserdetails.H> | ||
#include <stdint.h> | ||
|
||
|
||
//Forward reference | ||
namespace ERRORLOG | ||
{ | ||
|
||
/** | ||
* @class ErrlUserDetailsSysState | ||
* | ||
* Adds system state information to an error log | ||
*/ | ||
class ErrlUserDetailsSysState : public ErrlUserDetails | ||
{ | ||
public: | ||
/** | ||
* @brief Constructor | ||
*/ | ||
ErrlUserDetailsSysState(); | ||
|
||
/** | ||
* @brief Destructor | ||
*/ | ||
virtual ~ErrlUserDetailsSysState(); | ||
|
||
private: | ||
// Disabled | ||
ErrlUserDetailsSysState(const ErrlUserDetailsSysState &); | ||
ErrlUserDetailsSysState & operator=(const ErrlUserDetailsSysState &); | ||
}; | ||
|
||
} | ||
|
||
#endif |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,68 @@ | ||
/* IBM_PROLOG_BEGIN_TAG */ | ||
/* This is an automatically generated prolog. */ | ||
/* */ | ||
/* $Source: src/usr/errl/errludstate.C $ */ | ||
/* */ | ||
/* OpenPOWER HostBoot Project */ | ||
/* */ | ||
/* Contributors Listed Below - COPYRIGHT 2017,2018 */ | ||
/* [+] 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. */ | ||
/* 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 */ | ||
/** | ||
* @file errludsysstate.C | ||
* | ||
* @brief Implementation of ErrlUserDetailsSysState | ||
*/ | ||
#include <errl/errludstate.H> | ||
#include <errl/errlreasoncodes.H> | ||
#include <initservice/initserviceif.H> | ||
|
||
namespace ERRORLOG | ||
{ | ||
|
||
ErrlUserDetailsSysState::ErrlUserDetailsSysState() | ||
{ | ||
//***** Memory Layout ***** | ||
// 1 bytes : Major Istep | ||
// 1 bytes : Minor Istep | ||
const size_t TOTAL_SIZE = 2; | ||
|
||
uint8_t l_iStep = 0; | ||
uint8_t l_subStep = 0; | ||
|
||
#ifndef __HOSTBOOT_RUNTIME | ||
INITSERVICE::GetIstepData( l_iStep, | ||
l_subStep ); | ||
#endif | ||
|
||
uint8_t* l_buf = reinterpret_cast<uint8_t*>( | ||
reallocUsrBuf(TOTAL_SIZE)); | ||
memset( l_buf, 0, TOTAL_SIZE ); | ||
l_buf[0] = l_iStep; | ||
l_buf[1] = l_subStep; | ||
|
||
// Set up ErrlUserDetails instance variables | ||
iv_CompId = ERRL_COMP_ID; | ||
iv_Version = 1; | ||
iv_SubSection = ERRL_UDT_SYSSTATE; | ||
} | ||
|
||
ErrlUserDetailsSysState::~ErrlUserDetailsSysState() | ||
{ | ||
|
||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,113 @@ | ||
/* IBM_PROLOG_BEGIN_TAG */ | ||
/* This is an automatically generated prolog. */ | ||
/* */ | ||
/* $Source: src/usr/errl/plugins/errludstate.H $ */ | ||
/* */ | ||
/* OpenPOWER HostBoot Project */ | ||
/* */ | ||
/* Contributors Listed Below - COPYRIGHT 2017,2018 */ | ||
/* [+] 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. */ | ||
/* 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 ERRL_UDSTATEP_H | ||
#define ERRL_UDSTATEP_H | ||
|
||
/** | ||
* @file errludsensor.H | ||
* | ||
* Defines the ErrlUserDetailsParserState class that parses system | ||
* state info from user detail in an error log | ||
*/ | ||
|
||
#include "errluserdetails.H" | ||
#include <targeting/common/target.H> | ||
|
||
namespace ERRORLOG | ||
{ | ||
|
||
/** | ||
* @class ErrlUserDetailsParserSysState | ||
* | ||
* Parses System state information from user detail in an error log | ||
*/ | ||
class ErrlUserDetailsParserSysState :public ErrlUserDetailsParser | ||
{ | ||
public: | ||
/** | ||
* @brief Constructor | ||
*/ | ||
ErrlUserDetailsParserSysState() {} | ||
|
||
/** | ||
* @brief Destructor | ||
*/ | ||
virtual ~ErrlUserDetailsParserSysState() {} | ||
|
||
/** | ||
* @brief Parses State 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 Istep state 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 | ||
{ | ||
//***** Memory Layout ***** | ||
// 1 bytes : Major Istep | ||
// 1 bytes : Minor Istep | ||
const size_t TOTAL_SIZE = 2; | ||
|
||
uint8_t* l_data = static_cast<uint8_t*>(i_pBuffer); | ||
|
||
if( i_buflen >= TOTAL_SIZE ) | ||
{ | ||
i_parser.PrintNumber("Current Major Istep", "%d", | ||
l_data[0]); | ||
i_parser.PrintNumber("Current Minor Istep", "%d", | ||
l_data[1]); | ||
|
||
if( i_buflen > TOTAL_SIZE ) | ||
{ | ||
// Print out extra data as hex so that an old parser will | ||
// still display new data that gets logged in the code | ||
i_parser.PrintHexDump( (l_data+2), i_buflen-2 ); | ||
} | ||
} | ||
|
||
else | ||
{ | ||
// Just print out whatever we have if it is less than | ||
// the data size we are aware of | ||
i_parser.PrintNumber("State Buffer length", "0x%X", i_buflen); | ||
i_parser.PrintNumber("Expected length", "0x%X", TOTAL_SIZE); | ||
i_parser.PrintHexDump(i_pBuffer, i_buflen); | ||
} | ||
} | ||
|
||
private: | ||
// Disabled | ||
ErrlUserDetailsParserSysState(const ErrlUserDetailsParserSysState &); | ||
ErrlUserDetailsParserSysState & operator=( | ||
const ErrlUserDetailsParserSysState &); | ||
}; | ||
|
||
} | ||
|
||
#endif |
Oops, something went wrong.