From caf328ccd931de4ce4e4d285d1a4e5ddd151abb5 Mon Sep 17 00:00:00 2001 From: Mike Jones Date: Tue, 22 Jan 2013 09:41:25 -0600 Subject: ERRL: Create Hostboot error log SRC/UD parser and deliver to FSP bld A new script called genErrlParsers will scan the Hostboot code for error log tags and create a SRC parser for each component. The script will also scan the Hostboot code for plugin directories containing User Detail Data parsers and will create a makefile that is used by the FSP to build each component's SRC/UD parser. Change-Id: I7113f6cd8069447a1caaa199aff199b663d59072 RTC: 47518 Reviewed-on: http://gfw160.austin.ibm.com:8080/gerrit/2975 Tested-by: Jenkins Server Reviewed-by: A. Patrick Williams III --- src/usr/hwpf/plugins/HWPF_COMP_ID_Parse.C | 32 +++++++ src/usr/hwpf/plugins/fapiPlatUdParserHwp.H | 129 +++++++++++++++++++++++++++++ src/usr/hwpf/plugins/hwpfParse.C | 34 -------- src/usr/hwpf/plugins/hwpfUdParserFactory.H | 69 +++++++++++++++ src/usr/hwpf/plugins/hwpistepud.H | 99 ++++++++++++++++++++++ src/usr/hwpf/plugins/makefile | 47 ----------- 6 files changed, 329 insertions(+), 81 deletions(-) create mode 100644 src/usr/hwpf/plugins/HWPF_COMP_ID_Parse.C create mode 100644 src/usr/hwpf/plugins/fapiPlatUdParserHwp.H delete mode 100644 src/usr/hwpf/plugins/hwpfParse.C create mode 100644 src/usr/hwpf/plugins/hwpfUdParserFactory.H create mode 100644 src/usr/hwpf/plugins/hwpistepud.H delete mode 100644 src/usr/hwpf/plugins/makefile (limited to 'src/usr/hwpf/plugins') diff --git a/src/usr/hwpf/plugins/HWPF_COMP_ID_Parse.C b/src/usr/hwpf/plugins/HWPF_COMP_ID_Parse.C new file mode 100644 index 000000000..c67f27f27 --- /dev/null +++ b/src/usr/hwpf/plugins/HWPF_COMP_ID_Parse.C @@ -0,0 +1,32 @@ +/* IBM_PROLOG_BEGIN_TAG */ +/* This is an automatically generated prolog. */ +/* */ +/* $Source: src/usr/hwpf/plugins/HWPF_COMP_ID_Parse.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 HWPF_COMP_ID_Parse.C + * + * HWPF user data parser + */ +#include "errludparser.H" +#include "hwpfUdParserFactory.H" + +ERRL_MAKE_UD_PARSER(fapi::HwpfUserDetailsParserFactory, hbfw::HWPF_COMP_ID) + diff --git a/src/usr/hwpf/plugins/fapiPlatUdParserHwp.H b/src/usr/hwpf/plugins/fapiPlatUdParserHwp.H new file mode 100644 index 000000000..1296fb8a8 --- /dev/null +++ b/src/usr/hwpf/plugins/fapiPlatUdParserHwp.H @@ -0,0 +1,129 @@ +/* IBM_PROLOG_BEGIN_TAG */ +/* This is an automatically generated prolog. */ +/* */ +/* $Source: src/usr/hwpf/plugins/fapiPlatUdParserHwp.H $ */ +/* */ +/* IBM CONFIDENTIAL */ +/* */ +/* COPYRIGHT International Business Machines Corp. 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 FAPIPLATUDPARSERHWP_H +#define FAPIPLATUDPARSERHWP_H + +/** + * @file fapiPlatUdParserHwp.H + * + * Defines ErrlUserDetailsParser subclasses to parse the different types of HWP + * FFDC added as user detail data to an error log. + * + * Note that there are no corresponding ErrlUserDetails subclasses to create + * the user detail data because it is created by the platform neutral + * fapi::ReturnCode + */ +#include "errluserdetails.H" +#include "fapiPlatHwpErrParser.H" + +namespace fapi +{ + +/** + * @class PlatUserDetailsParserHwpRcValue + * + * Parses the HWP RcValue in an error log. + */ +class PlatUserDetailsParserHwpRcValue : public ERRORLOG::ErrlUserDetailsParser +{ +public: + /** + * @brief Constructor + */ + PlatUserDetailsParserHwpRcValue() {} + + /** + * @brief Destructor + */ + virtual ~PlatUserDetailsParserHwpRcValue() {} + + /** + * @brief Parses the HWP RcValue in 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 + { + // Call a FAPI generated function to parse the return code + fapiParseHwpRc(i_parser, i_pBuffer, i_buflen); + } + +private: + // Disabled + PlatUserDetailsParserHwpRcValue(const PlatUserDetailsParserHwpRcValue &); + PlatUserDetailsParserHwpRcValue & operator=( + const PlatUserDetailsParserHwpRcValue &); +}; + +/** + * @class PlatUserDetailsParserHwpTarget + * + * Parses HWP FFDC in an error log. + */ +class PlatUserDetailsParserHwpFfdc : public ERRORLOG::ErrlUserDetailsParser +{ +public: + /** + * @brief Constructor + */ + PlatUserDetailsParserHwpFfdc() {} + + /** + * @brief Destructor + */ + virtual ~PlatUserDetailsParserHwpFfdc() {} + + /** + * @brief Parses HWP FFDC in 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 + { + // Call a FAPI generated function to parse the FFDC + fapiParseHwpFfdc(i_parser, i_pBuffer, i_buflen); + } + +private: + // Disabled + PlatUserDetailsParserHwpFfdc(const PlatUserDetailsParserHwpFfdc &); + PlatUserDetailsParserHwpFfdc & operator=( + const PlatUserDetailsParserHwpFfdc &); +}; + +} + +#endif + diff --git a/src/usr/hwpf/plugins/hwpfParse.C b/src/usr/hwpf/plugins/hwpfParse.C deleted file mode 100644 index 5fe7af402..000000000 --- a/src/usr/hwpf/plugins/hwpfParse.C +++ /dev/null @@ -1,34 +0,0 @@ -/* IBM_PROLOG_BEGIN_TAG */ -/* This is an automatically generated prolog. */ -/* */ -/* $Source: src/usr/hwpf/plugins/hwpfParse.C $ */ -/* */ -/* IBM CONFIDENTIAL */ -/* */ -/* COPYRIGHT International Business Machines Corp. 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 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 hwpfParse.C - * - * HWPF user data parser - */ -#include -#include -#include - -ERRL_MAKE_UD_PARSER(fapi::PlatUserDetailsParserFactory, HWPF_COMP_ID) -ERRL_MAKE_UD_PARSER(ISTEP_ERROR::HwpIstepUserDetailsParserFactory, HWPF_COMP_ID) - diff --git a/src/usr/hwpf/plugins/hwpfUdParserFactory.H b/src/usr/hwpf/plugins/hwpfUdParserFactory.H new file mode 100644 index 000000000..95a732ec1 --- /dev/null +++ b/src/usr/hwpf/plugins/hwpfUdParserFactory.H @@ -0,0 +1,69 @@ +/* IBM_PROLOG_BEGIN_TAG */ +/* This is an automatically generated prolog. */ +/* */ +/* $Source: src/usr/hwpf/plugins/hwpfUdParserFactory.H $ */ +/* */ +/* IBM CONFIDENTIAL */ +/* */ +/* COPYRIGHT International Business Machines Corp. 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 HWPFUDPARSERFACTORY_H +#define HWPFUDPARSERFACTORY_H + +/** + * @file fapiPlatHwpUdDecode.H + * + * Defines the PlatUserDetailsParserFactory class + */ +#include "errludparserfactory.H" +#include "fapiPlatUdParserHwp.H" +#include "hwpistepud.H" + +namespace fapi +{ + +/** + * @class Hwpf UserDetailsParserFactory + * + * This factory produces ErrlUserDetailsParser objects to parse the specified + * HWPF user detail data. + */ +class HwpfUserDetailsParserFactory : public ERRORLOG::ErrlUserDetailsParserFactory +{ +public: + + /** + * @brief Constructor + */ + HwpfUserDetailsParserFactory() + { + registerParser(HWPF_UDT_HWP_RCVALUE); + registerParser(HWPF_UDT_HWP_FFDC); + registerParser + (HWPF_UDT_STEP_ERROR_DETAILS); + } + +private: + // Disabled + HwpfUserDetailsParserFactory(const HwpfUserDetailsParserFactory &); + HwpfUserDetailsParserFactory & operator=( + const HwpfUserDetailsParserFactory &); +}; + +} + +#endif + diff --git a/src/usr/hwpf/plugins/hwpistepud.H b/src/usr/hwpf/plugins/hwpistepud.H new file mode 100644 index 000000000..8d17e9130 --- /dev/null +++ b/src/usr/hwpf/plugins/hwpistepud.H @@ -0,0 +1,99 @@ +/* IBM_PROLOG_BEGIN_TAG */ +/* This is an automatically generated prolog. */ +/* */ +/* $Source: src/usr/hwpf/plugins/hwpistepud.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 INITSVC_UDSTEP_H +#define INITSVC_UDSTEP_H + +/** + * @file initsvcudistep.H + * + * Defines the HwpUserDetailsParserIstep class that parses + * IStep FFDC user detail in an error log + */ + +#include "errluserdetails.H" + +namespace ISTEP_ERROR +{ + /** + * @struct IStepUserDetailsIstepData + * + * Defines the user detail data + */ + struct HwpUserDetailsIstepErrorData + { + uint32_t eid; + uint32_t reasoncode; + }; + + /** + * @class HwpUserDetailsParserIstep + * + * Parses Istep user detail in an error log + */ + class HwpUserDetailsParserIstep : public ERRORLOG::ErrlUserDetailsParser + { + public: + /** + * @brief Constructor + */ + HwpUserDetailsParserIstep() {} + + /** + * @brief Destructor + */ + virtual ~HwpUserDetailsParserIstep() {} + + /** + * @brief Parses Istep 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 + { + HwpUserDetailsIstepErrorData * l_pData = + static_cast(i_pBuffer); + + i_parser.PrintNumber("See error log ID:","0x%X", + ntohl(l_pData->eid)); + + i_parser.PrintNumber("Reasoncode:","0x%X", + ntohl(l_pData->reasoncode) ); + } + + private: + // Disabled + HwpUserDetailsParserIstep(const HwpUserDetailsParserIstep &); + HwpUserDetailsParserIstep & operator=( + const HwpUserDetailsParserIstep &); + }; +} + +#endif + diff --git a/src/usr/hwpf/plugins/makefile b/src/usr/hwpf/plugins/makefile deleted file mode 100644 index 891249f93..000000000 --- a/src/usr/hwpf/plugins/makefile +++ /dev/null @@ -1,47 +0,0 @@ -# IBM_PROLOG_BEGIN_TAG -# This is an automatically generated prolog. -# -# $Source: src/usr/hwpf/plugins/makefile $ -# -# IBM CONFIDENTIAL -# -# COPYRIGHT International Business Machines Corp. 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 -# This is a FipS makefile. - -# Include the common hostboot plugins makefile -.include "../plugins.mk" - -MY_PLUGIN = libB-0900 -MY_OBJS = hwpfParse.o - -.if ( $(CONTEXT) == "x86.nfp" ) - -LIBRARIES = ${MY_PLUGIN}.a -EXPLIBS = ${MY_PLUGIN}.a -${MY_PLUGIN}.a_OFILES = ${MY_OBJS} - -.else - -BUILD_SHARED_OBJS = -SHARED_LIBRARIES EXPSHLIBS = ${MY_PLUGIN}.so -${MY_PLUGIN}.so_EXTRA_LIBS = libbase.so -${MY_PLUGIN}.so_SHLDFLAGS += ${SHLDFLAGS} -Wl,-soname,${.TARGET} -${MY_PLUGIN}.so_OFILES = ${MY_OBJS} - -.endif - -.include <${RULES_MK}> -- cgit v1.2.3