[oe-commits] [openembedded-core] 23/23: sstate: Add sstate usage summary to the build

git at git.openembedded.org git at git.openembedded.org
Wed Aug 8 09:52:49 UTC 2018


This is an automated email from the git hooks/post-receive script.

rpurdie pushed a commit to branch master
in repository openembedded-core.

commit 596f76029ccb6f87c3b049552bd08f5034c41d9c
Author: Richard Purdie <richard.purdie at linuxfoundation.org>
AuthorDate: Tue Aug 7 14:26:20 2018 +0000

    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]
    
    Signed-off-by: Richard Purdie <richard.purdie at linuxfoundation.org>
---
 meta/classes/sstate.bbclass | 12 ++++++++++++
 1 file changed, 12 insertions(+)

diff --git a/meta/classes/sstate.bbclass b/meta/classes/sstate.bbclass
index 350d310..6743bec 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):
             evdata['found'].append( (sq_fn[task], sq_task[task], sq_hash[task], sstatefile ) )
         bb.event.fire(bb.event.MetadataEvent("MissedSstate", evdata), d)
 
+    # Print some summary statistics about the current task completion and how much sstate
+    # reuse there was. Avoid divide by zero errors.
+    total = len(sq_fn)
+    currentcount = d.getVar("BB_SETSCENE_STAMPCURRENT_COUNT") or 0
+    complete = 0
+    if currentcount:
+        complete = (len(ret) + currentcount) / (total + currentcount) * 100
+    match = 0
+    if total:
+        match = len(ret) / total * 100
+    bb.plain("Sstate summary: Wanted %d Found %d Missed %d Current %d (%d%% match, %d%% complete)" % (total, len(ret), len(missed), currentcount, match, complete))
+
     if hasattr(bb.parse.siggen, "checkhashes"):
         bb.parse.siggen.checkhashes(missed, ret, sq_fn, sq_task, sq_hash, sq_hashfn, d)
 

-- 
To stop receiving notification emails like this one, please contact
the administrator of this repository.


More information about the Openembedded-commits mailing list