summaryrefslogtreecommitdiffstats
path: root/bitbake/lib/bb/build.py
diff options
context:
space:
mode:
Diffstat (limited to 'bitbake/lib/bb/build.py')
-rw-r--r--bitbake/lib/bb/build.py18
1 files changed, 16 insertions, 2 deletions
diff --git a/bitbake/lib/bb/build.py b/bitbake/lib/bb/build.py
index 2f6a61f4b0..5f5a007196 100644
--- a/bitbake/lib/bb/build.py
+++ b/bitbake/lib/bb/build.py
@@ -423,13 +423,27 @@ def _exec_task(fn, task, d, quieterr):
423 423
424 return 0 424 return 0
425 425
426def exec_task(fn, task, d): 426def exec_task(fn, task, d, profile = False):
427 try: 427 try:
428 quieterr = False 428 quieterr = False
429 if d.getVarFlag(task, "quieterrors") is not None: 429 if d.getVarFlag(task, "quieterrors") is not None:
430 quieterr = True 430 quieterr = True
431 431
432 return _exec_task(fn, task, d, quieterr) 432 if profile:
433 profname = "profile-%s.log" % (os.path.basename(fn) + "-" + task)
434 try:
435 import cProfile as profile
436 except:
437 import profile
438 prof = profile.Profile()
439 ret = profile.Profile.runcall(prof, _exec_task, fn, task, d, quieterr)
440 prof.dump_stats(profname)
441 bb.utils.process_profilelog(profname)
442
443 return ret
444 else:
445 return _exec_task(fn, task, d, quieterr)
446
433 except Exception: 447 except Exception:
434 from traceback import format_exc 448 from traceback import format_exc
435 if not quieterr: 449 if not quieterr: