Author: Richard Plangger <[email protected]>
Branch: vmprof-native
Changeset: r90087:40045929f6e3
Date: 2017-02-13 15:12 +0100
http://bitbucket.org/pypy/pypy/changeset/40045929f6e3/

Log:    set flag to identify a jit frame by libunwind's proc info

diff --git a/rpython/rlib/rvmprof/src/shared/vmp_dynamic.c 
b/rpython/rlib/rvmprof/src/shared/vmp_dynamic.c
--- a/rpython/rlib/rvmprof/src/shared/vmp_dynamic.c
+++ b/rpython/rlib/rvmprof/src/shared/vmp_dynamic.c
@@ -100,7 +100,9 @@
     unw_dyn_proc_info_t * ip = (unw_dyn_proc_info_t*)&(u->u);
     ip->name_ptr = (unw_word_t)name_cpy;
     ip->handler = 0;
-    ip->flags = 0;
+    // the docs say, we cannot use this field. but looking at libunwind, it 
just copies
+    // the value over when unw_get_proc_info is called. This should be fine to 
identify
+    ip->flags = DYN_JIT_FLAG;
     ip->regions = NULL;
 
     _U_dyn_register(u);
diff --git a/rpython/rlib/rvmprof/src/shared/vmp_dynamic.h 
b/rpython/rlib/rvmprof/src/shared/vmp_dynamic.h
--- a/rpython/rlib/rvmprof/src/shared/vmp_dynamic.h
+++ b/rpython/rlib/rvmprof/src/shared/vmp_dynamic.h
@@ -5,6 +5,8 @@
 
 #include "rvmprof.h"
 
+#define DYN_JIT_FLAG 0xbeefbeef
+
 RPY_EXTERN int vmp_dyn_register_jit_page(intptr_t addr, intptr_t end_addr,
                               const char * name);
 RPY_EXTERN int vmp_dyn_cancel(int ref);
diff --git a/rpython/rlib/rvmprof/src/shared/vmp_stack.c 
b/rpython/rlib/rvmprof/src/shared/vmp_stack.c
--- a/rpython/rlib/rvmprof/src/shared/vmp_stack.c
+++ b/rpython/rlib/rvmprof/src/shared/vmp_stack.c
@@ -253,7 +253,8 @@
             // this is possible because compiler align to 8 bytes.
             //
 #ifdef PYPY_JIT_CODEMAP
-            if (pip.format == UNW_INFO_FORMAT_DYNAMIC) {
+            // see vmp_dynamic.c on line ip->flags = DYN_JIT_FLAG
+            if (pip.flags == DYN_JIT_FLAG) {
                 if (top_most_frame->kind != VMPROF_JITTED_TAG) {
                     // if this is encountered frequently something is wrong 
with
                     // the stack building
_______________________________________________
pypy-commit mailing list
[email protected]
https://mail.python.org/mailman/listinfo/pypy-commit

Reply via email to