Skip to content

Commit fd18252

Browse files
sannerddcrowell77
authored andcommitted
Update err console display to include PRDF logs
Change-Id: I42ec4de748bcfaf1efd41680e087b9664539a69f Reviewed-on: http://ralgit01.raleigh.ibm.com/gerrit1/37608 Tested-by: Jenkins Server <pfd-jenkins+hostboot@us.ibm.com> Reviewed-by: Zane C. Shelley <zshelle@us.ibm.com> Tested-by: FSP CI Jenkins <fsp-CI-jenkins+hostboot@us.ibm.com> Tested-by: Jenkins OP Build CI <op-jenkins+hostboot@us.ibm.com> Reviewed-by: Caleb N. Palmer <cnpalmer@us.ibm.com> Reviewed-by: William G. Hoffa <wghoffa@us.ibm.com> Reviewed-by: Martin Gloff <mgloff@us.ibm.com> Reviewed-by: Daniel M. Crowell <dcrowell@us.ibm.com>
1 parent efc8d3c commit fd18252

File tree

9 files changed

+228
-17
lines changed

9 files changed

+228
-17
lines changed

src/include/usr/errldisplay/errldisplay.H

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -169,6 +169,11 @@ private:
169169
* @brief Displays a HWPF error log user details
170170
*/
171171
static void displayHwpf (void *data, size_t size, uint8_t i_type);
172+
173+
/**
174+
* @brief Displays a PRDF error log user details
175+
*/
176+
static void displayPrdf (uint64_t i_ud1, uint64_t i_ud2);
172177
};
173178

174179
} // End namespace

src/usr/diag/prdf/common/rule/prdf_rule.mk

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
#
66
# OpenPOWER HostBoot Project
77
#
8-
# Contributors Listed Below - COPYRIGHT 2016
8+
# Contributors Listed Below - COPYRIGHT 2016,2017
99
# [+] International Business Machines Corp.
1010
#
1111
#
@@ -39,6 +39,7 @@ PRDR_RULE_TABLES += p9_mca.prf
3939

4040
prd_rule_prf_targets = ${PRDR_RULE_TABLES}
4141
prd_rule_err_targets = ${PRDR_RULE_TABLES:.prf=.prf.err.C}
42+
prd_rule_disp_targets = ${PRDR_RULE_TABLES:.prf=.prf.disp.C}
4243
prd_rule_reg_targets = ${PRDR_RULE_TABLES:.prf=.prf.reg.C}
4344
prd_rule_html_targets = ${PRDR_RULE_TABLES:.prf=.prf.html}
4445

src/usr/diag/prdf/common/rule/prdrCompile.C

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,9 @@ int main(int argc, char ** argv)
8686
}
8787

8888
std::ofstream l_htmlFile((std::string(argv[1]) + ".html").c_str());
89+
std::ofstream l_htmlDummy(std::string("/dev/null").c_str());
8990
std::ofstream l_errFile((std::string(argv[1]) + ".err.C").c_str());
91+
std::ofstream l_dispFile((std::string(argv[1]) + ".disp.C").c_str());
9092
std::ofstream l_regFile((std::string(argv[1]) + ".reg.C").c_str());
9193

9294
#ifndef __HOSTBOOT_MODULE
@@ -113,6 +115,9 @@ int main(int argc, char ** argv)
113115
l_errFile << "#include <prdrErrlPluginsSupt.H>" << std::endl;
114116
l_errFile << "PRDR_ERROR_SIGNATURE_TABLE_START ";
115117

118+
l_dispFile << "#include <prdrErrlDisplaySupt.H>" << std::endl;
119+
l_dispFile << "PRDR_ERROR_SIGNATURE_TABLE_START ";
120+
116121
// setup register id file.
117122
l_regFile << "#include <prdrErrlPluginsSupt.H>" << std::endl;
118123
l_regFile << "PRDR_REGISTER_ID_TABLE_START ";
@@ -163,6 +168,11 @@ int main(int argc, char ** argv)
163168
<< std::hex << g_currentChip->cv_signatureOffset
164169
<< " )" << std::endl;
165170

