summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJose Quaresma <quaresma.jose@gmail.com>2022-08-05 10:47:51 +0100
committerRichard Purdie <richard.purdie@linuxfoundation.org>2022-08-09 16:28:04 +0100
commit950a2ea4c91d6e13d7587104367fa85cc7efe01c (patch)
treebd61317d1516cecf6cc4f389c0cb84a692e068c4
parent44c395434c7be8dab968630a610c8807f512920c (diff)
downloadbitbake-950a2ea4c91d6e13d7587104367fa85cc7efe01c.tar.gz
build: prefix the tasks with a timestamp in the log task_order
This is useful when debugging as it helps understand possible race conditions between tasks of diferent recipes. Signed-off-by: Jose Quaresma <jose.quaresma@foundries.io> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
-rw-r--r--lib/bb/build.py4
1 files changed, 3 insertions, 1 deletions
diff --git a/lib/bb/build.py b/lib/bb/build.py
index 55f68b98c..b8c1099ef 100644
--- a/lib/bb/build.py
+++ b/lib/bb/build.py
@@ -20,6 +20,7 @@ import itertools
import time
import re
import stat
+import datetime
import bb
import bb.msg
import bb.process
@@ -618,7 +619,8 @@ def _exec_task(fn, task, d, quieterr):
logorder = os.path.join(tempdir, 'log.task_order')
try:
with open(logorder, 'a') as logorderfile:
- logorderfile.write('{0} ({1}): {2}\n'.format(task, os.getpid(), logbase))
+ timestamp = datetime.datetime.now().strftime("%Y%m%d-%H%M%S.%f")
+ logorderfile.write('{0} {1} ({2}): {3}\n'.format(timestamp, task, os.getpid(), logbase))
except OSError:
logger.exception("Opening log file '%s'", logorder)
pass