summaryrefslogtreecommitdiffstats
path: root/src/build/debug
diff options
context:
space:
mode:
Diffstat (limited to 'src/build/debug')
-rwxr-xr-xsrc/build/debug/Hostboot/Dump.pm14
-rw-r--r--src/build/debug/simics-debug-framework.py18
2 files changed, 28 insertions, 4 deletions
diff --git a/src/build/debug/Hostboot/Dump.pm b/src/build/debug/Hostboot/Dump.pm
index 705638aa2..90b445df9 100755
--- a/src/build/debug/Hostboot/Dump.pm
+++ b/src/build/debug/Hostboot/Dump.pm
@@ -6,7 +6,7 @@
#
# OpenPOWER HostBoot Project
#
-# Contributors Listed Below - COPYRIGHT 2012,2018
+# Contributors Listed Below - COPYRIGHT 2012,2019
# [+] International Business Machines Corp.
#
#
@@ -106,6 +106,13 @@ sub main
$debug = 1;
}
+ # Parse 'quiet' option.
+ my $quiet = 0;
+ if (defined $args->{"quiet"})
+ {
+ $quiet = 1;
+ }
+
# Check for a different output directory
my $outdir = "./";
if (defined $args->{"outdir"})
@@ -128,7 +135,7 @@ sub main
open( OUTFH, ">$hbDumpFile" ) or die "can't open $hbDumpFile: $!\n";
binmode(OUTFH);
- ::userDisplay "Using HRMOR=". ::getHRMOR() . "\n";
+ ::userDisplay "Using HRMOR=". sprintf("0x%X",::getHRMOR()) . "\n";
# Read memory regions and output to file.
foreach my $state (@{$memory_states{int $memstate}})
@@ -152,7 +159,7 @@ sub main
$curlength = $length_remaining;
}
- ::userDisplay (sprintf "...%x@%x\n", $curlength, $curstart);
+ ::userDisplay (sprintf "...%x@%x\n", $curlength, $curstart) if !$quiet;
my $data = ::readData($curstart, $curlength);
seek OUTFH, $curstart, SEEK_SET;
@@ -187,6 +194,7 @@ sub helpInfo
options => {
"outdir=<path>" => ["Output directory for dump file"],
"debug" => ["More debug output."],
+ "quiet" => ["Less output."],
},
);
}
diff --git a/src/build/debug/simics-debug-framework.py b/src/build/debug/simics-debug-framework.py
index 69465da3f..fd90806bb 100644
--- a/src/build/debug/simics-debug-framework.py
+++ b/src/build/debug/simics-debug-framework.py
@@ -516,7 +516,7 @@ def magic_instruction_callback(user_arg, cpu, arg):
# Stop the simulation, much like a hard-coded breakpoint
SIM_break_simulation( "Simulation stopped. (hap 7007)" )
- if arg == 7008:
+ if arg == 7008: # MAGIC_RANDOM
cpu.r3 = random.randint(1, 0xffffffffffffffffL)
if arg == 7009: # MAGIC_MEMORYLEAK_FUNCTION
@@ -525,6 +525,10 @@ def magic_instruction_callback(user_arg, cpu, arg):
if arg == 7011: #MAGIC_SIMICS_CHECK
cpu.r3 = 1
print "TimeManager::cv_isSimicsRunning = true"
+ # Clear the dump flag in case it was still set from a previous boot
+ # (this call happens only 1 time and it is very early in the boot)
+ if( os.environ.has_key('HB_DUMP_COMPLETE') ):
+ del os.environ['HB_DUMP_COMPLETE']
if arg == 7012: # MAGIC_LOAD_PAYLOAD
#For P9 the Payload load is much faster due to PNOR
@@ -537,6 +541,17 @@ def magic_instruction_callback(user_arg, cpu, arg):
#SIM_run_alone( run_command, cmd )
print "MAGIC_LOAD_PAYLOAD not implemented\n";
+ if arg == 7014: # MAGIC_HB_DUMP
+ # Collect a hostboot dump
+ # (no args)
+
+ # Make sure we only do 1 dump even though every thread will TI
+ if( not os.environ.has_key('HB_DUMP_COMPLETE') ):
+ print "Generating Hostboot Dump for TI"
+ os.environ['HB_DUMP_COMPLETE']="1"
+ cmd1 = "hb-Dump quiet"
+ SIM_run_alone(run_command, cmd1 )
+
if arg == 7018: # MAGIC_BREAK_ON_ERROR
# Stop the simulation if an env var is set
if( os.environ.has_key('HB_BREAK_ON_ERROR') ):
@@ -573,6 +588,7 @@ def magic_instruction_callback(user_arg, cpu, arg):
percent_s = "%s"
dateCommand = "shell \" date +'%s > TRACE REGS: %d %d' \""%(percent_s,first_num,second_num)
SIM_run_alone(run_command, dateCommand )
+
if arg == 7022: # MAGIC_SET_LOG_LEVEL
if( not os.environ.has_key('ENABLE_HB_SIMICS_LOGS') ):
#print("Skipping Hostboot Simics Logging because ENABLE_HB_SIMICS_LOGS is not set")
OpenPOWER on IntegriCloud