mirror of
https://github.com/projectacrn/acrn-hypervisor.git
synced 2025-06-25 06:51:49 +00:00
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 <kaige.fu@intel.com> Reviewed-by: Yan, Like <like.yan@intel.com> Reviewed-by: Geoffroy Van Cutsem <geoffroy.vancutsem@intel.com>
This commit is contained in:
parent
2aa0d4074f
commit
2bdd8112bd
@ -43,7 +43,8 @@ def do_analysis(ifile, ofile, analyzer):
|
|||||||
Raises:
|
Raises:
|
||||||
NA
|
NA
|
||||||
"""
|
"""
|
||||||
analyzer(ifile, ofile)
|
for alyer in analyzer:
|
||||||
|
alyer(ifile, ofile)
|
||||||
|
|
||||||
# pre process to make sure the trace data start and end with VMENTER
|
# pre process to make sure the trace data start and end with VMENTER
|
||||||
def pre_process(ifile, evstr):
|
def pre_process(ifile, evstr):
|
||||||
@ -75,6 +76,7 @@ def main(argv):
|
|||||||
outputfile = ''
|
outputfile = ''
|
||||||
opts_short = "hi:o:f:"
|
opts_short = "hi:o:f:"
|
||||||
opts_long = ["ifile=", "ofile=", "frequency=", "vm_exit"]
|
opts_long = ["ifile=", "ofile=", "frequency=", "vm_exit"]
|
||||||
|
analyzer = []
|
||||||
|
|
||||||
try:
|
try:
|
||||||
opts, args = getopt.getopt(argv, opts_short, opts_long)
|
opts, args = getopt.getopt(argv, opts_short, opts_long)
|
||||||
@ -93,7 +95,7 @@ def main(argv):
|
|||||||
elif opt in ("-f", "--frequency"):
|
elif opt in ("-f", "--frequency"):
|
||||||
TSC_FREQ = arg
|
TSC_FREQ = arg
|
||||||
elif opt == "--vm_exit":
|
elif opt == "--vm_exit":
|
||||||
analyzer = analyze_vm_exit
|
analyzer.append(analyze_vm_exit)
|
||||||
else:
|
else:
|
||||||
assert False, "unhandled option"
|
assert False, "unhandled option"
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user