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>2020-01-11 11:06:21 +0000
commit8d72948bf4aad4a58e5b314eb3be73739fe8c49a (patch)
treef915b7875f953a790d450d99844ba109e02650b4 /meta/classes/sstate.bbclass
parent0dc56663c6a47140fc9c3beb43d756054f995766 (diff)
downloadpoky-8d72948bf4aad4a58e5b314eb3be73739fe8c49a.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: a67bd96de2b253c1d4c3bd82120f28dee06a4bf6) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org> (cherry picked from commit 038004866ff6650bcff7bb1bde36de6c0f451d29) Signed-off-by: Armin Kuster <akuster808@gmail.com> 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)