diff options
author | Richard Purdie <richard.purdie@linuxfoundation.org> | 2011-06-10 16:22:54 +0000 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2013-01-28 14:49:05 +0000 |
commit | cfb082961a6c9ac3d65738031c4071210529cd07 (patch) | |
tree | c0f821e0927d61bdf4321906a2317dbfa8e04392 /bitbake/lib/bb/build.py | |
parent | dd335b09089c14016642a51b812500556e8f453c (diff) | |
download | ast2050-yocto-poky-cfb082961a6c9ac3d65738031c4071210529cd07.zip ast2050-yocto-poky-cfb082961a6c9ac3d65738031c4071210529cd07.tar.gz |
bitbake: build.py: Dump out performance data of individual tasks
(Bitbake rev: 32aa49519e4f015e3c21466a7e5dc939f6369851)
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'bitbake/lib/bb/build.py')
-rw-r--r-- | bitbake/lib/bb/build.py | 18 |
1 files changed, 16 insertions, 2 deletions
diff --git a/bitbake/lib/bb/build.py b/bitbake/lib/bb/build.py index 2f6a61f..5f5a007 100644 --- a/bitbake/lib/bb/build.py +++ b/bitbake/lib/bb/build.py @@ -423,13 +423,27 @@ def _exec_task(fn, task, d, quieterr): return 0 -def exec_task(fn, task, d): +def exec_task(fn, task, d, profile = False): try: quieterr = False if d.getVarFlag(task, "quieterrors") is not None: quieterr = True - return _exec_task(fn, task, d, quieterr) + if profile: + profname = "profile-%s.log" % (os.path.basename(fn) + "-" + task) + try: + import cProfile as profile + except: + import profile + prof = profile.Profile() + ret = profile.Profile.runcall(prof, _exec_task, fn, task, d, quieterr) + prof.dump_stats(profname) + bb.utils.process_profilelog(profname) + + return ret + else: + return _exec_task(fn, task, d, quieterr) + except Exception: from traceback import format_exc if not quieterr: |