Boost logo

Boost-Commit :

From: ghost_at_[hidden]
Date: 2007-10-22 13:03:04


Author: vladimir_prus
Date: 2007-10-22 13:03:04 EDT (Mon, 22 Oct 2007)
New Revision: 40290
URL: http://svn.boost.org/trac/boost/changeset/40290

Log:
Add support for profiling
Text files modified:
   branches/build/python_port/python/boost/build/build_system.py | 17 ++++++++++++++++-
   1 files changed, 16 insertions(+), 1 deletions(-)

Modified: branches/build/python_port/python/boost/build/build_system.py
==============================================================================
--- branches/build/python_port/python/boost/build/build_system.py (original)
+++ branches/build/python_port/python/boost/build/build_system.py 2007-10-22 13:03:04 EDT (Mon, 22 Oct 2007)
@@ -82,10 +82,25 @@
 def main(dummy):
 
     global argv
+ argv = bjam.variable("ARGV")
+
+ if "--profiling" in argv:
+ import cProfile
+ import pstats
+ cProfile.runctx('main_real()', globals(), locals(), "stones.prof")
+
+ stats = pstats.Stats("stones.prof")
+ stats.strip_dirs()
+ stats.sort_stats('time', 'calls')
+ stats.print_callers(20)
+ else:
+ main_real()
+
+def main_real():
+
     global ignore_config
     global debug_config
     
- argv = bjam.variable("ARGV")
     boost_build_path = bjam.variable("BOOST_BUILD_PATH")
 
     engine = Engine()


Boost-Commit list run by bdawes at acm.org, david.abrahams at rcn.com, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk