[pypy-commit] pypy new-jit-log: forgot file (thx armin)

plan_rich pypy.commits at gmail.com
Mon May 9 06:44:06 EDT 2016


Author: Richard Plangger <planrichi at gmail.com>
Branch: new-jit-log
Changeset: r84335:f60619823f3b
Date: 2016-05-09 12:43 +0200
http://bitbucket.org/pypy/pypy/changeset/f60619823f3b/

Log:	forgot file (thx armin)

diff --git a/rpython/jit/metainterp/debug.py b/rpython/jit/metainterp/debug.py
new file mode 100644
--- /dev/null
+++ b/rpython/jit/metainterp/debug.py
@@ -0,0 +1,27 @@
+from rpython.rtyper.lltypesystem import rffi, lltype
+from rpython.rlib.jitlog import _log_jit_counter
+
+# YYY very minor leak -- we need the counters to stay alive
+# forever, just because we want to report them at the end
+# of the process
+
+LOOP_RUN_COUNTERS = []
+
+DEBUG_COUNTER = lltype.Struct('DEBUG_COUNTER',
+    # 'b'ridge, 'l'abel or # 'e'ntry point
+    ('i', lltype.Signed),      # first field, at offset 0
+    ('type', lltype.Char),
+    ('number', lltype.Signed)
+)
+
+def flush_debug_counters(cintf):
+    # this is always called, the jitlog knows if it is enabled
+    for i in range(len(LOOP_RUN_COUNTERS)):
+        struct = LOOP_RUN_COUNTERS[i]
+        _log_jit_counter(cintf, struct)
+        # reset the counter, flush in a later point in time will
+        # add up the counters!
+        struct.i = 0
+    # here would be the point to free some counters
+    # see YYY comment above! but first we should run this every once in a while
+    # not just when jitlog_disable is called


More information about the pypy-commit mailing list