171+
// set error register HOM_TYPE
172+
l_dispFile << "( 0x" << std::hex << g_currentChip->cv_targetType << ", 0x"
173+
<< std::hex << g_currentChip->cv_signatureOffset
174+
<< " )" << std::endl;
175+
166176
// output bit groups
167177
uint32_t l_pos = 0;
168178
l_size = htons((uint16_t)g_groups.size());
@@ -187,6 +197,7 @@ int main(int argc, char ** argv)
187197
{
188198
(*i).second->output(l_prfFile);
189199
(*i).second->generateDoxygen(l_htmlFile, (*i).first, l_errFile);
200+
(*i).second->generateDoxygen(l_htmlDummy, (*i).first, l_dispFile);
190201
}
191202

192203
// output action classes.
@@ -218,6 +229,7 @@ int main(int argc, char ** argv)
218229

219230
// Add chip's extra signatures.
220231
l_errFile << "//---- Extra Signatures ----" << std::endl;
232+
l_dispFile << "//---- Extra Signatures ----" << std::endl;
221233
for (std::list<ExtraSignature>::iterator i
222234
= g_currentChip->cv_sigExtras.begin();
223235
i != g_currentChip->cv_sigExtras.end();
@@ -227,11 +239,19 @@ int main(int argc, char ** argv)
227239
<< std::setfill('0') << std::setw(8) << std::hex
228240
<< i->iv_sig << ", " << *(i->iv_sname) << ", "
229241
<< *(i->iv_desc) << ")" << std::endl;
242+
243+
l_dispFile << "\tPRDR_ERROR_SIGNATURE ( 0x"
244+
<< std::setfill('0') << std::setw(8) << std::hex
245+
<< i->iv_sig << ", " << *(i->iv_sname) << ", "
246+
<< *(i->iv_desc) << ")" << std::endl;
230247
}
231248

232249
l_errFile << "PRDR_ERROR_SIGNATURE_TABLE_END" << std::endl;
233250
l_errFile.close();
234251

252+
l_dispFile << "PRDR_ERROR_SIGNATURE_TABLE_END" << std::endl;
253+
l_dispFile.close();
254+
235255
l_regFile << "PRDR_REGISTER_ID_TABLE_END" << std::endl;
236256
l_regFile.close();
237257

