summaryrefslogtreecommitdiff
path: root/bin/analyze-kconfig.py
diff options
context:
space:
mode:
authorBirte Kristina Friesel <birte.friesel@uos.de>2024-02-02 16:38:00 +0100
committerBirte Kristina Friesel <birte.friesel@uos.de>2024-02-02 16:38:00 +0100
commit9535cca7a916d0ffd180e569079ceaf2e8a8f47a (patch)
tree30245dcaf1e31c9b4569d34066518ee3b4b470cf /bin/analyze-kconfig.py
parent579a1fd9c3d2809cc1d5a017e7f1e681e014758b (diff)
analyze-log, analyze-kconfig: preliminary --load-json support
Diffstat (limited to 'bin/analyze-kconfig.py')
-rwxr-xr-xbin/analyze-kconfig.py38
1 files changed, 18 insertions, 20 deletions
diff --git a/bin/analyze-kconfig.py b/bin/analyze-kconfig.py
index f65751e..c369c05 100755
--- a/bin/analyze-kconfig.py
+++ b/bin/analyze-kconfig.py
@@ -325,14 +325,18 @@ def main():
max_std = None
ts = time.time()
- model = AnalyticModel(
- by_name,
- parameter_names,
- force_tree=args.force_tree,
- max_std=max_std,
- compute_stats=not args.skip_param_stats,
- function_override=function_override,
- )
+ if args.load_json:
+ with open(args.load_json, "r") as f:
+ model = AnalyticModel.from_json(json.load(f), by_name, parameter_names)
+ else:
+ model = AnalyticModel(
+ by_name,
+ parameter_names,
+ force_tree=args.force_tree,
+ max_std=max_std,
+ compute_stats=not args.skip_param_stats,
+ function_override=function_override,
+ )
timing["AnalyticModel"] = time.time() - ts
if not model.names:
@@ -444,22 +448,16 @@ def main():
static_quality = model.assess(static_model)
timing["assess static"] = time.time() - ts
- try:
- ts = time.time()
- lut_model = model.get_param_lut()
- timing["get lut"] = time.time() - ts
+ ts = time.time()
+ lut_model = model.get_param_lut()
+ timing["get lut"] = time.time() - ts
+ if lut_model is None:
+ lut_quality = None
+ else:
ts = time.time()
lut_quality = model.assess(lut_model)
timing["assess lut"] = time.time() - ts
- except RuntimeError as e:
- if args.force_tree:
- # this is to be expected
- logging.debug(f"Skipping LUT model: {e}")
- else:
- logging.warning(f"Skipping LUT model: {e}")
- lut_model = None
- lut_quality = None
if args.export_csv:
for name in model.names: