98 """Save python profile data of the default athena profiler instance
99 into filename (.txt or .pkl format).
101 from AthenaCommon.Logging
import log
105 profiler = cProfile._athena_python_profiler
107 if filename.endswith(
".txt"):
108 stats = pstats.Stats(profiler, stream=open(filename,
'w'))
109 stats.strip_dirs().sort_stats(
"time").print_stats()
110 log.info(
"Python profile summary stored in %s", filename)
112 profiler.dump_stats(filename)
113 log.info(
"Python profile stored in %s", filename)