diff options
Diffstat (limited to 'bin/analyze-archive.py')
-rwxr-xr-x | bin/analyze-archive.py | 24 |
1 files changed, 23 insertions, 1 deletions
diff --git a/bin/analyze-archive.py b/bin/analyze-archive.py index 5d4411b..fec5620 100755 --- a/bin/analyze-archive.py +++ b/bin/analyze-archive.py @@ -385,6 +385,12 @@ if __name__ == "__main__": type=str, help="Export JSON energy modle to FILE. Works out of the box for v1 and v2, requires --hwmodel for v0", ) + parser.add_argument( + "--with-substates", + metavar="PELT_CONFIG", + type=str, + help="Perform substate analysis", + ) parser.add_argument("measurement", nargs="+") args = parser.parse_args() @@ -431,7 +437,11 @@ if __name__ == "__main__": raw_data = RawData( args.measurement, - with_traces=(args.export_traces is not None or args.plot_traces is not None), + with_traces=( + args.export_traces is not None + or args.plot_traces is not None + or args.with_substates is not None + ), skip_cache=args.no_cache, ) @@ -480,6 +490,14 @@ if __name__ == "__main__": with open(target, "w") as f: json.dump(data, f) + if args.with_substates is not None: + arg_dict = dict() + if args.with_substates != "": + for kv in args.with_substates.split(","): + k, v = kv.split("=") + arg_dict[k] = v + args.with_substates = arg_dict + if args.plot_traces: plot_traces(preprocessed_data, args.plot_traces) @@ -503,6 +521,7 @@ if __name__ == "__main__": traces=preprocessed_data, function_override=function_override, pta=pta, + pelt=args.with_substates, ) if xv_method: @@ -625,6 +644,9 @@ if __name__ == "__main__": safe_functions_enabled=safe_functions_enabled ) + if args.with_substates is not None: + substate_model, substate_info = model.get_substates() + if "paramdetection" in show_models or "all" in show_models: for state in model.states_and_transitions(): for attribute in model.attributes(state): |