summaryrefslogtreecommitdiffstats
path: root/src/build
diff options
context:
space:
mode:
authorIlya Smirnov <ismirno@us.ibm.com>2018-01-19 12:11:32 -0600
committerDaniel M. Crowell <dcrowell@us.ibm.com>2018-01-24 10:26:38 -0500
commite51716b15f79fc3584fa49a6c3473ab91baaeeb3 (patch)
treec0a03b500db447e73bf7ada2b3617ab22161644a /src/build
parente4c43f303408166d071b2c97da924e5f78760d9b (diff)
downloadtalos-hostboot-e51716b15f79fc3584fa49a6c3473ab91baaeeb3.tar.gz
talos-hostboot-e51716b15f79fc3584fa49a6c3473ab91baaeeb3.zip
Fix Timestamp Search for eSEL.pl
eSEL.pl had a bug where it would continuously search for keyword "Timestamp" and lock up until it found one. This doesn't work with one of the supported formats for OBMC, where there aren't any timestamps in the logs. Change-Id: Ie9092a10b57f9aad4f752c711f77858695861a31 CQ:SW414508 Reviewed-on: http://ralgit01.raleigh.ibm.com/gerrit1/52275 Tested-by: Jenkins Server <pfd-jenkins+hostboot@us.ibm.com> Tested-by: Jenkins OP Build CI <op-jenkins+hostboot@us.ibm.com> Tested-by: FSP CI Jenkins <fsp-CI-jenkins+hostboot@us.ibm.com> Reviewed-by: Martin Gloff <mgloff@us.ibm.com> Reviewed-by: Matt Derksen <mderkse1@us.ibm.com> Tested-by: Jenkins OP HW <op-hw-jenkins+hostboot@us.ibm.com> Reviewed-by: Daniel M. Crowell <dcrowell@us.ibm.com>
Diffstat (limited to 'src/build')
-rwxr-xr-xsrc/build/debug/eSEL.pl76
1 files changed, 56 insertions, 20 deletions
diff --git a/src/build/debug/eSEL.pl b/src/build/debug/eSEL.pl
index 629a2b363..518f9dffe 100755
--- a/src/build/debug/eSEL.pl
+++ b/src/build/debug/eSEL.pl
@@ -63,6 +63,7 @@ my $esel_record_count = 0;
my @esel_timestamps = ();
my $timestamp = "";
my $txt_file_name = "";
+my $timestamp_found = 0;
my %options_table = (
get_ami_data => 0,
@@ -335,7 +336,14 @@ sub ReplaceHostbootTimestamps
# Match the following pattern "dd/mm/yyyy hh:mm:ss"
# Note that we can't match only numbers here since the broken hb
# timestamp may contain hex letters
- $line =~ s{(..)/(..)/(....) ..:..:..}{$esel_timestamps[$current_esel_number]}g;
+ if($timestamp_found)
+ {
+ $line =~ s{(..)/(..)/(....) ..:..:..}{$esel_timestamps[$current_esel_number]}g;
+ }
+ else # We didn't collect any timestamps - populate with fake data
+ {
+ $line =~ s{(..)/(..)/(....) ..:..:..}{DE/AD/BEEF DE:AD:FF}g;
+ }
($debug) && print "Made substitution: $line\n";
# Only move to the next timestamp when we've seen the "Committed at"
@@ -553,35 +561,63 @@ sub DecodeObmcEselData
next;
}
# only collect the timestamps if we're processing OBMC eSELs.
- elsif($options_table{"decode_obmc_data"})
+ else
{
- # found PEL string, now find the datestamp associated with it
+ # found PEL string, now try to find the datestamp associated with it
# (the next Timestamp in the log)
my $next_line = "";
- do
+ while(<LOG_FILE>)
{
- $next_line = <LOG_FILE>;
- } while (!($next_line =~ /Timestamp/));
- # strip the "Timestamp", commas, spaces, and the newline
- $next_line =~ s/"Timestamp"://g;
- $next_line =~ s/,//g;
- $next_line =~ s/ //g;
- chomp $next_line;
-
- # convert to date/time (we are given the timestamp in ms, so divide
- # by 1000 to get s).
- $timestamp = strftime("%m/%d/%Y %H:%M:%S", localtime($next_line/1000));
- ($debug) && print "Timestamp for ESEL #$esel_record_count:$next_line\n";
- ($debug) && print "Decoded timestamp for ESEL #$esel_record_count:$timestamp\n";
-
- push @esel_timestamps, $timestamp;
- ($debug) && $esel_record_count++;
+ $next_line = $_;
+ $debug && print "Looking for timestamp.. line <$next_line>\n";
+ if($next_line =~ /Timestamp/)
+ {
+ $timestamp_found = 1;
+ last;
+ }
+ elsif($next_line =~ /ESEL/ or
+ $next_line =~ /20 00 04/) # found the next ESEL
+ {
+ $timestamp_found = 0;
+ # Return the file pointer back to the ESEL line so we can
+ # process it.
+ seek(LOG_FILE, -length($next_line), 1);
+ last;
+ }
+ }
+
+ if($timestamp_found)
+ {
+ # strip the "Timestamp", commas, spaces, and the newline
+ $next_line =~ s/"Timestamp"://g;
+ $next_line =~ s/,//g;
+ $next_line =~ s/ //g;
+ chomp $next_line;
+
+ # convert to date/time (we are given the timestamp in ms, so divide
+ # by 1000 to get s).
+ $timestamp =
+ strftime("%m/%d/%Y %H:%M:%S", localtime($next_line/1000));
+ ($debug) && print "Timestamp for ESEL #$esel_record_count:$next_line\n";
+ ($debug) && print "Decoded timestamp for ESEL #$esel_record_count:$timestamp\n";
+
+ push @esel_timestamps, $timestamp;
+ ($debug) && $esel_record_count++;
+ }
}
$line_size = split / /, $pelString;
print OUT_FILE HexPack($pelString, $line_size);
}
($debug) && print "Timestamps: @esel_timestamps\n";
+
+ if(!$timestamp_found)
+ {
+ print "No timestamp data was found in the log provided.\n";
+ print "Timestamps will not be corrected in the resulting";
+ print " error log file.\n";
+ }
+
close OUT_FILE;
close LOG_FILE;
# Make sure the file naming is consistent with what parsing function expects
OpenPOWER on IntegriCloud