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:
Kaige Fu
2018-06-25 22:56:05 +08:00
committed by lijinxia
parent 0d9b163875
commit 2aa0d4074f
3 changed files with 18 additions and 27 deletions

View File

@@ -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: