bitbake: 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.

(Bitbake rev: 950a2ea4c91d6e13d7587104367fa85cc7efe01c)

Signed-off-by: Jose Quaresma <jose.quaresma@foundries.io>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
This commit is contained in:
Jose Quaresma
2022-08-05 10:47:51 +01:00
committed by Richard Purdie
parent f5c616d5af
commit 8a1afec0d5

View File

@@ -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