[pypy-commit] pypy guard-compatible: cleanup and fix for passing non-code data to vtune

Raemi pypy.commits at gmail.com
Thu Mar 22 11:46:54 EDT 2018


Author: Remi Meier <remi.meier at gmail.com>
Branch: guard-compatible
Changeset: r94080:ad7291e0a4d3
Date: 2018-03-22 16:45 +0100
http://bitbucket.org/pypy/pypy/changeset/ad7291e0a4d3/

Log:	cleanup and fix for passing non-code data to vtune

diff --git a/rpython/jit/backend/x86/assembler.py b/rpython/jit/backend/x86/assembler.py
--- a/rpython/jit/backend/x86/assembler.py
+++ b/rpython/jit/backend/x86/assembler.py
@@ -569,7 +569,8 @@
                                            ops_offset=ops_offset)
 
         self.fixup_target_tokens(rawstart)
-        self.materialize_done(rawstart, full_size, "loop%d" % looptoken.number)
+        self.materialize_done(rawstart + functionpos, full_size - functionpos,
+                              "loop%d" % looptoken.number)
         self.teardown()
         # oprofile support
         if self.cpu.profile_agent is not None:
@@ -647,8 +648,9 @@
 
         self.fixup_target_tokens(rawstart)
         self.update_frame_depth(frame_depth)
-        self.materialize_done(rawstart, fullsize,
-                              "loop%d" % original_loop_token.number)
+        self.materialize_done(rawstart + startpos, fullsize - startpos,
+                              "bridge_%d_0x%x" % (original_loop_token.number,
+                                                  r_uint(descr_number)))
         self.teardown()
         # oprofile support
         if self.cpu.profile_agent is not None:
@@ -722,7 +724,7 @@
         # update the guard to jump right to this custom piece of assembler
         self.patch_jump_for_descr(faildescr, rawstart)
         self.materialize_done(rawstart, fullsize,
-                              "loop%d" % looptoken.number)
+                              "stiched_bridge%d" % looptoken.number)
 
     def _patch_jump_to(self, adr_jump_offset, adr_new_target):
         assert adr_jump_offset != 0
diff --git a/rpython/jit/backend/x86/vtune.py b/rpython/jit/backend/x86/vtune.py
--- a/rpython/jit/backend/x86/vtune.py
+++ b/rpython/jit/backend/x86/vtune.py
@@ -13,6 +13,7 @@
     libraries=["dl", "jitprofiling"],
     library_dirs=["/opt/intel/system_studio_2018/vtune_amplifier/lib64/"],
     separate_module_sources=[r"""
+#include "dlfcn.h"
 #include "/opt/intel/system_studio_2018/vtune_amplifier/include/jitprofiling.h"
 
 RPY_EXTERN void rpy_make_dlopen_strong(char *funcname, Signed addr, Signed size)
@@ -27,14 +28,10 @@
 {
     iJIT_Method_Load_V2 jmethod = {0};
 
-    fprintf(stderr, "call vtune register\n");
-
     if (iJIT_IsProfilingActive() != iJIT_SAMPLING_ON) {
         return;
     }
 
-    fprintf(stderr, "actually vtune register\n");
-
     jmethod.method_id = iJIT_GetNewMethodID();
     jmethod.method_name = funcname;
     jmethod.method_load_address = (void *)addr;


More information about the pypy-commit mailing list