summaryrefslogtreecommitdiffstats
path: root/scripts/lib
diff options
context:
space:
mode:
authorJoshua Watt <jpewhacker@gmail.com>2019-07-15 10:47:33 -0500
committerRichard Purdie <richard.purdie@linuxfoundation.org>2019-07-17 09:36:35 +0100
commit067d475dbba8fd0b471a26cedc1e05309fe4e67c (patch)
treeac7da9dcb64e3283cc09e54b151f64f931ed23db /scripts/lib
parent97ca346de83a01f03405f394d25d85e3dc074887 (diff)
downloadpoky-067d475dbba8fd0b471a26cedc1e05309fe4e67c.tar.gz
scripts/buildstats-diff: Add option to filter tasks
Adds a command line option to filter out the buildstats-diff report by one more more tasks. e.g.: buildstats-diff --only-task do_compile A B will only show the differences for do_compile tasks. The --only-task option can be specified multiple times to filter out multiple tasks at once. (From OE-Core rev: a8c7960d24c48107fd3703e49c38f890e84e2226) Signed-off-by: Joshua Watt <JPEWhacker@gmail.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'scripts/lib')
-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: