Skip to content

Commit

Permalink
Remove dependency of sbe obj path for sbestate, ppestate etc
Browse files Browse the repository at this point in the history
Change-Id: I5afe599e9f128ac0721d437cef0b5a2057dc346f
Reviewed-on: http://ralgit01.raleigh.ibm.com/gerrit1/41156
Reviewed-by: RAJA DAS <rajadas2@in.ibm.com>
Tested-by: Jenkins Server <pfd-jenkins+hostboot@us.ibm.com>
Reviewed-by: Shakeeb A. Pasha B K <shakeebbk@in.ibm.com>
Tested-by: FSP CI Jenkins <fsp-CI-jenkins+hostboot@us.ibm.com>
Reviewed-by: Sachin Gupta <sgupta2m@in.ibm.com>
  • Loading branch information
sgupta2m committed May 31, 2017
1 parent bcbe74a commit 5110484
Showing 1 changed file with 28 additions and 23 deletions.
51 changes: 28 additions & 23 deletions src/tools/debug/sbe-debug.py
Expand Up @@ -34,11 +34,15 @@

baseAddr = 0xfffe8000
syms = {};
if 'SBE_TOOLS_PATH' in os.environ:
SBE_TOOLS_PATH = os.environ['SBE_TOOLS_PATH'];
else:
print "SBE_TOOLS_PATH not defined"
exit(1)
SBE_TOOLS_PATH = ""
def getSbeObjPath():
if 'SBE_TOOLS_PATH' in os.environ:
SBE_TOOLS_PATH = os.environ['SBE_TOOLS_PATH'];
else:
print "SBE_TOOLS_PATH not defined"
exit(1)
print "SBE_TOOLS_PATH", SBE_TOOLS_PATH
return SBE_TOOLS_PATH

def getTraceFilePath():
fspTrace = SBE_TOOLS_PATH + "/fsp-trace"
Expand Down Expand Up @@ -220,7 +224,7 @@ def collectAttr( sbeObjDir, target, node, proc, ddsuffix, file_path ):
print "ERROR running %s: %d " % ( cmd3, rc )
return 1

def ppeState( sbeObjDir, target, node, proc, file_path ):
def ppeState( target, node, proc, file_path ):
if(target == 'FILE'):
print "File path: ", file_path
fileHandle = open(file_path)
Expand All @@ -244,7 +248,7 @@ def ppeState( sbeObjDir, target, node, proc, file_path ):
print "ERROR running %s: %d " % ( cmd1, rc )
return 1

def sbeLocalRegister( sbeObjDir, target, node, proc, file_path ):
def sbeLocalRegister( target, node, proc, file_path ):
if(target == 'FILE'):
print "File path: ", file_path
fileHandle = open(file_path)
Expand All @@ -269,7 +273,7 @@ def sbeLocalRegister( sbeObjDir, target, node, proc, file_path ):
print "ERROR running %s: %d " % ( cmd1, rc )
return 1

def sbeState( sbeObjDir, target, node, proc, file_path ):
def sbeState( target, node, proc, file_path ):
if(target == 'FILE'):
print "File path: ", file_path
fileHandle = open(file_path)
Expand All @@ -286,7 +290,7 @@ def sbeState( sbeObjDir, target, node, proc, file_path ):
print '********************************************************************'
fileHandle.close()
else:
cmd1 = ("p9_pibms_reg_dump_wrap.exe -quiet" +\
cmd1 = ("p9_pibms_reg_dump_wrap.exe -verbose" +\
" -n" + str(node) + " -p" + str(proc))
print "cmd1:", cmd1
rc = os.system( cmd1 )
Expand Down Expand Up @@ -441,31 +445,32 @@ def main( argv ):
# check if the file path exist or not
assert os.path.exists(arg), "Did not find the file at, "+str(arg)

sbeObjDir = SBE_TOOLS_PATH;
print "sbeObjDir", sbeObjDir
fillSymTable(sbeObjDir, target, ddsuffix)
if ( level == 'all' ):
print "Parsing everything"
collectTrace( sbeObjDir, target, node, proc, ddsuffix, file_path )
collectAttr( sbeObjDir, target, node, proc, ddsuffix, file_path )
fillSymTable(getSbeObjPath(), target, ddsuffix)
collectTrace( getSbeObjPath(), target, node, proc, ddsuffix, file_path )
collectAttr( getSbeObjPath(), target, node, proc, ddsuffix, file_path )
sbeStatus( target, node, proc )
ppeState( sbeObjDir, target, node, proc, file_path )
sbeState( sbeObjDir, target, node, proc, file_path )
sbeLocalRegister( sbeObjDir, target, node, proc, file_path )
ppeState( target, node, proc, file_path )
sbeState( target, node, proc, file_path )
sbeLocalRegister( target, node, proc, file_path )
elif ( level == 'trace' ):
collectTrace( sbeObjDir, target, node, proc, ddsuffix, file_path )
fillSymTable(getSbeObjPath(), target, ddsuffix)
collectTrace( getSbeObjPath(), target, node, proc, ddsuffix, file_path )
elif ( level == 'forced-trace' ):
forcedCollectTrace( sbeObjDir, target, node, proc, ddsuffix, file_path )
fillSymTable(getSbeObjPath(), target, ddsuffix)
forcedCollectTrace( getSbeObjPath(), target, node, proc, ddsuffix, file_path )
elif ( level == 'attr' ):
collectAttr( sbeObjDir, target, node, proc, ddsuffix, file_path )
fillSymTable(getSbeObjPath(), target, ddsuffix)
collectAttr( getSbeObjPath(), target, node, proc, ddsuffix, file_path )
elif ( level == 'ppestate' ):
ppeState( sbeObjDir, target, node, proc, file_path )
ppeState( target, node, proc, file_path )
elif ( level == 'sbestate' ):
sbeState( sbeObjDir, target, node, proc, file_path )
sbeState( target, node, proc, file_path )
elif ( level == 'sbestatus' ):
sbeStatus( target, node, proc )
elif ( level == 'sbelocalregister' ):
sbeLocalRegister( sbeObjDir, target, node, proc, file_path )
sbeLocalRegister( target, node, proc, file_path )

if(target != 'FILE'):
# On cronus, set the FIFO mode to previous state
Expand Down

0 comments on commit 5110484

Please sign in to comment.