mirror of
https://github.com/projectacrn/acrn-hypervisor.git
synced 2026-06-08 18:14:53 +00:00
tools: acrntrace: Make TSC frequency configurable
Originally, acrntrace stores cpu frequency in output file and use it for time-based analysis. Actually, we should use TSC frequency instead of cpu frequency. This patch change to using TSC frequency for time-based analysis and introduce an option "-f --frequency" to let user configure TSC frequency. 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:
@@ -11,6 +11,7 @@ This is the main script of arnalyzer, which:
|
||||
import sys
|
||||
import getopt
|
||||
import os
|
||||
import config
|
||||
from vmexit_analyze import analyze_vm_exit
|
||||
|
||||
def usage():
|
||||
@@ -26,6 +27,7 @@ def usage():
|
||||
-h: print this message
|
||||
-i, --ifile=[string]: input file
|
||||
-o, --ofile=[string]: output file
|
||||
-f, --frequency=[unsigned int]: TSC frequency in MHz
|
||||
--vm_exit: to generate vm_exit report
|
||||
'''
|
||||
|
||||
@@ -71,8 +73,8 @@ def main(argv):
|
||||
"""
|
||||
inputfile = ''
|
||||
outputfile = ''
|
||||
opts_short = "hi:o:"
|
||||
opts_long = ["ifile=", "ofile=", "vm_exit"]
|
||||
opts_short = "hi:o:f:"
|
||||
opts_long = ["ifile=", "ofile=", "frequency=", "vm_exit"]
|
||||
|
||||
try:
|
||||
opts, args = getopt.getopt(argv, opts_short, opts_long)
|
||||
@@ -88,6 +90,8 @@ def main(argv):
|
||||
inputfile = arg
|
||||
elif opt in ("-o", "--ofile"):
|
||||
outputfile = arg
|
||||
elif opt in ("-f", "--frequency"):
|
||||
TSC_FREQ = arg
|
||||
elif opt == "--vm_exit":
|
||||
analyzer = analyze_vm_exit
|
||||
else:
|
||||
|
||||
Reference in New Issue
Block a user