]> git.ipfire.org Git - thirdparty/openembedded/openembedded-core-contrib.git/commitdiff
oe-build-perf-report: filter used measurements for each commit
authorMathieu Dubois-Briand <mathieu.dubois-briand@bootlin.com>
Wed, 22 Oct 2025 13:43:15 +0000 (15:43 +0200)
committerMathieu Dubois-Briand <mathieu.dubois-briand@bootlin.com>
Wed, 5 Nov 2025 12:05:41 +0000 (13:05 +0100)
As the poky repository is no longer used, measurements are indexed using
the oe-core commit. But as bitbake, oe-core and meta-yocto are now
retrieved from separate gits, while measuring performances for a given branch
at some time interval, we can get the same commit for oe-core but
different ones for bitbake or meta-yocto. As a consequence, metadata
associated with the same index (oe-core commit) might differ.

Today this is not supported, as we do expect all metadata for a given
version remain the same.

For each oe-core commit, filter the measurements, in order to only keep
the ones with the metadata matching the last measurement found for the
said commit.

Fixes [YOCTO #16014]

Signed-off-by: Mathieu Dubois-Briand <mathieu.dubois-briand@bootlin.com>
scripts/oe-build-perf-report

index a36f3c1bca349069cf3afc22a6b98efa93c47eab..2d51e84444baba38bc4ed5edb0a19bdc22e20ea8 100755 (executable)
@@ -133,12 +133,19 @@ def read_results(repo, tags, xml=True):
     if xml:
         git_objs = [tag + ':metadata.xml' for tag in tags] + [tag + ':results.xml' for tag in tags]
         data = parse_xml_stream(repo.run_cmd(['show'] + git_objs + ['--']))
-        return ([metadata_xml_to_json(e) for e in data[0:num_revs]],
-                [results_xml_to_json(e) for e in data[num_revs:]])
+        metadata, results = ([metadata_xml_to_json(e) for e in data[0:num_revs]],
+                             [results_xml_to_json(e) for e in data[num_revs:]])
     else:
         git_objs = [tag + ':metadata.json' for tag in tags] + [tag + ':results.json' for tag in tags]
         data = parse_json_stream(repo.run_cmd(['show'] + git_objs + ['--']))
-        return data[0:num_revs], data[num_revs:]
+        metadata, results = data[0:num_revs], data[num_revs:]
+
+    # Filter on results with version matching the last one
+    valid_bitbake = metadata[-1]['bitbake']['commit']
+    valid_meta_yocto = metadata[-1]['layers']['meta-poky']['commit']
+    return zip(*[(m, r) for m, r in zip(metadata, results)
+                 if m['bitbake']['commit'] == valid_bitbake
+                 and m['layers']['meta-poky']['commit'] == valid_meta_yocto])
 
 
 def get_data_item(data, key):