Openembedded Core Discussions
 help / color / mirror / Atom feed
* [PATCH] Modify buildstats to be merged inside buildhistory
@ 2013-11-01 18:03 Corneliu Stoicescu
  2013-11-01 18:07 ` Richard Purdie
  0 siblings, 1 reply; 10+ messages in thread
From: Corneliu Stoicescu @ 2013-11-01 18:03 UTC (permalink / raw)
  To: openembedded-core

- added buildstats inheritance inside buildhistory
- reworked the buildstats directory structure not to contain the build name(read: the build start date).
Now it only contains the target name and machine. This is usefull in order to reduce git noise.
- because builds are no longer separated by build name(read: date) it is necessary to remake(remove and create from scratch)
the buildstats folder for each build in order keep buildstats compatible with tools like pybootchartgui.py

Some changes to make the new functionality compatible with Yocto:
- remove buildstats from default usage because it now needs buildhistory (remove it from USER_CLASSES in local.conf)
- add 'buildhistory' to USER_CLASSES or add INHERIT += "buildhistory" in local.conf
OPTIONAL: - I tested this patch with buildhistory under git enabled (BUILDHISTORY_COMMIT = "1" in local.conf). I believe this
should be made default.

I made some tests with the buildhistory-diff tool and it is compatible with the changes. We can add further functionality
to it in order to make it interpret buildstats data.

Signed-off-by: Corneliu Stoicescu <corneliux.stoicescu@intel.com>
---
 meta/classes/buildhistory.bbclass |    1 +
 meta/classes/buildstats.bbclass   |    8 ++++++--
 2 files changed, 7 insertions(+), 2 deletions(-)

diff --git a/meta/classes/buildhistory.bbclass b/meta/classes/buildhistory.bbclass
index 3da03c8..a78bd4b 100644
--- a/meta/classes/buildhistory.bbclass
+++ b/meta/classes/buildhistory.bbclass
@@ -19,6 +19,7 @@ BUILDHISTORY_PUSH_REPO ?= ""
 
 # Must inherit package first before changing PACKAGEFUNCS
 inherit package
+inherit buildstats
 PACKAGEFUNCS += "buildhistory_emit_pkghistory"
 
 # We don't want to force a rerun of do_package for everything
diff --git a/meta/classes/buildstats.bbclass b/meta/classes/buildstats.bbclass
index 72fff11..476ae94 100644
--- a/meta/classes/buildstats.bbclass
+++ b/meta/classes/buildstats.bbclass
@@ -1,4 +1,4 @@
-BUILDSTATS_BASE = "${TMPDIR}/buildstats/"
+BUILDSTATS_BASE = "${BUILDHISTORY_DIR}/buildstats"
 BNFILE = "${BUILDSTATS_BASE}/.buildname"
 DEVFILE = "${BUILDSTATS_BASE}/.device"
 
@@ -33,7 +33,7 @@ def set_bn(e):
 
 def get_bn(e):
     with open(e.data.getVar('BNFILE', True)) as f:
-        bn = f.readline()
+        bn = str(f.readline()).split("/")[0]
     return bn
 
 def set_device(e):
@@ -175,6 +175,10 @@ python run_buildstats () {
         # set the buildname
         ########################################################################
         try:
+            bb.utils.remove(e.data.getVar('BUILDSTATS_BASE', True), recurse=True)
+        except:
+            pass
+        try:
             bb.utils.mkdirhier(e.data.getVar('BUILDSTATS_BASE', True))
         except:
             pass
-- 
1.7.9.5



^ permalink raw reply related	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2013-11-07 10:38 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-11-01 18:03 [PATCH] Modify buildstats to be merged inside buildhistory Corneliu Stoicescu
2013-11-01 18:07 ` Richard Purdie
2013-11-03 11:37   ` Stoicescu, CorneliuX
2013-11-04  9:16     ` Richard Purdie
2013-11-04  9:24       ` Stoicescu, CorneliuX
2013-11-04  9:31         ` Richard Purdie
2013-11-04 12:14           ` Paul Eggleton
2013-11-04 12:34             ` Richard Purdie
2013-11-04 12:42               ` Stoicescu, CorneliuX
2013-11-07 10:38                 ` Paul Eggleton

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox