summaryrefslogtreecommitdiffstats
path: root/bitbake/lib/bb/siggen.py
diff options
context:
space:
mode:
authorJoshua Watt <JPEWhacker@gmail.com>2020-03-09 11:33:50 -0500
committerRichard Purdie <richard.purdie@linuxfoundation.org>2020-03-13 11:29:23 +0000
commit554894287ec8f3bd0612dddabee43213c12c3dc3 (patch)
tree70d33d8423acbb9d7934b747241497b1d5c83159 /bitbake/lib/bb/siggen.py
parent64e7ee43769925492e35854ce4ee307e00c74844 (diff)
downloadpoky-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>
Diffstat (limited to 'bitbake/lib/bb/siggen.py')
-rw-r--r--bitbake/lib/bb/siggen.py17
1 files changed, 9 insertions, 8 deletions
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
16import hashserv 16import hashserv
17 17
18logger = logging.getLogger('BitBake.SigGen') 18logger = logging.getLogger('BitBake.SigGen')
19hashequiv_logger = logging.getLogger('BitBake.SigGen.HashEquiv')
19 20
20def init(d): 21def 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)))