From 3bb932a4af59efeea2e0ca96dfcbb9f5df12f1ab Mon Sep 17 00:00:00 2001 From: Vladimir Prus Date: Fri, 30 Jul 2010 20:57:40 +0000 Subject: [PATCH] Adjust profiling code [SVN r64487] --- src/build_system.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/build_system.py b/src/build_system.py index 3956481a5..9d2f05f26 100644 --- a/src/build_system.py +++ b/src/build_system.py @@ -433,13 +433,14 @@ def main(): # FIXME: document this option. if "--profiling" in sys.argv: import cProfile + r = cProfile.runctx('main_real()', globals(), locals(), "stones.prof") + import pstats - return 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) + return r else: try: return main_real()