Backed out changeset 955619c5ef35 (bug 1481672) for f8 linting failure on etlparser.py CLOSED TREE
authorBogdan Tara <btara@mozilla.com>
Wed, 08 Aug 2018 19:43:36 +0300
changeset 485799 5d1cd9ca908f2cc1b5c7a3bdcbd0db2bc11538dc
parent 485798 f893f5da2e6335ac1bc52ffa15a848cc9cb06027
child 485800 b90f817bbf5374f5ccb75ba1b4465669ed9e79eb
push id9719
push userffxbld-merge
push dateFri, 24 Aug 2018 17:49:46 +0000
treeherdermozilla-beta@719ec98fba77 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
bugs1481672
milestone63.0a1
backs out955619c5ef35574ffff8094beac9f25985e111c9
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Backed out changeset 955619c5ef35 (bug 1481672) for f8 linting failure on etlparser.py CLOSED TREE
testing/talos/talos/xtalos/etlparser.py
--- a/testing/talos/talos/xtalos/etlparser.py
+++ b/testing/talos/talos/xtalos/etlparser.py
@@ -20,17 +20,16 @@ EVENTNAME_INDEX = 0
 PROCESS_INDEX = 2
 THREAD_ID_INDEX = 3
 DISKBYTES_COL = "Size"
 FNAME_COL = "FileName"
 IMAGEFUNC_COL = "Image!Function"
 EVENTGUID_COL = "EventGuid"
 ACTIVITY_ID_COL = "etw:ActivityId"
 NUMBYTES_COL = "NumBytes"
-BYTESSENT_COL = "BytesSent"
 
 CEVT_WINDOWS_RESTORED = "{917b96b1-ecad-4dab-a760-8d49027748ae}"
 CEVT_XPCOM_SHUTDOWN = "{26d1e091-0ae7-4f49-a554-4214445c505c}"
 NAME_SUBSTITUTIONS = [
     # Careful with your regex!
     # Substitution happens after combinations like \t \s \n ... are replaced
     # with their real representations. So, prepend them with extra backslash.
     # Read more: https://docs.python.org/2.7/library/re.html#re.sub
@@ -90,26 +89,21 @@ def filterOutHeader(data):
             state = state + 1
 
         # The line after "EndHeader" is also not useful, so we want to strip
         # that in addition to the header.
         if state > 2:
             yield row
 
 
-def getIndex(eventName, *colNames):
-    eventHeader = gHeaders[eventName]
+def getIndex(eventType, colName):
+    if colName not in gHeaders[eventType]:
+        return None
+    return gHeaders[eventType].index(colName)
 
-    for colName in colNames:
-        try:
-            return eventHeader.index(colName)
-        except ValueError:
-            pass
-
-    return None
 
 def readFile(filename):
     print("etlparser: in readfile: %s" % filename)
     data = csv.reader(open(filename, 'rb'), delimiter=',', quotechar='"',
                       skipinitialspace=True)
     data = filterOutHeader(data)
     return data
 
@@ -228,19 +222,17 @@ def trackThreadNetIO(row, io, stage):
     if connID not in gConnectionIDs:
         gConnectionIDs[connID] = tid
     origThread = gConnectionIDs[connID]
     if origThread in gThreads:
         netEvt = re.match("[\w-]+\/([\w-]+)", event).group(1)
         if netEvt in net_events:
             opType = net_events[netEvt]
             th, stg = gThreads[origThread], stages[stage]
-            # On newer versions of Windows, some net I/O events have switched to
-            # using BYTESSENT_COL, so we try both
-            lenIdx = getIndex(event, NUMBYTES_COL, BYTESSENT_COL)
+            lenIdx = getIndex(event, NUMBYTES_COL)
             bytes = int(row[lenIdx])
             io[(th, stg, "net_%s_bytes" % opType)] = \
                 io.get((th, stg, "net_%s_bytes" % opType), 0) + bytes
             io[(th, stg, "net_io_bytes")] = \
                 io.get((th, stg, "net_io_bytes"), 0) + bytes
 
 
 def updateStage(row, stage):