diff options
Diffstat (limited to 'bitbake/lib/bb/utils.py')
-rw-r--r-- | bitbake/lib/bb/utils.py | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/bitbake/lib/bb/utils.py b/bitbake/lib/bb/utils.py index 988b845a4a..857f5bcf96 100644 --- a/bitbake/lib/bb/utils.py +++ b/bitbake/lib/bb/utils.py | |||
@@ -908,11 +908,17 @@ def cpu_count(): | |||
908 | def nonblockingfd(fd): | 908 | def nonblockingfd(fd): |
909 | fcntl.fcntl(fd, fcntl.F_SETFL, fcntl.fcntl(fd, fcntl.F_GETFL) | os.O_NONBLOCK) | 909 | fcntl.fcntl(fd, fcntl.F_SETFL, fcntl.fcntl(fd, fcntl.F_GETFL) | os.O_NONBLOCK) |
910 | 910 | ||
911 | def process_profilelog(fn): | 911 | def process_profilelog(fn, pout = None): |
912 | pout = open(fn + '.processed', 'w') | 912 | # Either call with a list of filenames and set pout or a filename and optionally pout. |
913 | if not pout: | ||
914 | pout = fn + '.processed' | ||
915 | pout = open(pout, 'w') | ||
913 | 916 | ||
914 | import pstats | 917 | import pstats |
915 | p = pstats.Stats(fn, stream=pout) | 918 | if isinstance(fn, list): |
919 | p = pstats.Stats(*fn, stream=pout) | ||
920 | else: | ||
921 | p = pstats.Stats(fn, stream=pout) | ||
916 | p.sort_stats('time') | 922 | p.sort_stats('time') |
917 | p.print_stats() | 923 | p.print_stats() |
918 | p.print_callers() | 924 | p.print_callers() |