Added special logic to faciliate profiling the test suite run with the cProfile.py

module.

On my MBP running SnowLeopard:

$ DOTEST_PROFILE=YES DOTEST_SCRIPT_DIR=/Volumes/data/lldb/svn/trunk/test /System/Library/Frameworks/Python.framework/Versions/Current/lib/python2.6/cProfile.py -o my.profile ./dotest.py -v -w 2> ~/Developer/Log/lldbtest.log

After that, I used the pstats.py module to browse the statistics recorded in the my.profile file. 

llvm-svn: 123807
This commit is contained in:
Johnny Chen 2011-01-19 02:10:40 +00:00
parent cf7f74e31c
commit 30775d0107
2 changed files with 13 additions and 1 deletions

View File

@ -90,3 +90,12 @@ o dotest.pl
suite become more reliable, we don't expect to be using 'dotest.pl' anymore.
Note: dotest.pl has been moved to the attic directory.
o Profiling dotest.py runs
I used the following command line thingy to do the profiling on a SnowLeopard
machine:
$ DOTEST_PROFILE=YES DOTEST_SCRIPT_DIR=/Volumes/data/lldb/svn/trunk/test /System/Library/Frameworks/Python.framework/Versions/Current/lib/python2.6/cProfile.py -o my.profile ./dotest.py -v -w 2> ~/Developer/Log/lldbtest.log
After that, I used the pstats.py module to browse the statistics.

View File

@ -439,6 +439,9 @@ def setupSysPath():
global testdirs
# Get the directory containing the current script.
if "DOTEST_PROFILE" in os.environ and "DOTEST_SCRIPT_DIR" in os.environ:
scriptPath = os.environ["DOTEST_SCRIPT_DIR"]
else:
scriptPath = sys.path[0]
if not scriptPath.endswith('test'):
print "This script expects to reside in lldb's test directory."