Commits

Anonymous committed f9f7ab9

show reason for jit flushes

Comments (0)

Files changed (2)

 
 event_start = 8;
 
+flush_reasons = [
+    'B',
+    'O',
+    'S',
+    'G'
+]
+
 # Must match C++ enum
 reasons = [
     'none',
     dot = W*H//80
 
     # Flush events. We need to save them and draw them after filling the main area
-    # because otherwise they will be overwritten. Format is (x, y) to plot flush at.
+    # because otherwise they will be overwritten. Format is (x, y, r) to plot flush at,
+    # where r is reason code.
     events = []
 
     ti = 0
             state, reason, time = ts[ti];
             # States past this limit are actually events rather than state transitions
             if state >= event_start:
-                events.append((x, y))
+                events.append((x, y, reason))
                 ti += 1
                 continue
 
             eps.append(ep)
             ep = 0
 
-    for x, y in events:
-        d.ellipse((x-10, y-10, x+10, y+10), fill=(255, 222, 222), outline=(160, 10, 10))
-        d.text((x, y), 'F', fill=BLACK, font=font)
+    for x, y, r in events:
+        d.ellipse((x-5, y-5, x+5, y+5), fill=(255, 222, 222), outline=(160, 10, 10))
+        ch = flush_reasons[r]
+        d.text((x-2, y-5), ch, fill=BLACK, font=font)
 
     print