diff options
author | Joshua Watt <JPEWhacker@gmail.com> | 2020-03-09 11:33:50 -0500 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2020-03-13 11:29:23 +0000 |
commit | 554894287ec8f3bd0612dddabee43213c12c3dc3 (patch) | |
tree | 70d33d8423acbb9d7934b747241497b1d5c83159 | |
parent | 64e7ee43769925492e35854ce4ee307e00c74844 (diff) | |
download | poky-554894287ec8f3bd0612dddabee43213c12c3dc3.tar.gz |
bitbake: runqueue/siggen: Log hash equivalence with a different logger
Switches the hash equivalence logging to use a different logger so that
it can be easily filtered out with python's structured logging.
(Bitbake rev: 20bb29ef973e9c5483eb50a74550ea207637367b)
Signed-off-by: Joshua Watt <JPEWhacker@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
-rw-r--r-- | bitbake/lib/bb/runqueue.py | 11 | ||||
-rw-r--r-- | bitbake/lib/bb/siggen.py | 17 |
2 files changed, 15 insertions, 13 deletions
diff --git a/bitbake/lib/bb/runqueue.py b/bitbake/lib/bb/runqueue.py index 4106fa4bc4..e84890b8b7 100644 --- a/bitbake/lib/bb/runqueue.py +++ b/bitbake/lib/bb/runqueue.py | |||
@@ -27,6 +27,7 @@ import pprint | |||
27 | 27 | ||
28 | bblogger = logging.getLogger("BitBake") | 28 | bblogger = logging.getLogger("BitBake") |
29 | logger = logging.getLogger("BitBake.RunQueue") | 29 | logger = logging.getLogger("BitBake.RunQueue") |
30 | hashequiv_logger = logging.getLogger("BitBake.RunQueue.HashEquiv") | ||
30 | 31 | ||
31 | __find_sha256__ = re.compile( r'(?i)(?<![a-z0-9])[a-f0-9]{64}(?![a-z0-9])' ) | 32 | __find_sha256__ = re.compile( r'(?i)(?<![a-z0-9])[a-f0-9]{64}(?![a-z0-9])' ) |
32 | 33 | ||
@@ -2263,7 +2264,7 @@ class RunQueueExecute: | |||
2263 | self.updated_taskhash_queue.remove((tid, unihash)) | 2264 | self.updated_taskhash_queue.remove((tid, unihash)) |
2264 | 2265 | ||
2265 | if unihash != self.rqdata.runtaskentries[tid].unihash: | 2266 | if unihash != self.rqdata.runtaskentries[tid].unihash: |
2266 | logger.info("Task %s unihash changed to %s" % (tid, unihash)) | 2267 | hashequiv_logger.info("Task %s unihash changed to %s" % (tid, unihash)) |
2267 | self.rqdata.runtaskentries[tid].unihash = unihash | 2268 | self.rqdata.runtaskentries[tid].unihash = unihash |
2268 | bb.parse.siggen.set_unihash(tid, unihash) | 2269 | bb.parse.siggen.set_unihash(tid, unihash) |
2269 | toprocess.add(tid) | 2270 | toprocess.add(tid) |
@@ -2308,7 +2309,7 @@ class RunQueueExecute: | |||
2308 | elif tid in self.scenequeue_covered or tid in self.sq_live: | 2309 | elif tid in self.scenequeue_covered or tid in self.sq_live: |
2309 | # Already ran this setscene task or it running. Report the new taskhash | 2310 | # Already ran this setscene task or it running. Report the new taskhash |
2310 | bb.parse.siggen.report_unihash_equiv(tid, newhash, origuni, newuni, self.rqdata.dataCaches) | 2311 | bb.parse.siggen.report_unihash_equiv(tid, newhash, origuni, newuni, self.rqdata.dataCaches) |
2311 | logger.info("Already covered setscene for %s so ignoring rehash (remap)" % (tid)) | 2312 | hashequiv_logger.info("Already covered setscene for %s so ignoring rehash (remap)" % (tid)) |
2312 | remapped = True | 2313 | remapped = True |
2313 | 2314 | ||
2314 | if not remapped: | 2315 | if not remapped: |
@@ -2327,7 +2328,7 @@ class RunQueueExecute: | |||
2327 | for mc in self.rq.fakeworker: | 2328 | for mc in self.rq.fakeworker: |
2328 | self.rq.fakeworker[mc].process.stdin.write(b"<newtaskhashes>" + pickle.dumps(bb.parse.siggen.get_taskhashes()) + b"</newtaskhashes>") | 2329 | self.rq.fakeworker[mc].process.stdin.write(b"<newtaskhashes>" + pickle.dumps(bb.parse.siggen.get_taskhashes()) + b"</newtaskhashes>") |
2329 | 2330 | ||
2330 | logger.debug(1, pprint.pformat("Tasks changed:\n%s" % (changed))) | 2331 | hashequiv_logger.debug(1, pprint.pformat("Tasks changed:\n%s" % (changed))) |
2331 | 2332 | ||
2332 | for tid in changed: | 2333 | for tid in changed: |
2333 | if tid not in self.rqdata.runq_setscene_tids: | 2334 | if tid not in self.rqdata.runq_setscene_tids: |
@@ -2346,7 +2347,7 @@ class RunQueueExecute: | |||
2346 | # Check no tasks this covers are running | 2347 | # Check no tasks this covers are running |
2347 | for dep in self.sqdata.sq_covered_tasks[tid]: | 2348 | for dep in self.sqdata.sq_covered_tasks[tid]: |
2348 | if dep in self.runq_running and dep not in self.runq_complete: | 2349 | if dep in self.runq_running and dep not in self.runq_complete: |
2349 | logger.debug(2, "Task %s is running which blocks setscene for %s from running" % (dep, tid)) | 2350 | hashequiv_logger.debug(2, "Task %s is running which blocks setscene for %s from running" % (dep, tid)) |
2350 | valid = False | 2351 | valid = False |
2351 | break | 2352 | break |
2352 | if not valid: | 2353 | if not valid: |
@@ -2409,7 +2410,7 @@ class RunQueueExecute: | |||
2409 | 2410 | ||
2410 | for (tid, harddepfail, origvalid) in update_tasks: | 2411 | for (tid, harddepfail, origvalid) in update_tasks: |
2411 | if tid in self.sqdata.valid and not origvalid: | 2412 | if tid in self.sqdata.valid and not origvalid: |
2412 | logger.info("Setscene task %s became valid" % tid) | 2413 | hashequiv_logger.info("Setscene task %s became valid" % tid) |
2413 | if harddepfail: | 2414 | if harddepfail: |
2414 | self.sq_task_failoutright(tid) | 2415 | self.sq_task_failoutright(tid) |
2415 | 2416 | ||
diff --git a/bitbake/lib/bb/siggen.py b/bitbake/lib/bb/siggen.py index c2d0c736cf..0357b544b5 100644 --- a/bitbake/lib/bb/siggen.py +++ b/bitbake/lib/bb/siggen.py | |||
@@ -16,6 +16,7 @@ from bb import runqueue | |||
16 | import hashserv | 16 | import hashserv |
17 | 17 | ||
18 | logger = logging.getLogger('BitBake.SigGen') | 18 | logger = logging.getLogger('BitBake.SigGen') |
19 | hashequiv_logger = logging.getLogger('BitBake.SigGen.HashEquiv') | ||
19 | 20 | ||
20 | def init(d): | 21 | def init(d): |
21 | siggens = [obj for obj in globals().values() | 22 | siggens = [obj for obj in globals().values() |
@@ -502,9 +503,9 @@ class SignatureGeneratorUniHashMixIn(object): | |||
502 | # A unique hash equal to the taskhash is not very interesting, | 503 | # A unique hash equal to the taskhash is not very interesting, |
503 | # so it is reported it at debug level 2. If they differ, that | 504 | # so it is reported it at debug level 2. If they differ, that |
504 | # is much more interesting, so it is reported at debug level 1 | 505 | # is much more interesting, so it is reported at debug level 1 |
505 | bb.debug((1, 2)[unihash == taskhash], 'Found unihash %s in place of %s for %s from %s' % (unihash, taskhash, tid, self.server)) | 506 | hashequiv_logger.debug((1, 2)[unihash == taskhash], 'Found unihash %s in place of %s for %s from %s' % (unihash, taskhash, tid, self.server)) |
506 | else: | 507 | else: |
507 | bb.debug(2, 'No reported unihash for %s:%s from %s' % (tid, taskhash, self.server)) | 508 | hashequiv_logger.debug(2, 'No reported unihash for %s:%s from %s' % (tid, taskhash, self.server)) |
508 | except hashserv.client.HashConnectionError as e: | 509 | except hashserv.client.HashConnectionError as e: |
509 | bb.warn('Error contacting Hash Equivalence Server %s: %s' % (self.server, str(e))) | 510 | bb.warn('Error contacting Hash Equivalence Server %s: %s' % (self.server, str(e))) |
510 | 511 | ||
@@ -578,12 +579,12 @@ class SignatureGeneratorUniHashMixIn(object): | |||
578 | new_unihash = data['unihash'] | 579 | new_unihash = data['unihash'] |
579 | 580 | ||
580 | if new_unihash != unihash: | 581 | if new_unihash != unihash: |
581 | bb.debug(1, 'Task %s unihash changed %s -> %s by server %s' % (taskhash, unihash, new_unihash, self.server)) | 582 | hashequiv_logger.debug(1, 'Task %s unihash changed %s -> %s by server %s' % (taskhash, unihash, new_unihash, self.server)) |
582 | bb.event.fire(bb.runqueue.taskUniHashUpdate(fn + ':do_' + task, new_unihash), d) | 583 | bb.event.fire(bb.runqueue.taskUniHashUpdate(fn + ':do_' + task, new_unihash), d) |
583 | self.set_unihash(tid, new_unihash) | 584 | self.set_unihash(tid, new_unihash) |
584 | d.setVar('BB_UNIHASH', new_unihash) | 585 | d.setVar('BB_UNIHASH', new_unihash) |
585 | else: | 586 | else: |
586 | bb.debug(1, 'Reported task %s as unihash %s to %s' % (taskhash, unihash, self.server)) | 587 | hashequiv_logger.debug(1, 'Reported task %s as unihash %s to %s' % (taskhash, unihash, self.server)) |
587 | except hashserv.client.HashConnectionError as e: | 588 | except hashserv.client.HashConnectionError as e: |
588 | bb.warn('Error contacting Hash Equivalence Server %s: %s' % (self.server, str(e))) | 589 | bb.warn('Error contacting Hash Equivalence Server %s: %s' % (self.server, str(e))) |
589 | finally: | 590 | finally: |
@@ -606,7 +607,7 @@ class SignatureGeneratorUniHashMixIn(object): | |||
606 | method = method + self.extramethod[tid] | 607 | method = method + self.extramethod[tid] |
607 | 608 | ||
608 | data = self.client().report_unihash_equiv(taskhash, method, wanted_unihash, extra_data) | 609 | data = self.client().report_unihash_equiv(taskhash, method, wanted_unihash, extra_data) |
609 | bb.note('Reported task %s as unihash %s to %s (%s)' % (tid, wanted_unihash, self.server, str(data))) | 610 | hashequiv_logger.info('Reported task %s as unihash %s to %s (%s)' % (tid, wanted_unihash, self.server, str(data))) |
610 | 611 | ||
611 | if data is None: | 612 | if data is None: |
612 | bb.warn("Server unable to handle unihash report") | 613 | bb.warn("Server unable to handle unihash report") |
@@ -615,14 +616,14 @@ class SignatureGeneratorUniHashMixIn(object): | |||
615 | finalunihash = data['unihash'] | 616 | finalunihash = data['unihash'] |
616 | 617 | ||
617 | if finalunihash == current_unihash: | 618 | if finalunihash == current_unihash: |
618 | bb.note('Task %s unihash %s unchanged by server' % (tid, finalunihash)) | 619 | hashequiv_logger.info('Task %s unihash %s unchanged by server' % (tid, finalunihash)) |
619 | elif finalunihash == wanted_unihash: | 620 | elif finalunihash == wanted_unihash: |
620 | bb.note('Task %s unihash changed %s -> %s as wanted' % (tid, current_unihash, finalunihash)) | 621 | hashequiv_logger.info('Task %s unihash changed %s -> %s as wanted' % (tid, current_unihash, finalunihash)) |
621 | self.set_unihash(tid, finalunihash) | 622 | self.set_unihash(tid, finalunihash) |
622 | return True | 623 | return True |
623 | else: | 624 | else: |
624 | # TODO: What to do here? | 625 | # TODO: What to do here? |
625 | bb.note('Task %s unihash reported as unwanted hash %s' % (tid, finalunihash)) | 626 | hashequiv_logger.info('Task %s unihash reported as unwanted hash %s' % (tid, finalunihash)) |
626 | 627 | ||
627 | except hashserv.client.HashConnectionError as e: | 628 | except hashserv.client.HashConnectionError as e: |
628 | bb.warn('Error contacting Hash Equivalence Server %s: %s' % (self.server, str(e))) | 629 | bb.warn('Error contacting Hash Equivalence Server %s: %s' % (self.server, str(e))) |