Signed-off-by: Martin Jansa <[email protected]> --- meta/classes/buildstats-summary.bbclass | 43 +++++++++++++++++++++++++++++++++ 1 file changed, 43 insertions(+) create mode 100644 meta/classes/buildstats-summary.bbclass
diff --git a/meta/classes/buildstats-summary.bbclass b/meta/classes/buildstats-summary.bbclass new file mode 100644 index 0000000..3c02724 --- /dev/null +++ b/meta/classes/buildstats-summary.bbclass @@ -0,0 +1,43 @@ +# Imported from meta-mentor +# http://git.yoctoproject.org/cgit/cgit.cgi/meta-mentor/log/classes/buildstats-summary.bbclass +# with following modifications +# 1) when both setscene and normal tasks were executed, count it as no_sstate +# 2) count do_populate_sysroot and do_packagedata tasks, because often we invalidate only runtime deps + +python buildstats_summary () { + if not isinstance(e, bb.event.BuildCompleted): + return + + import os.path + + bn = get_bn(e) + bsdir = os.path.join(e.data.getVar('BUILDSTATS_BASE', True), bn) + if not os.path.exists(bsdir): + return + + sstate_ps, no_sstate_ps, sstate_pd, no_sstate_pd = set(), set(), set(), set() + for pf in os.listdir(bsdir): + taskdir = os.path.join(bsdir, pf) + if not os.path.isdir(taskdir): + continue + + tasks = os.listdir(taskdir) + if 'do_populate_sysroot' in tasks: + no_sstate_ps.add(pf) + elif 'do_populate_sysroot_setscene' in tasks: + sstate_ps.add(pf) + if 'do_packagedata' in tasks: + no_sstate_pd.add(pf) + elif 'do_packagedata_setscene' in tasks: + sstate_pd.add(pf) + + if not sstate_ps and not no_sstate_ps and not sstate_pd and not no_sstate_pd: + return + + bb.note("Build completion summary:") + if (len(sstate_ps)+len(no_sstate_ps)) > 0: + bb.note(" populate_sysroot reused from sstate in %d%% (%d setscene, %d scratch)" % (100*len(sstate_ps)/(len(sstate_ps)+len(no_sstate_ps)), len(sstate_ps), len(no_sstate_ps))) + if (len(sstate_pd)+len(no_sstate_pd)) > 0: + bb.note(" packagedata reused from sstate in %d%% (%d setscene, %d scratch)" % (100*len(sstate_pd)/(len(sstate_pd)+len(no_sstate_pd)), len(sstate_ps), len(no_sstate_ps))) +} +addhandler buildstats_summary -- 2.0.0 -- _______________________________________________ Openembedded-core mailing list [email protected] http://lists.openembedded.org/mailman/listinfo/openembedded-core
