diff options
author | Dan Crowell <dcrowell@us.ibm.com> | 2016-09-23 19:54:50 -0500 |
---|---|---|
committer | Daniel M. Crowell <dcrowell@us.ibm.com> | 2016-09-28 16:31:58 -0400 |
commit | 8142496f0f8e82eb3e069ce645c92438fa99efe4 (patch) | |
tree | fdb46e9c4ec8fe530ddc7f23df934ac70db917df /src/build/debug/simics-debug-framework.py | |
parent | 45d5477ac84685301735e5d920e0f5fb71e5b668 (diff) | |
download | talos-hostboot-8142496f0f8e82eb3e069ce645c92438fa99efe4.tar.gz talos-hostboot-8142496f0f8e82eb3e069ce645c92438fa99efe4.zip |
Log SBE Traces on error (simics only)
A quick change to add a new magic instruction that collects the
SBE traces any time we hit an error from the SBE. If multiple
errors occur they will all be appended to the same file.
Data will be saved to $sb/simics/sbetrace.hb.txt.
Change-Id: I27575c1565c0089e847e19c3e51cb2926833e387
Reviewed-on: http://ralgit01.raleigh.ibm.com/gerrit1/30206
Tested-by: Jenkins Server <pfd-jenkins+hostboot@us.ibm.com>
Reviewed-by: Martin Gloff <mgloff@us.ibm.com>
Reviewed-by: Sachin Gupta <sgupta2m@in.ibm.com>
Tested-by: FSP CI Jenkins <fsp-CI-jenkins+hostboot@us.ibm.com>
Reviewed-by: Daniel M. Crowell <dcrowell@us.ibm.com>
Diffstat (limited to 'src/build/debug/simics-debug-framework.py')
-rwxr-xr-x | src/build/debug/simics-debug-framework.py | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/src/build/debug/simics-debug-framework.py b/src/build/debug/simics-debug-framework.py index 44fb49c51..4f647dd3e 100755 --- a/src/build/debug/simics-debug-framework.py +++ b/src/build/debug/simics-debug-framework.py @@ -570,6 +570,20 @@ def magic_instruction_callback(user_arg, cpu, arg): if( os.environ.has_key('HB_BREAK_ON_ERROR') ): SIM_break_simulation( "Stopping sim on HB error. (hap 7018)" ) + if arg == 7019: # MAGIC_GET_SBE_TRACES + # Collect SBE traces out to a file + proc_num = cpu.r4 + rc = cpu.r5 + # generate the traces + cmd1 = "sbe-trace %d"%(proc_num) + print "cmd1", cmd1 + # copy the file somewhere safe + cmd2 = "shell \"echo '==HB Collecting Traces (iar=%X,rc=%X,sbe=%d)==' >> sbetrace.hb.txt; cat sbe_%d_tracMERG >> sbetrace.hb.txt\""%(cpu.iar,rc,proc_num,proc_num) + print "cmd2", cmd2 + + saveCommand = "%s; %s"%(cmd1,cmd2) + SIM_run_alone(run_command, saveCommand ) + if arg == 7055: # MAGIC_CONTINUOUS_TRACE hb_tracBinaryBuffer = cpu.r4 hb_tracBinaryBufferSz = cpu.r5 @@ -660,6 +674,9 @@ rc = os.system( "rm -f hbTracBINARY3" ) rc = os.system( "rm -f tracMERG" ) rc = os.system( "rm -f tracBINARY" ) +# SBE traces: Clear these files. +rc = os.system( "rm -f sbetrace.hb.txt" ) + # Register the magic instruction hap handler (a callback). SIM_hap_add_callback_range( "Core_Magic_Instruction", magic_instruction_callback, None, 7000, 7999 ) |