Commits

Remi Meier  committed 535f5ae

stm: plot improvements

  • Participants
  • Parent commits 9f5d327
  • Branches stm-logging

Comments (0)

Files changed (2)

File pypy/tool/plot_log.py

     plot_logs(logs, ax)
     print "Drawn."
 
-    plt.xlabel("Runtime")
+    plt.xlabel("Runtime [s]")
     plt.ylabel("Thread")
     plt.yticks([r+0.5 for r in range(len(logs))],
                range(1, len(logs)+1))
 
+    left = min([l[0][0] for l in logs.values()])
+    right = max([l[-1][0] for l in logs.values()])
+    #left, right = ax.get_xlim()
+    ax.set_xlim((left, right))
+    xticks = ax.get_xticks()
+    ax.set_xticklabels(["%.2f" % ((t - left) * 1e-6,) for t in xticks])
+
     # legend-drawing
     from matplotlib.font_manager import FontProperties
     fontP = FontProperties()

File pypy/translator/stm/src_stm/et.c

   
   PYPY_DEBUG_START("stm-log");
 
-  READ_TIMESTAMP(time);
+  gettimeofday(&tv, NULL);
+  time = ((long long)tv.tv_sec) * 1000000LL + tv.tv_usec;
   _descriptor_string(_abort_buf2, ABORT_BUF_SIZE);
 
   format = "%s {\"time\":\"%llx\", \"reason\":\"%s\", \"error\":\"%s\", "