summaryrefslogtreecommitdiffstats
path: root/scripts/lib/buildstats.py
diff options
context:
space:
mode:
Diffstat (limited to 'scripts/lib/buildstats.py')
-rw-r--r--scripts/lib/buildstats.py6
1 files changed, 5 insertions, 1 deletions
diff --git a/scripts/lib/buildstats.py b/scripts/lib/buildstats.py
index 1adab06edf..c69b5bf4d7 100644
--- a/scripts/lib/buildstats.py
+++ b/scripts/lib/buildstats.py
@@ -261,13 +261,17 @@ class BuildStats(dict):
261 self[pkg].aggregate(data) 261 self[pkg].aggregate(data)
262 262
263 263
264def diff_buildstats(bs1, bs2, stat_attr, min_val=None, min_absdiff=None): 264def diff_buildstats(bs1, bs2, stat_attr, min_val=None, min_absdiff=None, only_tasks=[]):
265 """Compare the tasks of two buildstats""" 265 """Compare the tasks of two buildstats"""
266 tasks_diff = [] 266 tasks_diff = []
267 pkgs = set(bs1.keys()).union(set(bs2.keys())) 267 pkgs = set(bs1.keys()).union(set(bs2.keys()))
268 for pkg in pkgs: 268 for pkg in pkgs:
269 tasks1 = bs1[pkg].tasks if pkg in bs1 else {} 269 tasks1 = bs1[pkg].tasks if pkg in bs1 else {}
270 tasks2 = bs2[pkg].tasks if pkg in bs2 else {} 270 tasks2 = bs2[pkg].tasks if pkg in bs2 else {}
271 if only_tasks:
272 tasks1 = {k: v for k, v in tasks1.items() if k in only_tasks}
273 tasks2 = {k: v for k, v in tasks2.items() if k in only_tasks}
274
271 if not tasks1: 275 if not tasks1:
272 pkg_op = '+' 276 pkg_op = '+'
273 elif not tasks2: 277 elif not tasks2: