summaryrefslogtreecommitdiffstats
path: root/bitbake/lib/bb/utils.py
diff options
context:
space:
mode:
Diffstat (limited to 'bitbake/lib/bb/utils.py')
-rw-r--r--bitbake/lib/bb/utils.py29
1 files changed, 14 insertions, 15 deletions
diff --git a/bitbake/lib/bb/utils.py b/bitbake/lib/bb/utils.py
index e51b8ca508..2d4b258b85 100644
--- a/bitbake/lib/bb/utils.py
+++ b/bitbake/lib/bb/utils.py
@@ -1071,21 +1071,20 @@ def process_profilelog(fn, pout = None):
1071 # Either call with a list of filenames and set pout or a filename and optionally pout. 1071 # Either call with a list of filenames and set pout or a filename and optionally pout.
1072 if not pout: 1072 if not pout:
1073 pout = fn + '.processed' 1073 pout = fn + '.processed'
1074 pout = open(pout, 'w') 1074
1075 1075 with open(pout, 'w') as pout:
1076 import pstats 1076 import pstats
1077 if isinstance(fn, list): 1077 if isinstance(fn, list):
1078 p = pstats.Stats(*fn, stream=pout) 1078 p = pstats.Stats(*fn, stream=pout)
1079 else: 1079 else:
1080 p = pstats.Stats(fn, stream=pout) 1080 p = pstats.Stats(fn, stream=pout)
1081 p.sort_stats('time') 1081 p.sort_stats('time')
1082 p.print_stats() 1082 p.print_stats()
1083 p.print_callers() 1083 p.print_callers()
1084 p.sort_stats('cumulative') 1084 p.sort_stats('cumulative')
1085 p.print_stats() 1085 p.print_stats()
1086 1086
1087 pout.flush() 1087 pout.flush()
1088 pout.close()
1089 1088
1090# 1089#
1091# Was present to work around multiprocessing pool bugs in python < 2.7.3 1090# Was present to work around multiprocessing pool bugs in python < 2.7.3