summaryrefslogtreecommitdiffstats
path: root/external/poky/scripts/lib/buildstats.py
diff options
context:
space:
mode:
Diffstat (limited to 'external/poky/scripts/lib/buildstats.py')
-rw-r--r--external/poky/scripts/lib/buildstats.py15
1 files changed, 6 insertions, 9 deletions
diff --git a/external/poky/scripts/lib/buildstats.py b/external/poky/scripts/lib/buildstats.py
index f7db3eaf..c69b5bf4 100644
--- a/external/poky/scripts/lib/buildstats.py
+++ b/external/poky/scripts/lib/buildstats.py
@@ -1,14 +1,7 @@
#
# Copyright (c) 2017, Intel Corporation.
#
-# This program is free software; you can redistribute it and/or modify it
-# under the terms and conditions of the GNU General Public License,
-# version 2, as published by the Free Software Foundation.
-#
-# This program is distributed in the hope it will be useful, but WITHOUT
-# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
-# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
-# more details.
+# SPDX-License-Identifier: GPL-2.0-only
#
"""Functionality for analyzing buildstats"""
import json
@@ -268,13 +261,17 @@ class BuildStats(dict):
self[pkg].aggregate(data)
-def diff_buildstats(bs1, bs2, stat_attr, min_val=None, min_absdiff=None):
+def diff_buildstats(bs1, bs2, stat_attr, min_val=None, min_absdiff=None, only_tasks=[]):
"""Compare the tasks of two buildstats"""
tasks_diff = []
pkgs = set(bs1.keys()).union(set(bs2.keys()))
for pkg in pkgs:
tasks1 = bs1[pkg].tasks if pkg in bs1 else {}
tasks2 = bs2[pkg].tasks if pkg in bs2 else {}
+ if only_tasks:
+ tasks1 = {k: v for k, v in tasks1.items() if k in only_tasks}
+ tasks2 = {k: v for k, v in tasks2.items() if k in only_tasks}
+
if not tasks1:
pkg_op = '+'
elif not tasks2: