[2/5] buildstats: consider multiconfigs when collecting statistics.

Message ID 20240112061257.22241-3-ubely@ilbers.de
State Awaiting Upstream
Headers show
Series [1/5] buildstats: Sync code base with openembedded-core 2022-04.15 | expand

Commit Message

Uladzimir Bely Jan. 12, 2024, 6:12 a.m. UTC
When multiconfigs are used, statistics for the same package name but
from the different multiconfigs is collected into the same file.

This causes incorrect charts generated with pybootchartgui, when
only the most recent part of statistics is shown.

This patch adds custom multiconfig prefix to the file names that
hold statistics.

Signed-off-by: Uladzimir Bely <ubely@ilbers.de>
---
 meta/classes/buildstats.bbclass | 2 ++
 1 file changed, 2 insertions(+)

Patch

diff --git a/meta/classes/buildstats.bbclass b/meta/classes/buildstats.bbclass
index 0de60520..b417929b 100644
--- a/meta/classes/buildstats.bbclass
+++ b/meta/classes/buildstats.bbclass
@@ -185,6 +185,8 @@  python run_buildstats () {
     if bn is not None:
         bsdir = os.path.join(d.getVar('BUILDSTATS_BASE'), bn)
         taskdir = os.path.join(bsdir, d.getVar('PF'))
+        if d.getVar('BB_CURRENT_MC') != 'default':
+            taskdir = os.path.join(bsdir, d.getVar('BB_CURRENT_MC') + '_' + d.getVar('PF'))
         if isinstance(e, bb.event.HeartbeatEvent) and bb.utils.to_boolean(d.getVar("BB_LOG_HOST_STAT_ON_INTERVAL")):
             bb.utils.mkdirhier(bsdir)
             write_host_data(os.path.join(bsdir, "host_stats_interval"), e, d, "interval")