2
0
mirror of https://github.com/boostorg/build.git synced 2026-02-14 12:42:11 +00:00

Adjust profiling code

[SVN r64487]
This commit is contained in:
Vladimir Prus
2010-07-30 20:57:40 +00:00
parent e5e42f3dd0
commit 3bb932a4af

View File

@@ -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()