From fd2078f959092791209fca9c8732fbed28e0f589 Mon Sep 17 00:00:00 2001 From: Daniel Friesel Date: Fri, 10 Jun 2022 15:30:38 +0200 Subject: move filter-param to cli --- bin/analyze-archive.py | 8 -------- bin/analyze-kconfig.py | 8 ++++++++ lib/cli.py | 8 ++++++++ 3 files changed, 16 insertions(+), 8 deletions(-) diff --git a/bin/analyze-archive.py b/bin/analyze-archive.py index 1766424..5996d08 100755 --- a/bin/analyze-archive.py +++ b/bin/analyze-archive.py @@ -444,14 +444,6 @@ if __name__ == "__main__": help="Export power traces of all states and transitions to DIRECTORY. " "Creates a JSON file for each state and transition.", ) - parser.add_argument( - "--filter-param", - metavar="=[,=...]", - type=str, - help="Only consider measurements where is . " - "All other measurements (including those where it is None, that is, has not been set yet) are discarded. " - "Note that this may remove entire function calls from the model.", - ) parser.add_argument( "--with-safe-functions", action="store_true", diff --git a/bin/analyze-kconfig.py b/bin/analyze-kconfig.py index c340901..0d7796a 100755 --- a/bin/analyze-kconfig.py +++ b/bin/analyze-kconfig.py @@ -181,6 +181,14 @@ def main(): # Release memory del observations + if args.filter_param: + args.filter_param = list( + map(lambda x: x.split("="), args.filter_param.split(",")) + ) + dfatool.utils.filter_aggregate_by_param( + by_name, parameter_names, args.filter_param + ) + if args.max_std: max_std = dict() if "=" in args.max_std: diff --git a/lib/cli.py b/lib/cli.py index 4c56e73..6b5b796 100644 --- a/lib/cli.py +++ b/lib/cli.py @@ -259,6 +259,14 @@ def add_standard_arguments(parser): type=str, help="Adjust parameter values before passing them to model generation", ) + parser.add_argument( + "--filter-param", + metavar="=[,=...]", + type=str, + help="Only consider measurements where is . " + "All other measurements (including those where it is None, that is, has not been set yet) are discarded. " + "Note that this may remove entire function calls from the model.", + ) def parse_param_shift(raw_param_shift): -- cgit v1.2.3