From 94865648210a69544b049acf54991eba35d92c18 Mon Sep 17 00:00:00 2001 From: Birte Kristina Friesel Date: Fri, 12 Jan 2024 15:28:17 +0100 Subject: add --filter-observations --- bin/analyze-archive.py | 6 ++++++ bin/analyze-kconfig.py | 6 ++++++ bin/analyze-log.py | 6 ++++++ 3 files changed, 18 insertions(+) (limited to 'bin') diff --git a/bin/analyze-archive.py b/bin/analyze-archive.py index 9414d1a..4641477 100755 --- a/bin/analyze-archive.py +++ b/bin/analyze-archive.py @@ -285,6 +285,11 @@ if __name__ == "__main__": else: args.filter_param = list() + if args.filter_observation: + args.filter_observation = list( + map(lambda x: tuple(x.split(":")), args.filter_observation.split(",")) + ) + if args.with_safe_functions is not None: safe_functions_enabled = True @@ -379,6 +384,7 @@ if __name__ == "__main__": dfatool.utils.ignore_param(by_name, parameters, args.ignore_param) dfatool.utils.filter_aggregate_by_param(by_name, parameters, args.filter_param) + dfatool.utils.filter_aggregate_by_observation(by_name, args.filter_observation) if args.param_shift: param_shift = dfatool.cli.parse_param_shift(args.param_shift) diff --git a/bin/analyze-kconfig.py b/bin/analyze-kconfig.py index bdfde8f..e17e383 100755 --- a/bin/analyze-kconfig.py +++ b/bin/analyze-kconfig.py @@ -305,6 +305,12 @@ def main(): by_name, parameter_names, args.filter_param ) + if args.filter_observation: + args.filter_observation = list( + map(lambda x: tuple(x.split(":")), args.filter_observation.split(",")) + ) + dfatool.utils.filter_aggregate_by_observation(by_name, args.filter_observation) + if args.max_std: max_std = dict() if "=" in args.max_std: diff --git a/bin/analyze-log.py b/bin/analyze-log.py index 65f3b44..e3ddef8 100755 --- a/bin/analyze-log.py +++ b/bin/analyze-log.py @@ -62,6 +62,11 @@ def main(): else: args.filter_param = list() + if args.filter_observation: + args.filter_observation = list( + map(lambda x: tuple(x.split(":")), args.filter_observation.split(",")) + ) + observations = reduce(lambda a, b: a + b, map(parse_logfile, args.logfiles)) by_name, parameter_names = dfatool.utils.observations_to_by_name(observations) del observations @@ -71,6 +76,7 @@ def main(): dfatool.utils.ignore_param(by_name, parameter_names, args.ignore_param) dfatool.utils.filter_aggregate_by_param(by_name, parameter_names, args.filter_param) + dfatool.utils.filter_aggregate_by_observation(by_name, args.filter_observation) if args.param_shift: param_shift = dfatool.cli.parse_param_shift(args.param_shift) -- cgit v1.2.3