aboutsummaryrefslogtreecommitdiffstats
path: root/bitbake/lib/bb/build.py
diff options
context:
space:
mode:
authorMark Hatle <mark.hatle@windriver.com>2012-05-23 10:45:09 -0500
committerRichard Purdie <richard.purdie@linuxfoundation.org>2012-05-23 18:15:23 +0100
commitc9e38aed29bf072d83079867c37f3169a7005fce (patch)
tree975b6e3eaadc53055bd10c04fca6019691335033 /bitbake/lib/bb/build.py
parent094742bed2fc01d55f572da946fcfa7a48521401 (diff)
downloadopenembedded-core-contrib-c9e38aed29bf072d83079867c37f3169a7005fce.tar.gz
build.py: Add a log to capture task execution order
The new log.task_order contains an ordered list of the tasks as they were executed in any given recipe. The format of the lines is <task> <pid>: <log file> (Bitbake rev: 8662b43dcbd6e38a5b2ab9d6529af1fb08c146bf) Signed-off-by: Mark Hatle <mark.hatle@windriver.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'bitbake/lib/bb/build.py')
-rw-r--r--bitbake/lib/bb/build.py16
1 files changed, 15 insertions, 1 deletions
diff --git a/bitbake/lib/bb/build.py b/bitbake/lib/bb/build.py
index 95f1dcfcb7..4f06b15943 100644
--- a/bitbake/lib/bb/build.py
+++ b/bitbake/lib/bb/build.py
@@ -290,8 +290,22 @@ def _exec_task(fn, task, d, quieterr):
bb.fatal("T variable not set, unable to build")
bb.utils.mkdirhier(tempdir)
- loglink = os.path.join(tempdir, 'log.{0}'.format(task))
+
+ # Determine the logfile to generate
logbase = 'log.{0}.{1}'.format(task, os.getpid())
+
+ # Document the order of the tasks...
+ logorder = os.path.join(tempdir, 'log.task_order')
+ try:
+ logorderfile = file(logorder, 'a')
+ except OSError:
+ logger.exception("Opening log file '%s'", logorder)
+ pass
+ logorderfile.write('{0} ({1}): {2}\n'.format(task, os.getpid(), logbase))
+ logorderfile.close()
+
+ # Setup the courtesy link to the logfn
+ loglink = os.path.join(tempdir, 'log.{0}'.format(task))
logfn = os.path.join(tempdir, logbase)
if loglink:
bb.utils.remove(loglink)