[Lldb-commits] [lldb] r123807 - in /lldb/trunk/test: README-TestSuite dotest.py
Johnny Chen
johnny.chen at apple.com
Tue Jan 18 18:10:40 PST 2011
Author: johnny
Date: Tue Jan 18 20:10:40 2011
New Revision: 123807
URL: http://llvm.org/viewvc/llvm-project?rev=123807&view=rev
Log:
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.
Modified:
lldb/trunk/test/README-TestSuite
lldb/trunk/test/dotest.py
Modified: lldb/trunk/test/README-TestSuite
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/test/README-TestSuite?rev=123807&r1=123806&r2=123807&view=diff
==============================================================================
--- lldb/trunk/test/README-TestSuite (original)
+++ lldb/trunk/test/README-TestSuite Tue Jan 18 20:10:40 2011
@@ -90,3 +90,12 @@
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.
Modified: lldb/trunk/test/dotest.py
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/test/dotest.py?rev=123807&r1=123806&r2=123807&view=diff
==============================================================================
--- lldb/trunk/test/dotest.py (original)
+++ lldb/trunk/test/dotest.py Tue Jan 18 20:10:40 2011
@@ -439,7 +439,10 @@
global testdirs
# Get the directory containing the current script.
- scriptPath = sys.path[0]
+ 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."
sys.exit(-1)
More information about the lldb-commits
mailing list