[pypy-commit] pypy vmprof-newstack: fixes

fijal pypy.commits at gmail.com
Sun Jan 10 14:32:13 EST 2016


Author: fijal
Branch: vmprof-newstack
Changeset: r81653:451e0179aa73
Date: 2016-01-10 21:31 +0200
http://bitbucket.org/pypy/pypy/changeset/451e0179aa73/

Log:	fixes

diff --git a/rpython/jit/backend/llsupport/test/zrpy_vmprof_test.py b/rpython/jit/backend/llsupport/test/zrpy_vmprof_test.py
--- a/rpython/jit/backend/llsupport/test/zrpy_vmprof_test.py
+++ b/rpython/jit/backend/llsupport/test/zrpy_vmprof_test.py
@@ -1,13 +1,20 @@
 
-import os
+import os, py
 from rpython.jit.backend.test.support import CCompiledMixin
 from rpython.rlib.jit import JitDriver
 from rpython.tool.udir import udir
+from rpython.translator.translator import TranslationContext
 from rpython.jit.backend.detect_cpu import getcpuclass
 
 class CompiledVmprofTest(CCompiledMixin):
     CPUClass = getcpuclass()
 
+    def _get_TranslationContext(self):
+        t = TranslationContext()
+        t.config.translation.gc = 'incminimark'
+        t.config.translation.list_comprehension_operations = True
+        return t
+
     def test_vmprof(self):
         from rpython.rlib import rvmprof
 
@@ -20,7 +27,8 @@
         except rvmprof.VMProfPlatformUnsupported, e:
             py.test.skip(str(e))
 
-        driver = JitDriver(greens = ['code'], reds = ['i', 's', 'num'])
+        driver = JitDriver(greens = ['code'], reds = ['i', 's', 'num'],
+            is_recursive=True)
 
         @rvmprof.vmprof_execute_code("xcode13", lambda code, num: code)
         def main(code, num):
@@ -55,6 +63,9 @@
             from vmprof import read_profile
             tmpfile = str(udir.join('test_rvmprof'))
             stats = read_profile(tmpfile)
+            t = stats.get_tree()
+            import pdb
+            pdb.set_trace()
 
         self.meta_interp(f, [100000000])
         try:
diff --git a/rpython/rlib/rvmprof/src/vmprof_get_custom_offset.h b/rpython/rlib/rvmprof/src/vmprof_get_custom_offset.h
--- a/rpython/rlib/rvmprof/src/vmprof_get_custom_offset.h
+++ b/rpython/rlib/rvmprof/src/vmprof_get_custom_offset.h
@@ -26,7 +26,7 @@
     result[n] = VMPROF_ASSEMBLER_TAG;
     result[n + 1] = start_addr;
     n += 2;
-    start = n + 2;
+    start = n;
     while (n < max_depth) {
         id = pypy_yield_codemap_at_addr(codemap, addr, &current_pos);
         if (id == -1)
diff --git a/rpython/rlib/rvmprof/src/vmprof_main.h b/rpython/rlib/rvmprof/src/vmprof_main.h
--- a/rpython/rlib/rvmprof/src/vmprof_main.h
+++ b/rpython/rlib/rvmprof/src/vmprof_main.h
@@ -155,7 +155,7 @@
         // the bottom part is jitted, means we can fill up the first part
         // from the JIT
         n = vmprof_write_header_for_jit_addr(result, n, pc, max_depth);
-        bottom_jitted = 1;
+        stack = stack->next; // skip the first item as it contains garbage
     }
     while (n < max_depth - 1 && stack) {
         result[n] = stack->kind;
diff --git a/rpython/rlib/rvmprof/src/vmprof_stack.h b/rpython/rlib/rvmprof/src/vmprof_stack.h
--- a/rpython/rlib/rvmprof/src/vmprof_stack.h
+++ b/rpython/rlib/rvmprof/src/vmprof_stack.h
@@ -1,3 +1,5 @@
+
+#include <unistd.h>
 
 #define VMPROF_CODE_TAG 1
 #define VMPROF_BLACKHOLE_TAG 2


More information about the pypy-commit mailing list