summaryrefslogtreecommitdiffstats
path: root/meta/classes/sstate.bbclass
diff options
context:
space:
mode:
authorRichard Purdie <richard.purdie@linuxfoundation.org>2018-08-07 14:26:20 +0000
committerRichard Purdie <richard.purdie@linuxfoundation.org>2018-08-08 10:52:00 +0100
commit6bb9ac9c65432b4c88c3a6827e036d6e5f8cf6a9 (patch)
tree6033989a8c8e0593bdd75774e37e8ae2dae0e88e /meta/classes/sstate.bbclass
parente9ec9bfdb71a38743f5ec2270f4b4870ab65f595 (diff)
downloadpoky-6bb9ac9c65432b4c88c3a6827e036d6e5f8cf6a9.tar.gz
sstate: Add sstate usage summary to the build
Currently the user has no indication of how much sstate was already present or that would be used by the build. This change adds some summary information so that the user can see how much reuse is occurring. To fully work it needs some extra information from a recent bitbake commit but this is optional. When combined with bitbake --dry-run this feature can be used to check if sstate would be reused in a build. [YOCTO #12749] (From OE-Core rev: 596f76029ccb6f87c3b049552bd08f5034c41d9c) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/classes/sstate.bbclass')
-rw-r--r--meta/classes/sstate.bbclass12
1 files changed, 12 insertions, 0 deletions
diff --git a/meta/classes/sstate.bbclass b/meta/classes/sstate.bbclass
index 350d3107f5..6743becf07 100644
--- a/meta/classes/sstate.bbclass
+++ b/meta/classes/sstate.bbclass
@@ -892,6 +892,18 @@ def sstate_checkhashes(sq_fn, sq_task, sq_hash, sq_hashfn, d, siginfo=False):
892 evdata['found'].append( (sq_fn[task], sq_task[task], sq_hash[task], sstatefile ) ) 892 evdata['found'].append( (sq_fn[task], sq_task[task], sq_hash[task], sstatefile ) )
893 bb.event.fire(bb.event.MetadataEvent("MissedSstate", evdata), d) 893 bb.event.fire(bb.event.MetadataEvent("MissedSstate", evdata), d)
894 894
895 # Print some summary statistics about the current task completion and how much sstate
896 # reuse there was. Avoid divide by zero errors.
897 total = len(sq_fn)
898 currentcount = d.getVar("BB_SETSCENE_STAMPCURRENT_COUNT") or 0
899 complete = 0
900 if currentcount:
901 complete = (len(ret) + currentcount) / (total + currentcount) * 100
902 match = 0
903 if total:
904 match = len(ret) / total * 100
905 bb.plain("Sstate summary: Wanted %d Found %d Missed %d Current %d (%d%% match, %d%% complete)" % (total, len(ret), len(missed), currentcount, match, complete))
906
895 if hasattr(bb.parse.siggen, "checkhashes"): 907 if hasattr(bb.parse.siggen, "checkhashes"):
896 bb.parse.siggen.checkhashes(missed, ret, sq_fn, sq_task, sq_hash, sq_hashfn, d) 908 bb.parse.siggen.checkhashes(missed, ret, sq_fn, sq_task, sq_hash, sq_hashfn, d)
897 909