]> code.ossystems Code Review - openembedded-core.git/commitdiff
buildstats-summary: add eventmask
authorChen Qi <Qi.Chen@windriver.com>
Wed, 20 May 2015 02:21:48 +0000 (10:21 +0800)
committerRichard Purdie <richard.purdie@linuxfoundation.org>
Sat, 23 May 2015 06:55:44 +0000 (07:55 +0100)
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 <Qi.Chen@windriver.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
meta/classes/buildstats-summary.bbclass

index c8fbb2f1a16f5b94ad2576e54e9a401a8adec907..05ead9fdbf133de04af9357ee6b43eb7ac8dd0b6 100644 (file)
@@ -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"