From: Chen Qi Date: Tue, 19 May 2015 07:31:29 +0000 (+0800) Subject: buildstats-summary: add eventmask X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=refs%2Fheads%2FChenQi%2Fbuildstats-summary;p=thirdparty%2Fopenembedded%2Fopenembedded-core-contrib.git buildstats-summary: add eventmask Add eventmask 'bb.event.BuildCompleted' for buildstats_summary handler to avoid running the codes in the handler everytime there's an event. The codes in buildstats_summary only need to run for bb.event.BuildCompleted. So add this event mask. Also, we remove the redundant isinstance() statement in the handler. Signed-off-by: Chen Qi --- diff --git a/meta/classes/buildstats-summary.bbclass b/meta/classes/buildstats-summary.bbclass index c8fbb2f1a16..05ead9fdbf1 100644 --- a/meta/classes/buildstats-summary.bbclass +++ b/meta/classes/buildstats-summary.bbclass @@ -1,8 +1,5 @@ # Summarize sstate usage at the end of the build python buildstats_summary () { - if not isinstance(e, bb.event.BuildCompleted): - return - import collections import os.path @@ -37,3 +34,4 @@ python buildstats_summary () { bb.note(" {0}: {1}% sstate reuse ({2} setscene, {3} scratch)".format(t, 100*len(sstate)/(len(sstate)+len(no_sstate)), len(sstate), len(no_sstate))) } addhandler buildstats_summary +buildstats_summary[eventmask] = "bb.event.BuildCompleted"