From 4d82267c5fa48570edbf7cc906ee34a0edd20922 Mon Sep 17 00:00:00 2001 From: spashabk-in Date: Mon, 28 Aug 2017 09:49:20 -0500 Subject: SBE debug tool - stack usage from pibmem dump Enable stack usage command for pibmem dump file Change-Id: Ie8d8e4cfbae4411e9d17ab7ebd5ab226eb603967 Reviewed-on: http://ralgit01.raleigh.ibm.com/gerrit1/45230 Tested-by: Jenkins Server Tested-by: FSP CI Jenkins Reviewed-by: Sachin Gupta --- src/tools/debug/sbe-debug.py | 19 +++++++++++-------- 1 file changed, 11 insertions(+), 8 deletions(-) (limited to 'src/tools/debug') diff --git a/src/tools/debug/sbe-debug.py b/src/tools/debug/sbe-debug.py index eceb5015..5c4a860a 100755 --- a/src/tools/debug/sbe-debug.py +++ b/src/tools/debug/sbe-debug.py @@ -251,7 +251,7 @@ def collectAttr( target, node, proc, ddsuffix, file_path ): print "ERROR running %s: %d " % ( cmd3, rc ) return 1 -def collectStackUsage (node, proc ): +def collectStackUsage (target, node, proc, file_path ): threads = ('sbeSyncCommandProcessor_stack', 'sbeCommandReceiver_stack', 'sbe_Kernel_NCInt_stack', @@ -259,15 +259,18 @@ def collectStackUsage (node, proc ): for thread in threads: offset = getOffset( thread ); length = "0x" + syms[thread][1]; - cmd1 = (getFilePath("p9_pibmem_dump_wrap.exe")+" -quiet -start_byte " + + if(target == 'FILE'): + createPibmemDumpFile(file_path, offset, length) + else: + cmd1 = (getFilePath("p9_pibmem_dump_wrap.exe")+" -quiet -start_byte " + str(offset) +\ " -num_of_byte " + length + " " " -n" + str(node) + " -p" + str(proc)) - print "cmd1:", cmd1 - rc = os.system( cmd1 ) - if ( rc ): - print "ERROR running %s: %d " % ( cmd1, rc ) - return 1 + print "cmd1:", cmd1 + rc = os.system( cmd1 ) + if ( rc ): + print "ERROR running %s: %d " % ( cmd1, rc ) + return 1 # Dump stack memory to binary file cmd2 = "cat DumpPIBMEM >>"+thread @@ -622,7 +625,7 @@ def main( argv ): sbeLocalRegister( target, node, proc, file_path ) elif ( level == 'stack' ): fillSymTable(target, ddsuffix) - collectStackUsage( node, proc ) + collectStackUsage( target, node, proc, file_path ) elif ( level == 'sym' ): fillSymTable(target, ddsuffix) getSymbolVal(target, node, proc, symbol, file_path) -- cgit v1.2.1