mirror of
https://github.com/projectacrn/acrn-hypervisor.git
synced 2025-09-08 04:09:11 +00:00
tools: acrntrace: Make all python scripts python3 module
The trend is to focus on Python3 and deprecate Python2. This patch make all the acrntrace related scripts as Python3 module. - Add parentheses to all the print as Python3 required. - Remove suffix L and long() Python3 has deprecated. Python3 will treat all intergers as long. - Replace has_key() with "key in .keys()" because has_key() has been deprecated. - Other minor fixes. Signed-off-by: Kaige Fu <kaige.fu@intel.com> Reviewed-by: Geoffroy Van Cutsem <geoffroy.vancutsem@intel.com>
This commit is contained in:
@@ -9,8 +9,8 @@ import csv
|
||||
import struct
|
||||
from config import TSC_FREQ
|
||||
|
||||
TSC_BEGIN = 0L
|
||||
TSC_END = 0L
|
||||
TSC_BEGIN = 0
|
||||
TSC_END = 0
|
||||
|
||||
VMEXIT_ENTRY = 0x10000
|
||||
|
||||
@@ -44,13 +44,13 @@ def parse_trace(ifile):
|
||||
event = event & 0xffffffffffff
|
||||
|
||||
if TSC_BEGIN == 0:
|
||||
TSC_BEGIN = long(tsc)
|
||||
TSC_BEGIN = tsc
|
||||
|
||||
TSC_END = long(tsc)
|
||||
TSC_END = tsc
|
||||
|
||||
for key in LIST_EVENTS.keys():
|
||||
if event == LIST_EVENTS.get(key):
|
||||
if IRQ_EXITS.has_key(vec):
|
||||
if vec in IRQ_EXITS.keys():
|
||||
IRQ_EXITS[vec] += 1
|
||||
else:
|
||||
IRQ_EXITS[vec] = 1
|
||||
|
Reference in New Issue
Block a user