Author: Richard Plangger <[email protected]>
Branch: 
Changeset: r90940:3bf2eb1a9009
Date: 2017-04-03 20:18 -0400
http://bitbucket.org/pypy/pypy/changeset/3bf2eb1a9009/

Log:    fix non x86 platforms (cond. call vmp_native_enable/disable)

diff --git a/rpython/rlib/rvmprof/src/shared/unwind/vmprof_unwind.h 
b/rpython/rlib/rvmprof/src/shared/unwind/vmprof_unwind.h
--- a/rpython/rlib/rvmprof/src/shared/unwind/vmprof_unwind.h
+++ b/rpython/rlib/rvmprof/src/shared/unwind/vmprof_unwind.h
@@ -15,11 +15,14 @@
 #define UNW_REG_IP 16
 typedef uint64_t unw_word_t;
 typedef int64_t unw_sword_t;
+#else
+// platform not supported
 #endif
 
 
 #define UNW_TDEP_CURSOR_LEN    127
 
+#ifdef VMP_SUPPORTS_NATIVE_PROFILING
 typedef struct unw_cursor
   {
     unw_word_t opaque[UNW_TDEP_CURSOR_LEN];
@@ -42,4 +45,4 @@
 
 // end of copy
 
-
+#endif
diff --git a/rpython/rlib/rvmprof/src/shared/vmprof.h 
b/rpython/rlib/rvmprof/src/shared/vmprof.h
--- a/rpython/rlib/rvmprof/src/shared/vmprof.h
+++ b/rpython/rlib/rvmprof/src/shared/vmprof.h
@@ -35,16 +35,18 @@
 #endif
 #endif
 
-#ifdef VMPROF_UNIX
-#define VMP_SUPPORTS_NATIVE_PROFILING
-#endif
-
 #ifdef __x86_64__
 #define X86_64
 #elif defined(__i386__)
 #define X86_32
 #endif
 
+#ifdef VMPROF_UNIX
+#if defined(X86_64) || defined(X86_32)
+#define VMP_SUPPORTS_NATIVE_PROFILING
+#endif
+#endif
+
 #ifdef RPYTHON_VMPROF
 // only for pypy
 #include "rvmprof.h"
diff --git a/rpython/rlib/rvmprof/src/shared/vmprof_common.h 
b/rpython/rlib/rvmprof/src/shared/vmprof_common.h
--- a/rpython/rlib/rvmprof/src/shared/vmprof_common.h
+++ b/rpython/rlib/rvmprof/src/shared/vmprof_common.h
@@ -190,12 +190,16 @@
     if (stack == NULL) {
         stack = get_vmprof_stack();
     }
+#ifdef VMP_SUPPORTS_NATIVE_PROFILING
     enabled = vmp_native_enabled();
     vmp_native_disable();
+#endif
     n = get_stack_trace(stack, result_p, result_length - 2, pc);
+#ifdef VMP_SUPPORTS_NATIVE_PROFILING
     if (enabled) {
         vmp_native_enable();
     }
+#endif
     return (intptr_t)n;
 }
 #endif
_______________________________________________
pypy-commit mailing list
[email protected]
https://mail.python.org/mailman/listinfo/pypy-commit

Reply via email to