summaryrefslogtreecommitdiffstats
path: root/src/usr/errl/parser
diff options
context:
space:
mode:
authorMonte Copeland <copelanm@us.ibm.com>2012-01-26 10:20:01 -0600
committerMonte K. Copeland <copelanm@us.ibm.com>2012-02-02 12:37:47 -0600
commit966df7556d9ebd045291921eda8c81bdba9b5d2e (patch)
treea3d7f4f7dcce07d998e1cfba8f76b577d75e28d7 /src/usr/errl/parser
parent06b768407e1d6e212aeed8be23f31dfb27f2a9cc (diff)
downloadtalos-hostboot-966df7556d9ebd045291921eda8c81bdba9b5d2e.tar.gz
talos-hostboot-966df7556d9ebd045291921eda8c81bdba9b5d2e.zip
Hostboot-aware errl tool part 1.
Change-Id: Ibe49dc935206775de032d397b2800a7b83208283 Reviewed-on: http://gfw160.austin.ibm.com:8080/gerrit/630 Tested-by: Jenkins Server Reviewed-by: Monte K. Copeland <copelanm@us.ibm.com>
Diffstat (limited to 'src/usr/errl/parser')
-rw-r--r--src/usr/errl/parser/errlparser.C53
-rw-r--r--src/usr/errl/parser/makefile67
-rwxr-xr-xsrc/usr/errl/parser/scanforsrcs.pl28
3 files changed, 63 insertions, 85 deletions
diff --git a/src/usr/errl/parser/errlparser.C b/src/usr/errl/parser/errlparser.C
index 9e733a701..20fcac589 100644
--- a/src/usr/errl/parser/errlparser.C
+++ b/src/usr/errl/parser/errlparser.C
@@ -25,28 +25,21 @@
/**
* @file errlparser.C
*
- * @brief Builds a program to display committed Hostboot error logs.
+ * @brief This program spawns the FipS x86 errl tool to display
+ * a Hostboot error log in full detail. This program can also show a
+ * brief list of error logs without the detail. When the user
+ * wants the full detail, this program extracts the error log from
+ * the Hostboot image (or dump) and puts it into a temporary file. When
+ * saved to file, then this program execs "errl -d..." to display
+ * the error log PEL data.
+ *
+ * There are other options, such as "-p" which writes all the PEL files
+ * and does not exec errl. This is useful for debugging.
+ *
* Enter errlparser ? (or -? or -h or --help) to print help.
* This program can be run standalone using a Simics
* L3 memory image and the HB syms file, however it is more likely
- * spawned as "simcis> hb-errl" from the Hostboot/Simics python
- * script.
- *
- * This program spawns the FSP x86 version of errl and fsp-trace
- * which may or may not be in your $PATH. Candidates are:
- *
- * Classic FSP errl:
- * /esw/fips730/Builds/b0829a_1130.730/obj/x86.nfp/errl/nfp/tool/errl
- *
- * Or this version in Monte's sandbox which is more Hostboot aware:
- * /gsa/ausgsa/home/c/o/copelanm/public/bin/errl
- *
- * Building Blocks version of fsp-trace:
- * /opt/mcp/shared/fr_DEV-37/opt/fsp/usr/bin/fsp-trace
- *
- * Camvan has a solution for PATHing to fsp-trace when in Simics.
- * TODO Will need a copy of FSP x86 errl too in the near future.
- *
+ * spawned via "simics> hb-errl"
*/
@@ -62,14 +55,12 @@
#include <vector>
using namespace std;
-#include <errl/errltypes.H>
+#include <errl/hberrltypes.H>
#include <hbotcompid.H>
-// userdetail
-#include <errl/parser/errlusrparser.H>
-
-// this should be last, otherwise it will not find all the namespaces
-#include <hostBootSrcParse.H>
+// These should be included from plugin code.
+// #include <errl/parser/errlusrparser.H>
+// #include <hostBootSrcParse.H>
using namespace ERRORLOG;
@@ -753,9 +744,8 @@ int main( int argc, char *argv[] )
exit(1);
}
- // TODO Need to put a copy of FSP x86 errl tool in the simics path.
- // Try for Monte's sandbox copy, temporary for Sprint 6.
- pszErrlTool = "/gsa/ausgsa/home/c/o/copelanm/public/bin/errl";
+ // There is a copy of FSP x86 errl tool in the simics dir.
+ pszErrlTool = "./errl";
rc = stat( pszErrlTool, &statbuffer );
if( -1 == rc )
@@ -973,13 +963,6 @@ int main( int argc, char *argv[] )
l_reasonCode = pSRCSection->reserved1;
#endif
- printf( "%-20s%s\n",
- "Component",
- FindComp(pPrivateHdr->sectionheader.compId));
-
- // print the Errorlog tags from scanforsrcs.pl
- printErrorTags( l_reasonCode, pSRCSection->moduleId );
-
// done with this tmp file
unlink( szTmpFilename );
diff --git a/src/usr/errl/parser/makefile b/src/usr/errl/parser/makefile
index c030b646c..dd9f132bf 100644
--- a/src/usr/errl/parser/makefile
+++ b/src/usr/errl/parser/makefile
@@ -21,41 +21,50 @@
#
# IBM_PROLOG_END
-# makefile for errlparser,
-# a 32-bit x86 linux binary suitable for running on GFW pool machines.
+# makefile for errlparser a 32-bit x86 linux binary
+# to extract the PEL of an error log and
+# put it in a temporary file so that the
+# FipS errl tool can format and display it.
+# "Pretty printing" of those error logs is the
+# function of FipS 'errl' and its plugins, not this program.
+#
+# This makefile runs 'scanforsrc.pl' which generates
+# hostBootSrcParse.H, a file that hostboot plugins will include.
+
+
ROOTPATH=../../../..
-include ${ROOTPATH}/src/usr/parser.mk
+GENDIR = ${ROOTPATH}/obj/genfiles
+IMGDIR = ${ROOTPATH}/img
+OBJDIR = ${ROOTPATH}/obj/modules/errl/parser
-OBJFILES = errlparserbase.o errlusrparser.o
SRCPARSE_HEADER_TARGET = \
${GENDIR}/hostBootSrcParse.H
+
CC=i686-mcp6-g++ -m32
-CFLAGS:=-g -O0 -I $(ROOTPATH)/src/include/usr -D PARSER
+CFLAGS:=-g -O0 -I $(ROOTPATH)/src/include/usr -I ${GENDIR}
all: gen_pass code_pass
-gen_pass:
+gen_pass: mkdirs ${SRCPARSE_HEADER_TARGET} ${GENDIR}/comps.C
-code_pass: makeobjdir ${IMGDIR}/errlparser ${SRCPARSE_HEADER_TARGET}
+code_pass: ${IMGDIR}/errlparser
-## errlparserbase and errlusrparser
-%.o : %.C
- $(CC) -c $(CFLAGS) -o $@ $<
+# errlparserbase and errlusrparser are plugins stuff, not errlparser.
+# OBJFILES = ${OBJDIR}/errlparserbase.o ${OBJDIR}/errlusrparser.o
+# %.o : %.C
+# $(CC) -c $(CFLAGS) -o $@ $<
-clean:
- rm -fr ${SRCPARSE_HEADER_TARGET}
- rm -fr ${OBJDIR}/errlparser.o
- rm -fr ${GENDIR}/errlparser
- rm -fr ${GENDIR}/comps.C
- rm -fr ${OBJDIR}/*.o
- rm -fr *.o
-
-makeobjdir:
+mkdirs:
mkdir -p ${OBJDIR}
+ mkdir -p ${GENDIR}
+
+# Parse for error log tags in the Hostboot code, and generate hostBootSrcParse.H
+${SRCPARSE_HEADER_TARGET} :
+ ./scanforsrcs.pl -b ${ROOTPATH} -o ${GENDIR}
${GENDIR}/comps.C: ${ROOTPATH}/src/include/usr/hbotcompid.H
grep "const compId_t [A-Z0-9]*_COMP_ID" $^ | \
@@ -63,23 +72,23 @@ ${GENDIR}/comps.C: ${ROOTPATH}/src/include/usr/hbotcompid.H
sed 's/const compId_t \([A-Z0-9]*\)_COMP_ID[ =\t]*\(0[xX][0-9a-fA-F]*\).*/{ "\1", \2 },/' \
> $@
-${OBJDIR}/errlparser.o: errlparser.C ${ROOTPATH}/src/include/usr/errl/errltypes.H ${GENDIR}/comps.C ${SRCPARSE_HEADER_TARGET}
- $(CC) -c $(CFLAGS) -I${ROOTPATH}/obj/genfiles -o $@ $<
+${OBJDIR}/errlparser.o: errlparser.C ${ROOTPATH}/src/include/usr/errl/hberrltypes.H ${GENDIR}/comps.C
+ $(CC) -c $(CFLAGS) -o $@ $<
-${IMGDIR}/errlparser: ${OBJDIR}/errlparser.o ${OBJFILES} ${UD_FILES}
- $(CC) -o $@ $?
-
-## TODO add link step to link in UD_FILES
+${IMGDIR}/errlparser: ${OBJDIR}/errlparser.o
+ $(CC) -o $@ $<
-${SRCPARSE_HEADER_TARGET} :
- ./scanforsrcs.pl -b ${ROOTPATH} -o ${GENDIR}
+clean:
+ rm -f ${SRCPARSE_HEADER_TARGET}
+ rm -f ${GENDIR}/comps.C
+ rm -f ${IMGDIR}/errlparser
+ rm -fr ${OBJDIR}
debug:
ls -l ${GENDIR}
ls -l ${OBJDIR}
ls -l ${IMGDIR}
- ls -l ${UD_DIR}
beam:
- # dummy \ No newline at end of file
+ # dummy
diff --git a/src/usr/errl/parser/scanforsrcs.pl b/src/usr/errl/parser/scanforsrcs.pl
index d6d594a18..6c187a848 100755
--- a/src/usr/errl/parser/scanforsrcs.pl
+++ b/src/usr/errl/parser/scanforsrcs.pl
@@ -550,8 +550,9 @@ EOF
print $fh <<EOF;
-static void printErrorTags ( uint64_t i_src,
- uint64_t i_modId )
+static void printErrorTags ( ErrlUsrParser & i_parser,
+ uint64_t i_src,
+ uint64_t i_modId )
{
uint64_t error = (i_src << 8) | i_modId;
@@ -710,28 +711,13 @@ sub writePrintStatement
# =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
print $fh " case \(\($reasonCode \<\< 8\) \| $modId\) \:\n";
- print $fh " printf( \"\\n\" \)\;\n";
+
foreach my $tag ( sort keys %$href )
{
$href->{$tag} =~ s/\"/\\\"/g;
- my @lines = split /^/, $href->{$tag};
-
- if( scalar( @lines ) > 1 )
- {
- print $fh " printf( \"\%-20s";
- foreach my $line( @lines )
- {
- $line =~ s/\n//g;
- print $fh "$line";
- }
- print $fh "\\n\"\, \"$tag\" \)\;\n";
- }
- else
- {
- my $line = $href->{$tag};
- $line =~ s/\n//g;
- print $fh " printf( \"\%-20s$line\\n\"\, \"$tag\" \)\;\n";
- }
+ my $line = $href->{$tag};
+ $line =~ s/\n//g;
+ print $fh " i_parser.PrintString( \"$tag\" \, \"$line\" )\;\n";
}
print $fh " break;\n\n";
}
OpenPOWER on IntegriCloud