From 2bdd8112bd0c3d2ab8852a4eeb04c26809fc1773 Mon Sep 17 00:00:00 2001 From: Kaige Fu Date: Mon, 25 Jun 2018 22:59:46 +0800 Subject: [PATCH] tools: acrntrace: Using array for saving all analyzer As we may analyze multi-cases at the same time. It's better to store all the analyzer in an array. Then we can traverse the array and exec all analyzer one by one. Signed-off-by: Kaige Fu Reviewed-by: Yan, Like Reviewed-by: Geoffroy Van Cutsem --- tools/acrntrace/scripts/acrnalyze.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/tools/acrntrace/scripts/acrnalyze.py b/tools/acrntrace/scripts/acrnalyze.py index 0d27860f0..e4b58aa57 100755 --- a/tools/acrntrace/scripts/acrnalyze.py +++ b/tools/acrntrace/scripts/acrnalyze.py @@ -43,7 +43,8 @@ def do_analysis(ifile, ofile, analyzer): Raises: NA """ - analyzer(ifile, ofile) + for alyer in analyzer: + alyer(ifile, ofile) # pre process to make sure the trace data start and end with VMENTER def pre_process(ifile, evstr): @@ -75,6 +76,7 @@ def main(argv): outputfile = '' opts_short = "hi:o:f:" opts_long = ["ifile=", "ofile=", "frequency=", "vm_exit"] + analyzer = [] try: opts, args = getopt.getopt(argv, opts_short, opts_long) @@ -93,7 +95,7 @@ def main(argv): elif opt in ("-f", "--frequency"): TSC_FREQ = arg elif opt == "--vm_exit": - analyzer = analyze_vm_exit + analyzer.append(analyze_vm_exit) else: assert False, "unhandled option"