Skip to content

Commit abbba09

Browse files
committed
Fix the counters to sql script for Python 3
(cherry picked from commit 711e964)
1 parent aeb9a82 commit abbba09

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

utils/optimizer_counters_to_sql.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -92,13 +92,13 @@ def addStatsFromInput(inputFile, db):
9292
for line in inputFile:
9393
# Read next line
9494
# Split into segments
95-
segments = line.split(",")
95+
segments = line.split(", ")
9696
if len(segments) < 6 or not (segments[0] in [
9797
'module', 'function', 'function_history']):
9898
continue
9999
# Trim all values
100-
segments = map(str.strip, segments)
101-
if segments[0] == 'function_history':
100+
segments = list(map(str.strip, segments))
101+
if segments[0] == 'function_history' or segments[1] == 'lostvars':
102102
# Process history records
103103
delta = 0.0
104104
(kind, counter, stage, transform, passnum,
@@ -128,7 +128,7 @@ def processStatsFile(filename, dbname):
128128
filename,
129129
dbname))
130130
db = OptStatsDB(dbname)
131-
with open(filename, "rb") as inputFile:
131+
with open(filename, "r") as inputFile:
132132
addStatsFromInput(inputFile, db)
133133
db.finish()
134134

0 commit comments

Comments
 (0)