summaryrefslogtreecommitdiffstats
path: root/meta/classes/sstate.bbclass
diff options
context:
space:
mode:
authorRichard Purdie <richard.purdie@linuxfoundation.org>2019-11-04 17:28:58 +0000
committerRichard Purdie <richard.purdie@linuxfoundation.org>2019-11-07 15:12:00 +0000
commitf77b00c3f44eabcaae0b528b14f685d8dd94278e (patch)
tree660422805ef5af652eedf1c14db9b3667ea7e963 /meta/classes/sstate.bbclass
parent61f5370c9b4a03950c830e360411090bc323ae55 (diff)
downloadpoky-f77b00c3f44eabcaae0b528b14f685d8dd94278e.tar.gz
sstate: Add ability to hide summary output for sstate
Its confusing to keep seeing sstate summary messages when hash equivalency is active. This adds an option to control it. A default value is given which maintains compatibility with different bitbake versions. (From OE-Core rev: 038004866ff6650bcff7bb1bde36de6c0f451d29) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/classes/sstate.bbclass')
-rw-r--r--meta/classes/sstate.bbclass23
1 files changed, 12 insertions, 11 deletions
diff --git a/meta/classes/sstate.bbclass b/meta/classes/sstate.bbclass
index b47b9c23bf..64808f8e10 100644
--- a/meta/classes/sstate.bbclass
+++ b/meta/classes/sstate.bbclass
@@ -818,7 +818,7 @@ sstate_unpack_package () {
818 818
819BB_HASHCHECK_FUNCTION = "sstate_checkhashes" 819BB_HASHCHECK_FUNCTION = "sstate_checkhashes"
820 820
821def sstate_checkhashes(sq_data, d, siginfo=False, currentcount=0, **kwargs): 821def sstate_checkhashes(sq_data, d, siginfo=False, currentcount=0, summary=True, **kwargs):
822 found = set() 822 found = set()
823 missed = set() 823 missed = set()
824 extension = ".tgz" 824 extension = ".tgz"
@@ -951,16 +951,17 @@ def sstate_checkhashes(sq_data, d, siginfo=False, currentcount=0, **kwargs):
951 evdata['found'].append((bb.runqueue.fn_from_tid(tid), bb.runqueue.taskname_from_tid(tid), gethash(tid), sstatefile ) ) 951 evdata['found'].append((bb.runqueue.fn_from_tid(tid), bb.runqueue.taskname_from_tid(tid), gethash(tid), sstatefile ) )
952 bb.event.fire(bb.event.MetadataEvent("MissedSstate", evdata), d) 952 bb.event.fire(bb.event.MetadataEvent("MissedSstate", evdata), d)
953 953
954 # Print some summary statistics about the current task completion and how much sstate 954 if summary:
955 # reuse there was. Avoid divide by zero errors. 955 # Print some summary statistics about the current task completion and how much sstate
956 total = len(sq_data['hash']) 956 # reuse there was. Avoid divide by zero errors.
957 complete = 0 957 total = len(sq_data['hash'])
958 if currentcount: 958 complete = 0
959 complete = (len(found) + currentcount) / (total + currentcount) * 100 959 if currentcount:
960 match = 0 960 complete = (len(found) + currentcount) / (total + currentcount) * 100
961 if total: 961 match = 0
962 match = len(found) / total * 100 962 if total:
963 bb.plain("Sstate summary: Wanted %d Found %d Missed %d Current %d (%d%% match, %d%% complete)" % (total, len(found), len(missed), currentcount, match, complete)) 963 match = len(found) / total * 100
964 bb.plain("Sstate summary: Wanted %d Found %d Missed %d Current %d (%d%% match, %d%% complete)" % (total, len(found), len(missed), currentcount, match, complete))
964 965
965 if hasattr(bb.parse.siggen, "checkhashes"): 966 if hasattr(bb.parse.siggen, "checkhashes"):
966 bb.parse.siggen.checkhashes(sq_data, missed, found, d) 967 bb.parse.siggen.checkhashes(sq_data, missed, found, d)