diff options
author | Joshua Watt <jpewhacker@gmail.com> | 2019-07-15 10:47:33 -0500 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2019-07-17 09:36:29 +0100 |
commit | a8c7960d24c48107fd3703e49c38f890e84e2226 (patch) | |
tree | 56cbb8a3623d798ad1ded6c1b66b13adf6fa3da6 /scripts/lib/buildstats.py | |
parent | 1228dddfd11654e3b8830e1ef51f9ebeb152bd35 (diff) | |
download | openembedded-core-a8c7960d24c48107fd3703e49c38f890e84e2226.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.
Signed-off-by: Joshua Watt <JPEWhacker@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'scripts/lib/buildstats.py')
-rw-r--r-- | scripts/lib/buildstats.py | 6 |
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): 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: |