Anonymous avatar Anonymous committed b5f06ae

bugfixes in new mode

Comments (0)

Files changed (1)

     f.seek(0)
     ts = []
     while True:
-        s = f.read(9)
-        if len(s) < 9: break
-        t, s = struct.unpack_from('QB', s)
+        raw = f.read(9)
+        if len(raw) < 9: break
+        s = struct.unpack_from('B', raw)[0]
+        t = struct.unpack_from('Q', raw, 1)[0]
         ts.append((s, t))
-
     draw(dt, ts, outfile, False)
 
 def draw(total, ts, outfile, BAR3=True):
     if 0:
         a, b = 10*2.2e9, 12*2.2e9
         ts = [(s, t-a) for s, t in ts if a <= t <= b ]
-    total = ts[-1][1] - ts[0][1]
     total_ms = total / CPU_SPEED * 1000
 
     pp = 1.0 * total / (W*H)
 
     # Time lines
     i = 0
-    while i < len(timeslices_ms):
+    while True:
         divs = total_ms / timeslices_ms[i]
         if divs < 15: break
+        if i == len(timeslices_ms) - 1: break
         i += 1
+
     timeslice = timeslices_ms[i]
     t = timeslice
     c = (128, 128, 128)
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.