Lines changed: 103 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,103 @@
1+
/* IBM_PROLOG_BEGIN_TAG */
2+
/* This is an automatically generated prolog. */
3+
/* */
4+
/* $Source: src/usr/diag/prdf/plugins/prdrErrlDisplaySupt.H $ */
5+
/* */
6+
/* OpenPOWER HostBoot Project */
7+
/* */
8+
/* Contributors Listed Below - COPYRIGHT 2005,2017 */
9+
/* [+] International Business Machines Corp. */
10+
/* */
11+
/* */
12+
/* Licensed under the Apache License, Version 2.0 (the "License"); */
13+
/* you may not use this file except in compliance with the License. */
14+
/* You may obtain a copy of the License at */
15+
/* */
16+
/* http://www.apache.org/licenses/LICENSE-2.0 */
17+
/* */
18+
/* Unless required by applicable law or agreed to in writing, software */
19+
/* distributed under the License is distributed on an "AS IS" BASIS, */
20+
/* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or */
21+
/* implied. See the License for the specific language governing */
22+
/* permissions and limitations under the License. */
23+
/* */
24+
/* IBM_PROLOG_END_TAG */
25+
26+
#ifndef __PRDRERRLDISPLAYSUPT_H
27+
#define __PRDRERRLDISPLAYSUPT_H
28+
29+
#define __PRDR_PLUGIN_HUID uint32_t
30+
#define __PRDR_PLUGIN_IDTYPE uint32_t
31+
32+
#define __PRDR_PLUGIN_XY(X,Y,Z) X##Y##_##Z
33+
#define __PRDR_PLUGIN_MAKENAME(X,Y,Z) __PRDR_PLUGIN_XY(X,Y,Z)
34+
35+
#ifndef PRDR_ERROR_SIGNATURE_TABLE_START
36+
#define PRDR_ERROR_SIGNATURE_TABLE_START( homtype, offset) \
37+
namespace PRDF \
38+
{\
39+
namespace HOSTBOOT \
40+
{ \
41+
class __PRDR_PLUGIN_MAKENAME(PrdrPlugin_ErrTable_Reg_, homtype, offset)\
42+
{ \
43+
public: \
44+
__PRDR_PLUGIN_MAKENAME(PrdrPlugin_ErrTable_Reg_, \
45+
homtype, offset)(); \
46+
private: \
47+
struct __table_struct \
48+
{ \
49+
uint32_t signature; \
50+
const char * name; \
51+
const char * brief; \
52+
}; \
53+
static __table_struct cv_table[]; \
54+
}; \
55+
__PRDR_PLUGIN_MAKENAME(PrdrPlugin_ErrTable_Reg_, homtype, offset) \
56+
__PRDR_PLUGIN_MAKENAME(g_PrdrPlugin_errTable_Reg_, homtype, offset);\
57+
__PRDR_PLUGIN_MAKENAME(PrdrPlugin_ErrTable_Reg_, homtype, offset)::\
58+
__PRDR_PLUGIN_MAKENAME(PrdrPlugin_ErrTable_Reg_, homtype, offset)() \
59+
{ \
60+
__PRDR_PLUGIN_HUID l_homtype = homtype; \
61+
__table_struct * l_tablePtr = cv_table; \
62+
while (NULL != l_tablePtr->name) \
63+
{ \
64+
GetErrorSigTable()[l_homtype][l_tablePtr->signature] = \
65+
std::pair<const char*, const char*> \
66+
(l_tablePtr->name,l_tablePtr->brief); \
67+
l_tablePtr++; \
68+
} \
69+
} \
70+
__PRDR_PLUGIN_MAKENAME(PrdrPlugin_ErrTable_Reg_, homtype, offset):: \
71+
__table_struct \
72+
__PRDR_PLUGIN_MAKENAME(PrdrPlugin_ErrTable_Reg_, homtype, offset):: \
73+
cv_table[] = \
74+
{
75+
76+
#define PRDR_ERROR_SIGNATURE( signature , name, brief ) \
77+
{ signature , name , brief } ,
78+
79+
#define PRDR_ERROR_SIGNATURE_TABLE_END \
80+
{ 0, NULL, NULL } \
81+
}; \
82+
} \
83+
} // end namespace PRDF
84+
#endif
85+
86+
#include <map>
87+
#include <stdint.h>
88+
89+
namespace PRDF
90+
{
91+
namespace HOSTBOOT
92+
{
93+
94+
typedef std::map<__PRDR_PLUGIN_IDTYPE,
95+
std::pair<const char*, const char*>> PrdrErrSigEntries;
96+
typedef std::map<__PRDR_PLUGIN_HUID, PrdrErrSigEntries> PrdrErrSigTable;
97+
98+
PrdrErrSigTable & GetErrorSigTable();
99+
100+
} // namespace HOSTBBOT
101+
} // end namespace PRDF
102+
103+
#endif

src/usr/diag/prdf/rule/makefile

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,7 @@ PRDR_CMP_FLEX_C_PATH = ${OBJ_RULE_DIR}/${PRDR_CMP_FLEX_C}
7373

7474
PRF_IMG_PATHS = $(addprefix ${IMGDIR}/, ${prd_rule_prf_targets})
7575
ERR_PLUGIN_PATHS = $(addprefix ${OBJ_PLUG_DIR}/, ${prd_rule_err_targets})
76+
ERR_DISPLAY_PATHS= $(addprefix ${OBJ_PLUG_DIR}/, ${prd_rule_disp_targets})
7677
REG_PLUGIN_PATHS = $(addprefix ${OBJ_PLUG_DIR}/, ${prd_rule_reg_targets})
7778

