diff options
author | Dean Sanner <dsanner@us.ibm.com> | 2016-05-15 12:03:54 -0500 |
---|---|---|
committer | Daniel M. Crowell <dcrowell@us.ibm.com> | 2016-06-24 10:56:44 -0400 |
commit | aa513a3a39202bcbc5294cd1ef6618ecbe151bf8 (patch) | |
tree | 03a13ac3ed32fe5d30027a25e1033912f5698cc0 /src/build/debug/Hostboot/Istep.pm | |
parent | 7e8f95823e071367bc17bb95113239324f06e5d5 (diff) | |
download | blackbird-hostboot-aa513a3a39202bcbc5294cd1ef6618ecbe151bf8.tar.gz blackbird-hostboot-aa513a3a39202bcbc5294cd1ef6618ecbe151bf8.zip |
FSPless continous tracing support
- Updated trace daemon to output trace buf addr, size to
mbox scratch 1, 2
- Moved enable disable of continous trace to "istep" control
- Updated istep tool to dump traces to file and commandline
Change-Id: I2d9f48f5ed9878591ff9ab45fa18a98fc286ac1f
RTC:127346
Reviewed-on: http://ralgit01.raleigh.ibm.com/gerrit1/24565
Tested-by: Jenkins Server
Reviewed-by: Christian R. Geddes <crgeddes@us.ibm.com>
Tested-by: FSP CI Jenkins
Reviewed-by: Prachi Gupta <pragupta@us.ibm.com>
Reviewed-by: Daniel M. Crowell <dcrowell@us.ibm.com>
Diffstat (limited to 'src/build/debug/Hostboot/Istep.pm')
-rwxr-xr-x | src/build/debug/Hostboot/Istep.pm | 51 |
1 files changed, 47 insertions, 4 deletions
diff --git a/src/build/debug/Hostboot/Istep.pm b/src/build/debug/Hostboot/Istep.pm index ebbcfc63c..8d1896932 100755 --- a/src/build/debug/Hostboot/Istep.pm +++ b/src/build/debug/Hostboot/Istep.pm @@ -64,6 +64,7 @@ no warnings 'portable'; package Hostboot::Istep; use Exporter; our @EXPORT_OK = ('main'); +use File::Temp ('tempfile'); #------------------------------------------------------------------------------ # Constants @@ -74,7 +75,7 @@ use constant SPLESS_SINGLE_ISTEP_CMD => 0x00; use constant SPLESS_RESUME_ISTEP_CMD => 0x01; use constant SPLESS_CLEAR_TRACE_CMD => 0x02; -use constant MAX_ISTEPS => 25; +use constant MAX_ISTEPS => 256; use constant MAX_SUBSTEPS => 25; ## Mailbox Scratchpad regs @@ -361,6 +362,48 @@ sub showHelp exit 0; } +## --------------------------------------------------------------------------- +## Check to see if there are trace buffers avail +## if so, extract and write them out +## --------------------------------------------------------------------------- +sub checkContTrace +{ + my $SCRATCH_MBOX1 = 0x00050038; + my $SCRATCH_MBOX2 = 0x00050039; + my $contTrace = ""; + my $ctName = "tracMERG.cont"; + + $contTrace = ::readScom( $SCRATCH_MBOX1, 8 ); + if ( $contTrace != 0 ) + { + my $fh; + my $fname; + my $contFile; + ($fh,$fname) = tempfile(); + open ($contFile, '>>', $ctName) or die "Can't open '$ctName' $!"; + binmode($fh); + + #contTrace has the buffer, address MBOX_SCRATCH2 has size + #MBOX Scratch regs are only valid from 0:31, shift to give a num + my $buffAddr = $contTrace >> 32; + my $buffSize = ::readScom($SCRATCH_MBOX2, 8) >> 32; + + print $fh (::readData($buffAddr, $buffSize)); + + #Write 0 to let HB know we extracted buf and it can continue + ::writeScom($SCRATCH_MBOX1, 8, 0x0); + + open TRACE, ("fsp-trace -s ".::getImgPath(). + "hbotStringFile $fname |") || die; + while (my $line = <TRACE>) + { + ::userDisplay $line; + print $contFile $line; + } + + unlink $fname; + } +} ## --------------------------------------------------------------------------- ## Dump environment variable specified. @@ -634,7 +677,7 @@ sub getSyncStatus( ) ## check to see if we need to dump trace - no-op in simics - ##::checkContTrace(); + checkContTrace(); $result = getStatus(); $running = ( ( $result & 0x2000000000000000 ) >> 61 ); @@ -682,13 +725,13 @@ sub runIStep( $$ ) sendCommand( $cmd ); - $result = getSyncStatus(); ## if result is -1 we have a timeout if ( $result == -1 ) { ::userDisplay "-----------------------------------------------------------------\n"; + exit; } else { @@ -899,7 +942,7 @@ sub setMode( $ ) if ( $opt_debug ) { ::userDisplay "=== checkContTrace\n"; } ## check to see if it's time to dump trace - no-op in simics - ::checkContTrace(); + checkContTrace(); if ( $opt_debug ) { ::userDisplay "=== isShutDown\n"; } ## check for system crash |