summaryrefslogtreecommitdiffstats
path: root/bitbake/lib/bb/utils.py
diff options
context:
space:
mode:
authorRichard Purdie <richard.purdie@linuxfoundation.org>2015-05-27 17:31:10 +0100
committerRichard Purdie <richard.purdie@linuxfoundation.org>2015-05-29 10:17:16 +0100
commit08b77c8cef3d93098118b9141c19bba382b30d6f (patch)
tree82bc8453b0710d564b56cca31eeb828c9fa591f4 /bitbake/lib/bb/utils.py
parent553267d8d9a732dd1d382cc25077b49caae29af6 (diff)
downloadpoky-08b77c8cef3d93098118b9141c19bba382b30d6f.tar.gz
bitbake: cooker/utils: Improve parsing profiling
Currently the cooker parsing processes each dump an individual profile which is ok, but means absolute numbers of function calls for a given load can be tricky to determine as parsing of recipes may go to different pool threads on different runs. This change collects up the individual thread parsing results and processes them into one profile output. The profile processing function in utils needed tweaks to allow this to work. (Bitbake rev: d3d2541aacd1ea560da0d8b25a3ea3f0563dee70) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'bitbake/lib/bb/utils.py')
-rw-r--r--bitbake/lib/bb/utils.py12
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():
908def nonblockingfd(fd): 908def 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
911def process_profilelog(fn): 911def 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()