7879
#-------------------------------------------------------------------------------
@@ -105,6 +106,7 @@ LINK_PLUGIN_FILES += $(addprefix ${OBJ_PLUG_DIR}/,$(notdir ${SOURCE_PLUGIN_FILES
105106

106107
CODE_PASS_BODY += ${PRF_IMG_PATHS}
107108
CODE_PASS_BODY += ${ERR_PLUGIN_PATHS}
109+
CODE_PASS_BODY += ${ERR_DISPLAY_PATHS}
108110
CODE_PASS_BODY += ${REG_PLUGIN_PATHS}
109111
CODE_PASS_BODY += ${LINK_PLUGIN_FILES}
110112

@@ -117,10 +119,12 @@ CLEAN_TARGETS += ${PRDR_CMP_FLEX_o_PATH}
117119
CLEAN_TARGETS += ${PRDR_CMP_FLEX_C_PATH}
118120
CLEAN_TARGETS += $(addprefix ${OBJ_RULE_DIR}/, ${prd_rule_prf_targets})
119121
CLEAN_TARGETS += $(addprefix ${OBJ_RULE_DIR}/, ${prd_rule_err_targets})
122+
CLEAN_TARGETS += $(addprefix ${OBJ_RULE_DIR}/, ${prd_rule_disp_targets})
120123
CLEAN_TARGETS += $(addprefix ${OBJ_RULE_DIR}/, ${prd_rule_reg_targets})
121124
CLEAN_TARGETS += $(addprefix ${OBJ_RULE_DIR}/, ${prd_rule_html_targets})
122125
CLEAN_TARGETS += ${PRF_IMG_PATHS}
123126
CLEAN_TARGETS += ${ERR_PLUGIN_PATHS}
127+
CLEAN_TARGETS += ${ERR_DISPLAY_PATHS}
124128
CLEAN_TARGETS += ${REG_PLUGIN_PATHS}
125129
CLEAN_TARGETS += ${LINK_PLUGIN_FILES}
126130

@@ -211,6 +215,7 @@ PRDRPP_SEARCHDIRS = -I../common/plat/p9 \
211215

212216
${OBJ_RULE_DIR}/%.prf \
213217
${OBJ_RULE_DIR}/%.prf.err.C \
218+
${OBJ_RULE_DIR}/%.prf.disp.C \
214219
${OBJ_RULE_DIR}/%.prf.reg.C : %.rule ${PRDR_CMP_PATH}
215220
${PRD_OUT_MAKE}
216221
$(C1)cat $< | ${SRC_USR_DIR}/common/rule/prdrpp \
@@ -226,6 +231,7 @@ ${PRF_IMG_PATHS}: ${IMGDIR}/% : ${OBJ_RULE_DIR}/%
226231

227232
# Link all .prf.err.C and .prf.reg.C files from OBJ_RULE_DIR to OBJ_PLUG_DIR
228233
${ERR_PLUGIN_PATHS} \
234+
${ERR_DISPLAY_PATHS} \
229235
${REG_PLUGIN_PATHS}: ${OBJ_PLUG_DIR}/% : ${OBJ_RULE_DIR}/% | ${OBJ_PLUG_DIR}
230236
${PRD_OUT_LINK}
231237
$(C1)ln -sf ${OBJ_RULE_LINK_DIR}/$(notdir $^) $@

src/usr/errl/parser/genErrlParsers.pl

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -153,13 +153,10 @@
153153

154154
# Strip off any leading zeroes from the component value
155155
$compValue =~ s/^0//g;
156-
# Do not add PRDF component ID
157-
if ($compId ne "PRDF_COMP_ID")
158-
{
159-
$compIdToValueHash{$compId} = $compValue;
160-
# Need the integer value for compId sorting purposes
161-
$compIdToHexValueHash{$compId} = hex $compValue;
162-
}
156+
157+
$compIdToValueHash{$compId} = $compValue;
158+
# Need the integer value for compId sorting purposes
159+
$compIdToHexValueHash{$compId} = hex $compValue;
163160
}
164161
}
165162

src/usr/errldisplay/errldisplay.C

Lines changed: 75 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -65,13 +65,28 @@
6565
#include <console/consoleif.H>
6666
#include <targeting/common/targetservice.H>
6767
#include <targeting/common/iterators/targetiterator.H>
68+
#include <targeting/common/target.H>
6869

6970
#ifdef CONFIG_CONSOLE_OUTPUT_FFDCDISPLAY
7071
//Generated hearder files for HWP parsing
7172
#include <hbfwErrDisplayPlatHwpErr.H>
7273
#include <hbfwErrDisplayPlatHwpFFDC.H>
74+
#include <prdrErrlDisplaySupt.H>
75+
76+
namespace PRDF
77+
{
78+
namespace HOSTBOOT
79+
{
80+
PrdrErrSigTable & GetErrorSigTable()
81+
{
82+
static PrdrErrSigTable l_sigTable = PrdrErrSigTable();
83+
return l_sigTable;
84+
}
85+
}
86+
}
7387
#endif
7488

89+
7590
namespace ERRORLOGDISPLAY
7691
{
7792

@@ -97,11 +112,10 @@ static const ErrLogDisplay::errLogInfo unknownErrorInfo = {
97112
"<none>", // Description
98113
"unknown", // Module Name
99114
"unknown", // Reason
100-
"unknown", // User Data 1 string
101-
"unknown" // User Data 2 string
115+
"", // User Data 1 string
116+
"" // User Data 2 string
102117
};
103118

104-
105119
ErrLogDisplay& errLogDisplay()
106120
{
107121
return Singleton<ErrLogDisplay>::instance();
@@ -184,6 +198,50 @@ void displayCalloutTarget (uint8_t * epRaw, size_t& o_size)
184198
free(tmp_str);
185199
}
186200

201+
void ErrLogDisplay::displayPrdf (uint64_t i_ud1, uint64_t i_ud2)
202+
{
203+
//PRD stores the HUID of the callout in top word of ud1
204+
// and the signature in the top word of ud2
205+
uint32_t l_huid = i_ud1 >> 32;
206+
uint32_t l_sig = i_ud2 >> 32;
207+
208+
CONSOLE::displayf(NULL, " PRD Signature : 0x%X 0x%X",
209+
l_huid, l_sig);
210+
211+
#ifdef CONFIG_CONSOLE_OUTPUT_FFDCDISPLAY
212+
//Find the Target from the HUID
213+
TARGETING::Target* l_pTopLevel = NULL;
214+
TARGETING::targetService().getTopLevelTarget(l_pTopLevel);
215+
TARGETING::Target * l_target = l_pTopLevel->getTargetFromHuid(l_huid);
216+
217+
if(l_target)
218+
{
219+
TARGETING::TYPE l_targetType =
220+
l_target->getAttr<TARGETING::ATTR_TYPE>();
221+
222+
const char * l_nameStr =
223+
PRDF::HOSTBOOT::GetErrorSigTable()[l_targetType][l_sig].first;
224+
const char * l_descStr =
225+
PRDF::HOSTBOOT::GetErrorSigTable()[l_targetType][l_sig].second;
226+
227+
TARGETING::ATTR_FAPI_NAME_type l_fapiStr = {0};
228+
l_target->tryGetAttr<TARGETING::ATTR_FAPI_NAME>(l_fapiStr);
229+
230+
if(l_nameStr)
231+
{
232+
CONSOLE::displayf(NULL, " Signature Description : %s (%s) %s",
233+
l_fapiStr, l_nameStr, l_descStr);
234+
}
235+
else
236+
{
237+
CONSOLE::displayf(NULL, " Signature Description : %s UNKNOWN",
238+
l_fapiStr);
239+
}
240+
}
241+
#endif
242+
}
243+
244+
187245
void ErrLogDisplay::displayCallout (void *data, size_t size)
188246
{
189247
CONSOLE::displayf(NULL,
@@ -504,17 +562,27 @@ void ErrLogDisplay::msgDisplay (const errlHndl_t &i_err,
504562
CONSOLE::displayf(NULL, "Error reported by %s (0x%04X) PLID 0x%08X",
505563
findComponentName( i_committerComp ),
506564
i_committerComp, i_err->plid() );
507-
CONSOLE::displayf(NULL, " %s", info->descriptString);
508-
CONSOLE::displayf(NULL, " ModuleId 0x%02x %s",
565+
566+
//PRD doesn't follow the rest of the HB conventions
567+
// Handle them special
568+
if(i_committerComp == PRDF_COMP_ID)
569+
{
570+
displayPrdf(i_err->getUserData1(), i_err->getUserData2());
571+
}
572+
else
573+
{
574+
CONSOLE::displayf(NULL, " %s", info->descriptString);
575+
CONSOLE::displayf(NULL, " ModuleId 0x%02x %s",
509576
i_err->moduleId(), info->moduleName);
510-
CONSOLE::displayf(NULL, " ReasonCode 0x%04x %s",
577+
CONSOLE::displayf(NULL, " ReasonCode 0x%04x %s",
511578
i_err->reasonCode(), info->reasonString);
579+
}
580+
512581
CONSOLE::displayf(NULL, " UserData1 %s : 0x%016lx",
513582
info->userData1String, i_err->getUserData1());
514583
CONSOLE::displayf(NULL, " UserData2 %s : 0x%016lx",
515584
info->userData2String, i_err->getUserData2());
516585

517-
518586
// Loop through and print interesting user data sections.
519587
for ( size_t i = 0; i < i_err->iv_SectionVector.size(); ++i )
520588
{

0 commit comments

Comments
 (0)