List:Commits« Previous MessageNext Message »
From:Marc Alff Date:May 4 2011 5:13am
Subject:bzr push into mysql-trunk-pfs-tuning branch (marc.alff:3367 to 3369)
View as plain text  
 3369 Marc Alff	2011-05-03
      Fixed the windows link (missing _PSI_hook)

    modified:
      mysys/psi_noop.cc
 3368 Marc Alff	2011-05-03
      PERFORMANCE SCHEMA optimization
      
      Preparing for static calls to the instrumentation, with PSI_CALL.

    modified:
      include/mysql/psi/mysql_file.h
      include/mysql/psi/mysql_stage.h
      include/mysql/psi/mysql_statement.h
      include/mysql/psi/mysql_table.h
      include/mysql/psi/mysql_thread.h
      include/mysql/psi/psi.h
      storage/innobase/include/os0file.h
      storage/innobase/include/os0sync.ic
      storage/innobase/include/srv0srv.h
      storage/innobase/include/sync0rw.ic
      storage/innobase/include/sync0sync.ic
 3367 Marc Alff	2011-05-03
      Fixed windows build break

    modified:
      mysys/psi_noop.cc
=== modified file 'include/mysql/psi/mysql_file.h'
--- a/include/mysql/psi/mysql_file.h	2011-05-04 03:17:46 +0000
+++ b/include/mysql/psi/mysql_file.h	2011-05-04 05:02:43 +0000
@@ -518,7 +518,7 @@ static inline void inline_mysql_file_reg
 )
 {
 #ifdef HAVE_PSI_FILE_INTERFACE
-  PSI_server->register_file(category, info, count);
+  PSI_CALL(register_file)(category, info, count);
 #endif
 }
 
@@ -533,13 +533,13 @@ inline_mysql_file_fgets(
 #ifdef HAVE_PSI_FILE_INTERFACE
   struct PSI_file_locker *locker;
   PSI_file_locker_state state;
-  locker= PSI_server->get_thread_file_stream_locker(&state, file->m_psi,
-                                                    PSI_FILE_READ);
+  locker= PSI_CALL(get_thread_file_stream_locker)(&state, file->m_psi,
+                                                  PSI_FILE_READ);
   if (likely(locker != NULL))
   {
-    PSI_server->start_file_wait(locker, (size_t) size, src_file, src_line);
+    PSI_CALL(start_file_wait)(locker, (size_t) size, src_file, src_line);
     result= fgets(str, size, file->m_file);
-    PSI_server->end_file_wait(locker, result ? strlen(result) : 0);
+    PSI_CALL(end_file_wait)(locker, result ? strlen(result) : 0);
     return result;
   }
 #endif
@@ -559,13 +559,13 @@ inline_mysql_file_fgetc(
 #ifdef HAVE_PSI_FILE_INTERFACE
   struct PSI_file_locker *locker;
   PSI_file_locker_state state;
-  locker= PSI_server->get_thread_file_stream_locker(&state, file->m_psi,
-                                                    PSI_FILE_READ);
+  locker= PSI_CALL(get_thread_file_stream_locker)(&state, file->m_psi,
+                                                  PSI_FILE_READ);
   if (likely(locker != NULL))
   {
-    PSI_server->start_file_wait(locker, (size_t) 1, src_file, src_line);
+    PSI_CALL(start_file_wait)(locker, (size_t) 1, src_file, src_line);
     result= fgetc(file->m_file);
-    PSI_server->end_file_wait(locker, (size_t) 1);
+    PSI_CALL(end_file_wait)(locker, (size_t) 1);
     return result;
   }
 #endif
@@ -586,14 +586,14 @@ inline_mysql_file_fputs(
   struct PSI_file_locker *locker= NULL;
   PSI_file_locker_state state;
   size_t bytes;
-  locker= PSI_server->get_thread_file_stream_locker(&state, file->m_psi,
-                                                    PSI_FILE_WRITE);
+  locker= PSI_CALL(get_thread_file_stream_locker)(&state, file->m_psi,
+                                                  PSI_FILE_WRITE);
   if (likely(locker != NULL))
   {
     bytes= str ? strlen(str) : 0;
-    PSI_server->start_file_wait(locker, bytes, src_file, src_line);
+    PSI_CALL(start_file_wait)(locker, bytes, src_file, src_line);
     result= fputs(str, file->m_file);
-    PSI_server->end_file_wait(locker, bytes);
+    PSI_CALL(end_file_wait)(locker, bytes);
     return result;
   }
 #endif
@@ -613,13 +613,13 @@ inline_mysql_file_fputc(
 #ifdef HAVE_PSI_FILE_INTERFACE
   struct PSI_file_locker *locker;
   PSI_file_locker_state state;
-  locker= PSI_server->get_thread_file_stream_locker(&state, file->m_psi,
-                                                    PSI_FILE_WRITE);
+  locker= PSI_CALL(get_thread_file_stream_locker)(&state, file->m_psi,
+                                                  PSI_FILE_WRITE);
   if (likely(locker != NULL))
   {
-    PSI_server->start_file_wait(locker, (size_t) 1, src_file, src_line);
+    PSI_CALL(start_file_wait)(locker, (size_t) 1, src_file, src_line);
     result= fputc(c, file->m_file);
-    PSI_server->end_file_wait(locker, (size_t) 1);
+    PSI_CALL(end_file_wait)(locker, (size_t) 1);
     return result;
   }
 #endif
@@ -639,15 +639,15 @@ inline_mysql_file_fprintf(MYSQL_FILE *fi
 #ifdef HAVE_PSI_FILE_INTERFACE
   struct PSI_file_locker *locker;
   PSI_file_locker_state state;
-  locker= PSI_server->get_thread_file_stream_locker(&state, file->m_psi,
-                                                    PSI_FILE_WRITE);
+  locker= PSI_CALL(get_thread_file_stream_locker)(&state, file->m_psi,
+                                                  PSI_FILE_WRITE);
   if (likely(locker != NULL))
   {
-    PSI_server->start_file_wait(locker, (size_t) 0, __FILE__, __LINE__);
+    PSI_CALL(start_file_wait)(locker, (size_t) 0, __FILE__, __LINE__);
     va_start(args, format);
     result= vfprintf(file->m_file, format, args);
     va_end(args);
-    PSI_server->end_file_wait(locker, (size_t) result);
+    PSI_CALL(end_file_wait)(locker, (size_t) result);
     return result;
   }
 #endif
@@ -669,13 +669,13 @@ inline_mysql_file_vfprintf(
 #ifdef HAVE_PSI_FILE_INTERFACE
   struct PSI_file_locker *locker;
   PSI_file_locker_state state;
-  locker= PSI_server->get_thread_file_stream_locker(&state, file->m_psi,
-                                                    PSI_FILE_WRITE);
+  locker= PSI_CALL(get_thread_file_stream_locker)(&state, file->m_psi,
+                                                  PSI_FILE_WRITE);
   if (likely(locker != NULL))
   {
-    PSI_server->start_file_wait(locker, (size_t) 0, src_file, src_line);
+    PSI_CALL(start_file_wait)(locker, (size_t) 0, src_file, src_line);
     result= vfprintf(file->m_file, format, args);
-    PSI_server->end_file_wait(locker, (size_t) result);
+    PSI_CALL(end_file_wait)(locker, (size_t) result);
     return result;
   }
 #endif
@@ -695,13 +695,13 @@ inline_mysql_file_fflush(
 #ifdef HAVE_PSI_FILE_INTERFACE
   struct PSI_file_locker *locker;
   PSI_file_locker_state state;
-  locker= PSI_server->get_thread_file_stream_locker(&state, file->m_psi,
-                                                    PSI_FILE_FLUSH);
+  locker= PSI_CALL(get_thread_file_stream_locker)(&state, file->m_psi,
+                                                  PSI_FILE_FLUSH);
   if (likely(locker != NULL))
   {
-    PSI_server->start_file_wait(locker, (size_t) 0, src_file, src_line);
+    PSI_CALL(start_file_wait)(locker, (size_t) 0, src_file, src_line);
     result= fflush(file->m_file);
-    PSI_server->end_file_wait(locker, (size_t) 0);
+    PSI_CALL(end_file_wait)(locker, (size_t) 0);
     return result;
   }
 #endif
@@ -725,18 +725,20 @@ inline_mysql_file_fstat(
 {
   int result;
 #ifdef HAVE_PSI_FILE_INTERFACE
-  struct PSI_file_locker *locker= NULL;
+  struct PSI_file_locker *locker;
   PSI_file_locker_state state;
-  locker= PSI_server->get_thread_file_descriptor_locker(&state, filenr,
-                                                        PSI_FILE_FSTAT);
+  locker= PSI_CALL(get_thread_file_descriptor_locker)(&state, filenr,
+                                                      PSI_FILE_FSTAT);
   if (likely(locker != NULL))
-    PSI_server->start_file_wait(locker, (size_t) 0, src_file, src_line);
+  {
+    PSI_CALL(start_file_wait)(locker, (size_t) 0, src_file, src_line);
+    result= my_fstat(filenr, stat_area, flags);
+    PSI_CALL(end_file_wait)(locker, (size_t) 0);
+    return result;
+  }
 #endif
+
   result= my_fstat(filenr, stat_area, flags);
-#ifdef HAVE_PSI_FILE_INTERFACE
-  if (likely(locker != NULL))
-    PSI_server->end_file_wait(locker, (size_t) 0);
-#endif
   return result;
 }
 
@@ -749,19 +751,21 @@ inline_mysql_file_stat(
 {
   MY_STAT *result;
 #ifdef HAVE_PSI_FILE_INTERFACE
-  struct PSI_file_locker *locker= NULL;
+  struct PSI_file_locker *locker;
   PSI_file_locker_state state;
-  locker= PSI_server->get_thread_file_name_locker(&state,
-                                                  key, PSI_FILE_STAT,
-                                                  path, &locker);
+  locker= PSI_CALL(get_thread_file_name_locker)(&state,
+                                                key, PSI_FILE_STAT,
+                                                path, &locker);
   if (likely(locker != NULL))
-    PSI_server->start_file_open_wait(locker, src_file, src_line);
+  {
+    PSI_CALL(start_file_open_wait)(locker, src_file, src_line);
+    result= my_stat(path, stat_area, flags);
+    PSI_CALL(end_file_wait)(locker, (size_t) 0);
+    return result;
+  }
 #endif
+
   result= my_stat(path, stat_area, flags);
-#ifdef HAVE_PSI_FILE_INTERFACE
-  if (likely(locker != NULL))
-    PSI_server->end_file_wait(locker, (size_t) 0);
-#endif
   return result;
 }
 
@@ -774,19 +778,21 @@ inline_mysql_file_chsize(
 {
   int result;
 #ifdef HAVE_PSI_FILE_INTERFACE
-  struct PSI_file_locker *locker= NULL;
+  struct PSI_file_locker *locker;
   PSI_file_locker_state state;
-  locker= PSI_server->get_thread_file_descriptor_locker(&state, file,
-                                                        PSI_FILE_CHSIZE);
+  locker= PSI_CALL(get_thread_file_descriptor_locker)(&state, file,
+                                                      PSI_FILE_CHSIZE);
   if (likely(locker != NULL))
-    PSI_server->start_file_wait(locker, (size_t) newlength, src_file,
-                                src_line);
+  {
+    PSI_CALL(start_file_wait)(locker, (size_t) newlength, src_file,
+                              src_line);
+    result= my_chsize(file, newlength, filler, flags);
+    PSI_CALL(end_file_wait)(locker, (size_t) newlength);
+    return result;
+  }
 #endif
+
   result= my_chsize(file, newlength, filler, flags);
-#ifdef HAVE_PSI_FILE_INTERFACE
-  if (likely(locker != NULL))
-    PSI_server->end_file_wait(locker, (size_t) newlength);
-#endif
   return result;
 }
 
@@ -802,16 +808,16 @@ inline_mysql_file_fopen(
   if (likely(that != NULL))
   {
 #ifdef HAVE_PSI_FILE_INTERFACE
-    struct PSI_file_locker *locker= NULL;
+    struct PSI_file_locker *locker;
     PSI_file_locker_state state;
-    locker= PSI_server->get_thread_file_name_locker
+    locker= PSI_CALL(get_thread_file_name_locker)
       (&state, key, PSI_FILE_STREAM_OPEN, filename, that);
     if (likely(locker != NULL))
     {
-      that->m_psi= PSI_server->start_file_open_wait(locker, src_file,
-                                                    src_line);
+      that->m_psi= PSI_CALL(start_file_open_wait)(locker, src_file,
+                                                  src_line);
       that->m_file= my_fopen(filename, flags, myFlags);
-      PSI_server->end_file_open_wait(locker);
+      PSI_CALL(end_file_open_wait)(locker);
 
       if (unlikely(that->m_file == NULL))
       {
@@ -846,13 +852,13 @@ inline_mysql_file_fclose(
 #ifdef HAVE_PSI_FILE_INTERFACE
     struct PSI_file_locker *locker;
     PSI_file_locker_state state;
-    locker= PSI_server->get_thread_file_stream_locker(&state, file->m_psi,
-                                                      PSI_FILE_STREAM_CLOSE);
+    locker= PSI_CALL(get_thread_file_stream_locker)(&state, file->m_psi,
+                                                    PSI_FILE_STREAM_CLOSE);
     if (likely(locker != NULL))
     {
-      PSI_server->start_file_wait(locker, (size_t) 0, src_file, src_line);
+      PSI_CALL(start_file_wait)(locker, (size_t) 0, src_file, src_line);
       result= my_fclose(file->m_file, flags);
-      PSI_server->end_file_wait(locker, (size_t) 0);
+      PSI_CALL(end_file_wait)(locker, (size_t) 0);
       my_free(file);
       return result;
     }
@@ -876,17 +882,17 @@ inline_mysql_file_fread(
   struct PSI_file_locker *locker;
   PSI_file_locker_state state;
   size_t bytes_read;
-  locker= PSI_server->get_thread_file_stream_locker(&state, file->m_psi,
-                                                    PSI_FILE_READ);
+  locker= PSI_CALL(get_thread_file_stream_locker)(&state, file->m_psi,
+                                                  PSI_FILE_READ);
   if (likely(locker != NULL))
   {
-    PSI_server->start_file_wait(locker, count, src_file, src_line);
+    PSI_CALL(start_file_wait)(locker, count, src_file, src_line);
     result= my_fread(file->m_file, buffer, count, flags);
     if (flags & (MY_NABP | MY_FNABP))
       bytes_read= (result == 0) ? count : 0;
     else
       bytes_read= (result != MY_FILE_ERROR) ? result : 0;
-    PSI_server->end_file_wait(locker, bytes_read);
+    PSI_CALL(end_file_wait)(locker, bytes_read);
     return result;
   }
 #endif
@@ -907,17 +913,17 @@ inline_mysql_file_fwrite(
   struct PSI_file_locker *locker;
   PSI_file_locker_state state;
   size_t bytes_written;
-  locker= PSI_server->get_thread_file_stream_locker(&state, file->m_psi,
-                                                    PSI_FILE_WRITE);
+  locker= PSI_CALL(get_thread_file_stream_locker)(&state, file->m_psi,
+                                                  PSI_FILE_WRITE);
   if (likely(locker != NULL))
   {
-    PSI_server->start_file_wait(locker, count, src_file, src_line);
+    PSI_CALL(start_file_wait)(locker, count, src_file, src_line);
     result= my_fwrite(file->m_file, buffer, count, flags);
     if (flags & (MY_NABP | MY_FNABP))
       bytes_written= (result == 0) ? count : 0;
     else
       bytes_written= (result != MY_FILE_ERROR) ? result : 0;
-    PSI_server->end_file_wait(locker, bytes_written);
+    PSI_CALL(end_file_wait)(locker, bytes_written);
     return result;
   }
 #endif
@@ -937,13 +943,13 @@ inline_mysql_file_fseek(
 #ifdef HAVE_PSI_FILE_INTERFACE
   struct PSI_file_locker *locker;
   PSI_file_locker_state state;
-  locker= PSI_server->get_thread_file_stream_locker(&state, file->m_psi,
-                                                    PSI_FILE_SEEK);
+  locker= PSI_CALL(get_thread_file_stream_locker)(&state, file->m_psi,
+                                                  PSI_FILE_SEEK);
   if (likely(locker != NULL))
   {
-    PSI_server->start_file_wait(locker, (size_t) 0, src_file, src_line);
+    PSI_CALL(start_file_wait)(locker, (size_t) 0, src_file, src_line);
     result= my_fseek(file->m_file, pos, whence, flags);
-    PSI_server->end_file_wait(locker, (size_t) 0);
+    PSI_CALL(end_file_wait)(locker, (size_t) 0);
     return result;
   }
 #endif
@@ -963,13 +969,13 @@ inline_mysql_file_ftell(
 #ifdef HAVE_PSI_FILE_INTERFACE
   struct PSI_file_locker *locker;
   PSI_file_locker_state state;
-  locker= PSI_server->get_thread_file_stream_locker(&state, file->m_psi,
-                                                    PSI_FILE_TELL);
+  locker= PSI_CALL(get_thread_file_stream_locker)(&state, file->m_psi,
+                                                  PSI_FILE_TELL);
   if (likely(locker != NULL))
   {
-    PSI_server->start_file_wait(locker, (size_t) 0, src_file, src_line);
+    PSI_CALL(start_file_wait)(locker, (size_t) 0, src_file, src_line);
     result= my_ftell(file->m_file, flags);
-    PSI_server->end_file_wait(locker, (size_t) 0);
+    PSI_CALL(end_file_wait)(locker, (size_t) 0);
     return result;
   }
 #endif
@@ -987,18 +993,20 @@ inline_mysql_file_create(
 {
   File file;
 #ifdef HAVE_PSI_FILE_INTERFACE
-  struct PSI_file_locker *locker= NULL;
+  struct PSI_file_locker *locker;
   PSI_file_locker_state state;
-  locker= PSI_server->get_thread_file_name_locker(&state, key, PSI_FILE_CREATE,
-                                                  filename, &locker);
+  locker= PSI_CALL(get_thread_file_name_locker)(&state, key, PSI_FILE_CREATE,
+                                                filename, &locker);
   if (likely(locker != NULL))
-    PSI_server->start_file_open_wait(locker, src_file, src_line);
+  {
+    PSI_CALL(start_file_open_wait)(locker, src_file, src_line);
+    file= my_create(filename, create_flags, access_flags, myFlags);
+    PSI_CALL(end_file_open_wait_and_bind_to_descriptor)(locker, file);
+    return file;
+  }
 #endif
+
   file= my_create(filename, create_flags, access_flags, myFlags);
-#ifdef HAVE_PSI_FILE_INTERFACE
-  if (likely(locker != NULL))
-    PSI_server->end_file_open_wait_and_bind_to_descriptor(locker, file);
-#endif
   return file;
 }
 
@@ -1017,7 +1025,7 @@ inline_mysql_file_create_temp(
   */
   file= create_temp_file(to, dir, pfx, mode, myFlags);
 #ifdef HAVE_PSI_FILE_INTERFACE
-  PSI_server->create_file(key, to, file);
+  PSI_CALL(create_file)(key, to, file);
 #endif
   return file;
 }
@@ -1031,18 +1039,20 @@ inline_mysql_file_open(
 {
   File file;
 #ifdef HAVE_PSI_FILE_INTERFACE
-  struct PSI_file_locker *locker= NULL;
+  struct PSI_file_locker *locker;
   PSI_file_locker_state state;
-  locker= PSI_server->get_thread_file_name_locker(&state, key, PSI_FILE_OPEN,
-                                                  filename, &locker);
+  locker= PSI_CALL(get_thread_file_name_locker)(&state, key, PSI_FILE_OPEN,
+                                                filename, &locker);
   if (likely(locker != NULL))
-    PSI_server->start_file_open_wait(locker, src_file, src_line);
+  {
+    PSI_CALL(start_file_open_wait)(locker, src_file, src_line);
+    file= my_open(filename, flags, myFlags);
+    PSI_CALL(end_file_open_wait_and_bind_to_descriptor)(locker, file);
+    return file;
+  }
 #endif
+
   file= my_open(filename, flags, myFlags);
-#ifdef HAVE_PSI_FILE_INTERFACE
-  if (likely(locker != NULL))
-    PSI_server->end_file_open_wait_and_bind_to_descriptor(locker, file);
-#endif
   return file;
 }
 
@@ -1055,18 +1065,20 @@ inline_mysql_file_close(
 {
   int result;
 #ifdef HAVE_PSI_FILE_INTERFACE
-  struct PSI_file_locker *locker= NULL;
+  struct PSI_file_locker *locker;
   PSI_file_locker_state state;
-  locker= PSI_server->get_thread_file_descriptor_locker(&state, file,
-                                                        PSI_FILE_CLOSE);
+  locker= PSI_CALL(get_thread_file_descriptor_locker)(&state, file,
+                                                      PSI_FILE_CLOSE);
   if (likely(locker != NULL))
-    PSI_server->start_file_wait(locker, (size_t) 0, src_file, src_line);
+  {
+    PSI_CALL(start_file_wait)(locker, (size_t) 0, src_file, src_line);
+    result= my_close(file, flags);
+    PSI_CALL(end_file_wait)(locker, (size_t) 0);
+    return result;
+  }
 #endif
+
   result= my_close(file, flags);
-#ifdef HAVE_PSI_FILE_INTERFACE
-  if (likely(locker != NULL))
-    PSI_server->end_file_wait(locker, (size_t) 0);
-#endif
   return result;
 }
 
@@ -1077,27 +1089,27 @@ inline_mysql_file_read(
 #endif
   File file, uchar *buffer, size_t count, myf flags)
 {
-  size_t result= 0;
+  size_t result;
 #ifdef HAVE_PSI_FILE_INTERFACE
-  struct PSI_file_locker *locker= NULL;
+  struct PSI_file_locker *locker;
   PSI_file_locker_state state;
-  locker= PSI_server->get_thread_file_descriptor_locker(&state, file,
-                                                        PSI_FILE_READ);
-  if (likely(locker != NULL))
-    PSI_server->start_file_wait(locker, count, src_file, src_line);
-#endif
-  result= my_read(file, buffer, count, flags);
-#ifdef HAVE_PSI_FILE_INTERFACE
+  size_t bytes_read;
+  locker= PSI_CALL(get_thread_file_descriptor_locker)(&state, file,
+                                                      PSI_FILE_READ);
   if (likely(locker != NULL))
   {
-    size_t bytes_read;
+    PSI_CALL(start_file_wait)(locker, count, src_file, src_line);
+    result= my_read(file, buffer, count, flags);
     if (flags & (MY_NABP | MY_FNABP))
       bytes_read= (result == 0) ? count : 0;
     else
       bytes_read= (result != MY_FILE_ERROR) ? result : 0;
-    PSI_server->end_file_wait(locker, bytes_read);
+    PSI_CALL(end_file_wait)(locker, bytes_read);
+    return result;
   }
 #endif
+
+  result= my_read(file, buffer, count, flags);
   return result;
 }
 
@@ -1110,25 +1122,25 @@ inline_mysql_file_write(
 {
   size_t result;
 #ifdef HAVE_PSI_FILE_INTERFACE
-  struct PSI_file_locker *locker= NULL;
+  struct PSI_file_locker *locker;
   PSI_file_locker_state state;
-  locker= PSI_server->get_thread_file_descriptor_locker(&state, file,
-                                                        PSI_FILE_WRITE);
-  if (likely(locker != NULL))
-    PSI_server->start_file_wait(locker, count, src_file, src_line);
-#endif
-  result= my_write(file, buffer, count, flags);
-#ifdef HAVE_PSI_FILE_INTERFACE
+  size_t bytes_written;
+  locker= PSI_CALL(get_thread_file_descriptor_locker)(&state, file,
+                                                      PSI_FILE_WRITE);
   if (likely(locker != NULL))
   {
-    size_t bytes_written;
+    PSI_CALL(start_file_wait)(locker, count, src_file, src_line);
+    result= my_write(file, buffer, count, flags);
     if (flags & (MY_NABP | MY_FNABP))
       bytes_written= (result == 0) ? count : 0;
     else
       bytes_written= (result != MY_FILE_ERROR) ? result : 0;
-    PSI_server->end_file_wait(locker, bytes_written);
+    PSI_CALL(end_file_wait)(locker, bytes_written);
+    return result;
   }
 #endif
+
+  result= my_write(file, buffer, count, flags);
   return result;
 }
 
@@ -1141,24 +1153,24 @@ inline_mysql_file_pread(
 {
   size_t result;
 #ifdef HAVE_PSI_FILE_INTERFACE
-  struct PSI_file_locker *locker= NULL;
+  struct PSI_file_locker *locker;
   PSI_file_locker_state state;
-  locker= PSI_server->get_thread_file_descriptor_locker(&state, file, PSI_FILE_READ);
-  if (likely(locker != NULL))
-    PSI_server->start_file_wait(locker, count, src_file, src_line);
-#endif
-  result= my_pread(file, buffer, count, offset, flags);
-#ifdef HAVE_PSI_FILE_INTERFACE
+  size_t bytes_read;
+  locker= PSI_CALL(get_thread_file_descriptor_locker)(&state, file, PSI_FILE_READ);
   if (likely(locker != NULL))
   {
-    size_t bytes_read;
+    PSI_CALL(start_file_wait)(locker, count, src_file, src_line);
+    result= my_pread(file, buffer, count, offset, flags);
     if (flags & (MY_NABP | MY_FNABP))
       bytes_read= (result == 0) ? count : 0;
     else
       bytes_read= (result != MY_FILE_ERROR) ? result : 0;
-    PSI_server->end_file_wait(locker, bytes_read);
+    PSI_CALL(end_file_wait)(locker, bytes_read);
+    return result;
   }
 #endif
+
+  result= my_pread(file, buffer, count, offset, flags);
   return result;
 }
 
@@ -1171,25 +1183,25 @@ inline_mysql_file_pwrite(
 {
   size_t result;
 #ifdef HAVE_PSI_FILE_INTERFACE
-  struct PSI_file_locker *locker= NULL;
+  struct PSI_file_locker *locker;
   PSI_file_locker_state state;
-  locker= PSI_server->get_thread_file_descriptor_locker(&state, file,
-                                                        PSI_FILE_WRITE);
-  if (likely(locker != NULL))
-    PSI_server->start_file_wait(locker, count, src_file, src_line);
-#endif
-  result= my_pwrite(file, buffer, count, offset, flags);
-#ifdef HAVE_PSI_FILE_INTERFACE
+  size_t bytes_written;
+  locker= PSI_CALL(get_thread_file_descriptor_locker)(&state, file,
+                                                      PSI_FILE_WRITE);
   if (likely(locker != NULL))
   {
-    size_t bytes_written;
+    PSI_CALL(start_file_wait)(locker, count, src_file, src_line);
+    result= my_pwrite(file, buffer, count, offset, flags);
     if (flags & (MY_NABP | MY_FNABP))
       bytes_written= (result == 0) ? count : 0;
     else
       bytes_written= (result != MY_FILE_ERROR) ? result : 0;
-    PSI_server->end_file_wait(locker, bytes_written);
+    PSI_CALL(end_file_wait)(locker, bytes_written);
+    return result;
   }
 #endif
+
+  result= my_pwrite(file, buffer, count, offset, flags);
   return result;
 }
 
@@ -1202,17 +1214,19 @@ inline_mysql_file_seek(
 {
   my_off_t result;
 #ifdef HAVE_PSI_FILE_INTERFACE
-  struct PSI_file_locker *locker= NULL;
+  struct PSI_file_locker *locker;
   PSI_file_locker_state state;
-  locker= PSI_server->get_thread_file_descriptor_locker(&state, file, PSI_FILE_SEEK);
+  locker= PSI_CALL(get_thread_file_descriptor_locker)(&state, file, PSI_FILE_SEEK);
   if (likely(locker != NULL))
-    PSI_server->start_file_wait(locker, (size_t) 0, src_file, src_line);
+  {
+    PSI_CALL(start_file_wait)(locker, (size_t) 0, src_file, src_line);
+    result= my_seek(file, pos, whence, flags);
+    PSI_CALL(end_file_wait)(locker, (size_t) 0);
+    return result;
+  }
 #endif
+
   result= my_seek(file, pos, whence, flags);
-#ifdef HAVE_PSI_FILE_INTERFACE
-  if (likely(locker != NULL))
-    PSI_server->end_file_wait(locker, (size_t) 0);
-#endif
   return result;
 }
 
@@ -1225,17 +1239,19 @@ inline_mysql_file_tell(
 {
   my_off_t result;
 #ifdef HAVE_PSI_FILE_INTERFACE
-  struct PSI_file_locker *locker= NULL;
+  struct PSI_file_locker *locker;
   PSI_file_locker_state state;
-  locker= PSI_server->get_thread_file_descriptor_locker(&state, file, PSI_FILE_TELL);
+  locker= PSI_CALL(get_thread_file_descriptor_locker)(&state, file, PSI_FILE_TELL);
   if (likely(locker != NULL))
-    PSI_server->start_file_wait(locker, (size_t) 0, src_file, src_line);
+  {
+    PSI_CALL(start_file_wait)(locker, (size_t) 0, src_file, src_line);
+    result= my_tell(file, flags);
+    PSI_CALL(end_file_wait)(locker, (size_t) 0);
+    return result;
+  }
 #endif
+
   result= my_tell(file, flags);
-#ifdef HAVE_PSI_FILE_INTERFACE
-  if (likely(locker != NULL))
-    PSI_server->end_file_wait(locker, (size_t) 0);
-#endif
   return result;
 }
 
@@ -1248,18 +1264,20 @@ inline_mysql_file_delete(
 {
   int result;
 #ifdef HAVE_PSI_FILE_INTERFACE
-  struct PSI_file_locker *locker= NULL;
+  struct PSI_file_locker *locker;
   PSI_file_locker_state state;
-  locker= PSI_server->get_thread_file_name_locker(&state, key, PSI_FILE_DELETE,
-                                                  name, &locker);
+  locker= PSI_CALL(get_thread_file_name_locker)(&state, key, PSI_FILE_DELETE,
+                                                name, &locker);
   if (likely(locker != NULL))
-    PSI_server->start_file_wait(locker, (size_t) 0, src_file, src_line);
+  {
+    PSI_CALL(start_file_wait)(locker, (size_t) 0, src_file, src_line);
+    result= my_delete(name, flags);
+    PSI_CALL(end_file_wait)(locker, (size_t) 0);
+    return result;
+  }
 #endif
+
   result= my_delete(name, flags);
-#ifdef HAVE_PSI_FILE_INTERFACE
-  if (likely(locker != NULL))
-    PSI_server->end_file_wait(locker, (size_t) 0);
-#endif
   return result;
 }
 
@@ -1272,18 +1290,20 @@ inline_mysql_file_rename(
 {
   int result;
 #ifdef HAVE_PSI_FILE_INTERFACE
-  struct PSI_file_locker *locker= NULL;
+  struct PSI_file_locker *locker;
   PSI_file_locker_state state;
-  locker= PSI_server->get_thread_file_name_locker(&state, key, PSI_FILE_RENAME,
-                                                  to, &locker);
+  locker= PSI_CALL(get_thread_file_name_locker)(&state, key, PSI_FILE_RENAME,
+                                                to, &locker);
   if (likely(locker != NULL))
-    PSI_server->start_file_wait(locker, (size_t) 0, src_file, src_line);
+  {
+    PSI_CALL(start_file_wait)(locker, (size_t) 0, src_file, src_line);
+    result= my_rename(from, to, flags);
+    PSI_CALL(end_file_wait)(locker, (size_t) 0);
+    return result;
+  }
 #endif
+
   result= my_rename(from, to, flags);
-#ifdef HAVE_PSI_FILE_INTERFACE
-  if (likely(locker != NULL))
-    PSI_server->end_file_wait(locker, (size_t) 0);
-#endif
   return result;
 }
 
@@ -1297,19 +1317,22 @@ inline_mysql_file_create_with_symlink(
 {
   File file;
 #ifdef HAVE_PSI_FILE_INTERFACE
-  struct PSI_file_locker *locker= NULL;
+  struct PSI_file_locker *locker;
   PSI_file_locker_state state;
-  locker= PSI_server->get_thread_file_name_locker(&state, key, PSI_FILE_CREATE,
-                                                  filename, &locker);
+  locker= PSI_CALL(get_thread_file_name_locker)(&state, key, PSI_FILE_CREATE,
+                                                filename, &locker);
   if (likely(locker != NULL))
-    PSI_server->start_file_open_wait(locker, src_file, src_line);
+  {
+    PSI_CALL(start_file_open_wait)(locker, src_file, src_line);
+    file= my_create_with_symlink(linkname, filename, create_flags, access_flags,
+                                 flags);
+    PSI_CALL(end_file_open_wait_and_bind_to_descriptor)(locker, file);
+    return file;
+  }
 #endif
+
   file= my_create_with_symlink(linkname, filename, create_flags, access_flags,
                                flags);
-#ifdef HAVE_PSI_FILE_INTERFACE
-  if (likely(locker != NULL))
-    PSI_server->end_file_open_wait_and_bind_to_descriptor(locker, file);
-#endif
   return file;
 }
 
@@ -1322,18 +1345,20 @@ inline_mysql_file_delete_with_symlink(
 {
   int result;
 #ifdef HAVE_PSI_FILE_INTERFACE
-  struct PSI_file_locker *locker= NULL;
+  struct PSI_file_locker *locker;
   PSI_file_locker_state state;
-  locker= PSI_server->get_thread_file_name_locker(&state, key, PSI_FILE_DELETE,
-                                                  name, &locker);
+  locker= PSI_CALL(get_thread_file_name_locker)(&state, key, PSI_FILE_DELETE,
+                                                name, &locker);
   if (likely(locker != NULL))
-    PSI_server->start_file_wait(locker, (size_t) 0, src_file, src_line);
+  {
+    PSI_CALL(start_file_wait)(locker, (size_t) 0, src_file, src_line);
+    result= my_delete_with_symlink(name, flags);
+    PSI_CALL(end_file_wait)(locker, (size_t) 0);
+    return result;
+  }
 #endif
+
   result= my_delete_with_symlink(name, flags);
-#ifdef HAVE_PSI_FILE_INTERFACE
-  if (likely(locker != NULL))
-    PSI_server->end_file_wait(locker, (size_t) 0);
-#endif
   return result;
 }
 
@@ -1346,18 +1371,20 @@ inline_mysql_file_rename_with_symlink(
 {
   int result;
 #ifdef HAVE_PSI_FILE_INTERFACE
-  struct PSI_file_locker *locker= NULL;
+  struct PSI_file_locker *locker;
   PSI_file_locker_state state;
-  locker= PSI_server->get_thread_file_name_locker(&state, key, PSI_FILE_RENAME,
-                                                  to, &locker);
+  locker= PSI_CALL(get_thread_file_name_locker)(&state, key, PSI_FILE_RENAME,
+                                                to, &locker);
   if (likely(locker != NULL))
-    PSI_server->start_file_wait(locker, (size_t) 0, src_file, src_line);
+  {
+    PSI_CALL(start_file_wait)(locker, (size_t) 0, src_file, src_line);
+    result= my_rename_with_symlink(from, to, flags);
+    PSI_CALL(end_file_wait)(locker, (size_t) 0);
+    return result;
+  }
 #endif
+
   result= my_rename_with_symlink(from, to, flags);
-#ifdef HAVE_PSI_FILE_INTERFACE
-  if (likely(locker != NULL))
-    PSI_server->end_file_wait(locker, (size_t) 0);
-#endif
   return result;
 }
 
@@ -1370,17 +1397,19 @@ inline_mysql_file_sync(
 {
   int result= 0;
 #ifdef HAVE_PSI_FILE_INTERFACE
-  struct PSI_file_locker *locker= NULL;
+  struct PSI_file_locker *locker;
   PSI_file_locker_state state;
-  locker= PSI_server->get_thread_file_descriptor_locker(&state, fd, PSI_FILE_SYNC);
+  locker= PSI_CALL(get_thread_file_descriptor_locker)(&state, fd, PSI_FILE_SYNC);
   if (likely(locker != NULL))
-    PSI_server->start_file_wait(locker, (size_t) 0, src_file, src_line);
+  {
+    PSI_CALL(start_file_wait)(locker, (size_t) 0, src_file, src_line);
+    result= my_sync(fd, flags);
+    PSI_CALL(end_file_wait)(locker, (size_t) 0);
+    return result;
+  }
 #endif
+
   result= my_sync(fd, flags);
-#ifdef HAVE_PSI_FILE_INTERFACE
-  if (likely(locker != NULL))
-    PSI_server->end_file_wait(locker, (size_t) 0);
-#endif
   return result;
 }
 

=== modified file 'include/mysql/psi/mysql_stage.h'
--- a/include/mysql/psi/mysql_stage.h	2011-05-03 23:49:32 +0000
+++ b/include/mysql/psi/mysql_stage.h	2011-05-04 05:02:43 +0000
@@ -53,7 +53,7 @@
 static inline void inline_mysql_stage_register(
   const char *category, PSI_stage_info **info, int count)
 {
-  PSI_server->register_stage(category, info, count);
+  PSI_CALL(register_stage)(category, info, count);
 }
 #endif
 
@@ -62,7 +62,7 @@ static inline void
 inline_mysql_set_stage(PSI_stage_key key,
                        const char *src_file, int src_line)
 {
-  PSI_server->start_stage(key, src_file, src_line);
+  PSI_CALL(start_stage)(key, src_file, src_line);
 }
 #endif
 

=== modified file 'include/mysql/psi/mysql_statement.h'
--- a/include/mysql/psi/mysql_statement.h	2011-05-03 23:49:32 +0000
+++ b/include/mysql/psi/mysql_statement.h	2011-05-04 05:02:43 +0000
@@ -101,7 +101,7 @@
 static inline void inline_mysql_statement_register(
   const char *category, PSI_statement_info *info, int count)
 {
-  PSI_server->register_statement(category, info, count);
+  PSI_CALL(register_statement)(category, info, count);
 }
 
 static inline struct PSI_statement_locker *
@@ -111,9 +111,9 @@ inline_mysql_start_statement(PSI_stateme
                              const char *src_file, int src_line)
 {
   PSI_statement_locker *locker= NULL;
-  locker= PSI_server->get_thread_statement_locker(state, key);
+  locker= PSI_CALL(get_thread_statement_locker)(state, key);
   if (likely(locker != NULL))
-    PSI_server->start_statement(locker, db, db_len, src_file, src_line);
+    PSI_CALL(start_statement)(locker, db, db_len, src_file, src_line);
   return locker;
 }
 
@@ -123,7 +123,7 @@ inline_mysql_refine_statement(PSI_statem
 {
   if (likely(locker != NULL))
   {
-    locker= PSI_server->refine_statement(locker, key);
+    locker= PSI_CALL(refine_statement)(locker, key);
   }
   return locker;
 }
@@ -134,7 +134,7 @@ inline_mysql_set_statement_text(PSI_stat
 {
   if (likely(locker != NULL))
   {
-    PSI_server->set_statement_text(locker, text, text_len);
+    PSI_CALL(set_statement_text)(locker, text, text_len);
   }
 }
 
@@ -144,7 +144,7 @@ inline_mysql_set_statement_lock_time(PSI
 {
   if (likely(locker != NULL))
   {
-    PSI_server->set_statement_lock_time(locker, count);
+    PSI_CALL(set_statement_lock_time)(locker, count);
   }
 }
 
@@ -154,7 +154,7 @@ inline_mysql_set_statement_rows_sent(PSI
 {
   if (likely(locker != NULL))
   {
-    PSI_server->set_statement_rows_sent(locker, count);
+    PSI_CALL(set_statement_rows_sent)(locker, count);
   }
 }
 
@@ -164,7 +164,7 @@ inline_mysql_set_statement_rows_examined
 {
   if (likely(locker != NULL))
   {
-    PSI_server->set_statement_rows_examined(locker, count);
+    PSI_CALL(set_statement_rows_examined)(locker, count);
   }
 }
 
@@ -172,9 +172,9 @@ static inline void
 inline_mysql_end_statement(struct PSI_statement_locker *locker,
                            Diagnostics_area *stmt_da)
 {
-  PSI_server->end_stage();
+  PSI_CALL(end_stage)();
   if (likely(locker != NULL))
-    PSI_server->end_statement(locker, stmt_da);
+    PSI_CALL(end_statement)(locker, stmt_da);
 }
 #endif
 

=== modified file 'include/mysql/psi/mysql_table.h'
--- a/include/mysql/psi/mysql_table.h	2011-05-04 03:17:46 +0000
+++ b/include/mysql/psi/mysql_table.h	2011-05-04 05:02:43 +0000
@@ -98,9 +98,9 @@ inline_mysql_start_table_io_wait(PSI_tab
                                  const char *src_file, int src_line)
 {
   struct PSI_table_locker *locker;
-  locker= PSI_server->get_thread_table_io_locker(state, psi, op, index);
+  locker= PSI_CALL(get_thread_table_io_locker)(state, psi, op, index);
   if (likely(locker != NULL))
-    PSI_server->start_table_io_wait(locker, src_file, src_line);
+    PSI_CALL(start_table_io_wait)(locker, src_file, src_line);
   return locker;
 }
 
@@ -112,7 +112,7 @@ static inline void
 inline_mysql_end_table_io_wait(struct PSI_table_locker *locker)
 {
   if (likely(locker != NULL))
-    PSI_server->end_table_io_wait(locker);
+    PSI_CALL(end_table_io_wait)(locker);
 }
 #endif
 
@@ -163,9 +163,9 @@ inline_mysql_start_table_lock_wait(PSI_t
                                    ulong flags, const char *src_file, int src_line)
 {
   struct PSI_table_locker *locker;
-  locker= PSI_server->get_thread_table_lock_locker(state, psi, op, flags);
+  locker= PSI_CALL(get_thread_table_lock_locker)(state, psi, op, flags);
   if (likely(locker != NULL))
-    PSI_server->start_table_lock_wait(locker, src_file, src_line);
+    PSI_CALL(start_table_lock_wait)(locker, src_file, src_line);
   return locker;
 }
 
@@ -177,7 +177,7 @@ static inline void
 inline_mysql_end_table_lock_wait(struct PSI_table_locker *locker)
 {
   if (likely(locker != NULL))
-    PSI_server->end_table_lock_wait(locker);
+    PSI_CALL(end_table_lock_wait)(locker);
 }
 #endif
 

=== modified file 'include/mysql/psi/mysql_thread.h'
--- a/include/mysql/psi/mysql_thread.h	2011-05-04 03:17:46 +0000
+++ b/include/mysql/psi/mysql_thread.h	2011-05-04 05:02:43 +0000
@@ -588,7 +588,7 @@ static inline void inline_mysql_mutex_re
 )
 {
 #ifdef HAVE_PSI_MUTEX_INTERFACE
-  PSI_server->register_mutex(category, info, count);
+  PSI_CALL(register_mutex)(category, info, count);
 #endif
 }
 
@@ -604,7 +604,7 @@ static inline int inline_mysql_mutex_ini
   )
 {
 #ifdef HAVE_PSI_MUTEX_INTERFACE
-  that->m_psi= PSI_server->init_mutex(key, &that->m_mutex);
+  that->m_psi= PSI_CALL(init_mutex)(key, &that->m_mutex);
 #else
   that->m_psi= NULL;
 #endif
@@ -623,7 +623,7 @@ static inline int inline_mysql_mutex_des
   )
 {
 #ifdef HAVE_PSI_MUTEX_INTERFACE
-  PSI_server->destroy_mutex(that->m_psi);
+  PSI_CALL(destroy_mutex)(that->m_psi);
   that->m_psi= NULL;
 #endif
 #ifdef SAFE_MUTEX
@@ -644,16 +644,16 @@ static inline int inline_mysql_mutex_loc
 #ifdef HAVE_PSI_MUTEX_INTERFACE
   struct PSI_mutex_locker *locker;
   PSI_mutex_locker_state state;
-  locker= PSI_server->get_thread_mutex_locker(&state, that->m_psi, PSI_MUTEX_LOCK);
+  locker= PSI_CALL(get_thread_mutex_locker)(&state, that->m_psi, PSI_MUTEX_LOCK);
   if (likely(locker != NULL))
   {
-    PSI_server->start_mutex_wait(locker, src_file, src_line);
+    PSI_CALL(start_mutex_wait)(locker, src_file, src_line);
 #ifdef SAFE_MUTEX
     result= safe_mutex_lock(&that->m_mutex, FALSE, src_file, src_line);
 #else
     result= pthread_mutex_lock(&that->m_mutex);
 #endif
-    PSI_server->end_mutex_wait(locker, result);
+    PSI_CALL(end_mutex_wait)(locker, result);
     return result;
   }
 #endif
@@ -677,16 +677,16 @@ static inline int inline_mysql_mutex_try
 #ifdef HAVE_PSI_MUTEX_INTERFACE
   struct PSI_mutex_locker *locker;
   PSI_mutex_locker_state state;
-  locker= PSI_server->get_thread_mutex_locker(&state, that->m_psi, PSI_MUTEX_TRYLOCK);
+  locker= PSI_CALL(get_thread_mutex_locker)(&state, that->m_psi, PSI_MUTEX_TRYLOCK);
   if (likely(locker != NULL))
   {
-    PSI_server->start_mutex_wait(locker, src_file, src_line);
+    PSI_CALL(start_mutex_wait)(locker, src_file, src_line);
 #ifdef SAFE_MUTEX
     result= safe_mutex_lock(&that->m_mutex, TRUE, src_file, src_line);
 #else
     result= pthread_mutex_trylock(&that->m_mutex);
 #endif
-    PSI_server->end_mutex_wait(locker, result);
+    PSI_CALL(end_mutex_wait)(locker, result);
     return result;
   }
 #endif
@@ -708,7 +708,7 @@ static inline int inline_mysql_mutex_unl
 {
   int result;
 #ifdef HAVE_PSI_MUTEX_INTERFACE
-  PSI_server->unlock_mutex(that->m_psi);
+  PSI_CALL(unlock_mutex)(that->m_psi);
 #endif
 #ifdef SAFE_MUTEX
   result= safe_mutex_unlock(&that->m_mutex, src_file, src_line);
@@ -731,7 +731,7 @@ static inline void inline_mysql_rwlock_r
 )
 {
 #ifdef HAVE_PSI_RWLOCK_INTERFACE
-  PSI_server->register_rwlock(category, info, count);
+  PSI_CALL(register_rwlock)(category, info, count);
 #endif
 }
 
@@ -742,7 +742,7 @@ static inline int inline_mysql_rwlock_in
   mysql_rwlock_t *that)
 {
 #ifdef HAVE_PSI_RWLOCK_INTERFACE
-  that->m_psi= PSI_server->init_rwlock(key, &that->m_rwlock);
+  that->m_psi= PSI_CALL(init_rwlock)(key, &that->m_rwlock);
 #else
   that->m_psi= NULL;
 #endif
@@ -760,7 +760,7 @@ static inline int inline_mysql_prlock_in
   mysql_prlock_t *that)
 {
 #ifdef HAVE_PSI_RWLOCK_INTERFACE
-  that->m_psi= PSI_server->init_rwlock(key, &that->m_prlock);
+  that->m_psi= PSI_CALL(init_rwlock)(key, &that->m_prlock);
 #else
   that->m_psi= NULL;
 #endif
@@ -772,7 +772,7 @@ static inline int inline_mysql_rwlock_de
   mysql_rwlock_t *that)
 {
 #ifdef HAVE_PSI_RWLOCK_INTERFACE
-  PSI_server->destroy_rwlock(that->m_psi);
+  PSI_CALL(destroy_rwlock)(that->m_psi);
   that->m_psi= NULL;
 #endif
   return rwlock_destroy(&that->m_rwlock);
@@ -783,7 +783,7 @@ static inline int inline_mysql_prlock_de
   mysql_prlock_t *that)
 {
 #ifdef HAVE_PSI_RWLOCK_INTERFACE
-  PSI_server->destroy_rwlock(that->m_psi);
+  PSI_CALL(destroy_rwlock)(that->m_psi);
   that->m_psi= NULL;
 #endif
   return rw_pr_destroy(&that->m_prlock);
@@ -801,13 +801,13 @@ static inline int inline_mysql_rwlock_rd
 #ifdef HAVE_PSI_RWLOCK_INTERFACE
   struct PSI_rwlock_locker *locker;
   PSI_rwlock_locker_state state;
-  locker= PSI_server->get_thread_rwlock_locker(&state, that->m_psi,
-                                               PSI_RWLOCK_READLOCK);
+  locker= PSI_CALL(get_thread_rwlock_locker)(&state, that->m_psi,
+                                             PSI_RWLOCK_READLOCK);
   if (likely(locker != NULL))
   {
-    PSI_server->start_rwlock_rdwait(locker, src_file, src_line);
+    PSI_CALL(start_rwlock_rdwait)(locker, src_file, src_line);
     result= rw_rdlock(&that->m_rwlock);
-    PSI_server->end_rwlock_rdwait(locker, result);
+    PSI_CALL(end_rwlock_rdwait)(locker, result);
     return result;
   }
 #endif
@@ -828,13 +828,13 @@ static inline int inline_mysql_prlock_rd
 #ifdef HAVE_PSI_RWLOCK_INTERFACE
   struct PSI_rwlock_locker *locker;
   PSI_rwlock_locker_state state;
-  locker= PSI_server->get_thread_rwlock_locker(&state, that->m_psi,
-                                               PSI_RWLOCK_READLOCK);
+  locker= PSI_CALL(get_thread_rwlock_locker)(&state, that->m_psi,
+                                             PSI_RWLOCK_READLOCK);
   if (likely(locker != NULL))
   {
-    PSI_server->start_rwlock_rdwait(locker, src_file, src_line);
+    PSI_CALL(start_rwlock_rdwait)(locker, src_file, src_line);
     result= rw_pr_rdlock(&that->m_prlock);
-    PSI_server->end_rwlock_rdwait(locker, result);
+    PSI_CALL(end_rwlock_rdwait)(locker, result);
     return result;
   }
 #endif
@@ -855,13 +855,13 @@ static inline int inline_mysql_rwlock_wr
 #ifdef HAVE_PSI_RWLOCK_INTERFACE
   struct PSI_rwlock_locker *locker;
   PSI_rwlock_locker_state state;
-  locker= PSI_server->get_thread_rwlock_locker(&state, that->m_psi,
-                                               PSI_RWLOCK_WRITELOCK);
+  locker= PSI_CALL(get_thread_rwlock_locker)(&state, that->m_psi,
+                                             PSI_RWLOCK_WRITELOCK);
   if (likely(locker != NULL))
   {
-    PSI_server->start_rwlock_wrwait(locker, src_file, src_line);
+    PSI_CALL(start_rwlock_wrwait)(locker, src_file, src_line);
     result= rw_wrlock(&that->m_rwlock);
-    PSI_server->end_rwlock_wrwait(locker, result);
+    PSI_CALL(end_rwlock_wrwait)(locker, result);
     return result;
   }
 #endif
@@ -882,13 +882,13 @@ static inline int inline_mysql_prlock_wr
 #ifdef HAVE_PSI_RWLOCK_INTERFACE
   struct PSI_rwlock_locker *locker;
   PSI_rwlock_locker_state state;
-  locker= PSI_server->get_thread_rwlock_locker(&state, that->m_psi,
-                                               PSI_RWLOCK_WRITELOCK);
+  locker= PSI_CALL(get_thread_rwlock_locker)(&state, that->m_psi,
+                                             PSI_RWLOCK_WRITELOCK);
   if (likely(locker != NULL))
   {
-    PSI_server->start_rwlock_wrwait(locker, src_file, src_line);
+    PSI_CALL(start_rwlock_wrwait)(locker, src_file, src_line);
     result= rw_pr_wrlock(&that->m_prlock);
-    PSI_server->end_rwlock_wrwait(locker, result);
+    PSI_CALL(end_rwlock_wrwait)(locker, result);
     return result;
   }
 #endif
@@ -909,13 +909,13 @@ static inline int inline_mysql_rwlock_tr
 #ifdef HAVE_PSI_RWLOCK_INTERFACE
   struct PSI_rwlock_locker *locker;
   PSI_rwlock_locker_state state;
-  locker= PSI_server->get_thread_rwlock_locker(&state, that->m_psi,
-                                               PSI_RWLOCK_TRYREADLOCK);
+  locker= PSI_CALL(get_thread_rwlock_locker)(&state, that->m_psi,
+                                             PSI_RWLOCK_TRYREADLOCK);
   if (likely(locker != NULL))
   {
-    PSI_server->start_rwlock_rdwait(locker, src_file, src_line);
+    PSI_CALL(start_rwlock_rdwait)(locker, src_file, src_line);
     result= rw_tryrdlock(&that->m_rwlock);
-    PSI_server->end_rwlock_rdwait(locker, result);
+    PSI_CALL(end_rwlock_rdwait)(locker, result);
     return result;
   }
 #endif
@@ -935,13 +935,13 @@ static inline int inline_mysql_rwlock_tr
 #ifdef HAVE_PSI_RWLOCK_INTERFACE
   struct PSI_rwlock_locker *locker;
   PSI_rwlock_locker_state state;
-  locker= PSI_server->get_thread_rwlock_locker(&state, that->m_psi,
-                                               PSI_RWLOCK_TRYWRITELOCK);
+  locker= PSI_CALL(get_thread_rwlock_locker)(&state, that->m_psi,
+                                             PSI_RWLOCK_TRYWRITELOCK);
   if (likely(locker != NULL))
   {
-    PSI_server->start_rwlock_wrwait(locker, src_file, src_line);
+    PSI_CALL(start_rwlock_wrwait)(locker, src_file, src_line);
     result= rw_trywrlock(&that->m_rwlock);
-    PSI_server->end_rwlock_wrwait(locker, result);
+    PSI_CALL(end_rwlock_wrwait)(locker, result);
     return result;
   }
 #endif
@@ -955,7 +955,7 @@ static inline int inline_mysql_rwlock_un
 {
   int result;
 #ifdef HAVE_PSI_RWLOCK_INTERFACE
-  PSI_server->unlock_rwlock(that->m_psi);
+  PSI_CALL(unlock_rwlock)(that->m_psi);
 #endif
   result= rw_unlock(&that->m_rwlock);
   return result;
@@ -967,7 +967,7 @@ static inline int inline_mysql_prlock_un
 {
   int result;
 #ifdef HAVE_PSI_RWLOCK_INTERFACE
-  PSI_server->unlock_rwlock(that->m_psi);
+  PSI_CALL(unlock_rwlock)(that->m_psi);
 #endif
   result= rw_pr_unlock(&that->m_prlock);
   return result;
@@ -987,7 +987,7 @@ static inline void inline_mysql_cond_reg
 )
 {
 #ifdef HAVE_PSI_COND_INTERFACE
-  PSI_server->register_cond(category, info, count);
+  PSI_CALL(register_cond)(category, info, count);
 #endif
 }
 
@@ -999,7 +999,7 @@ static inline int inline_mysql_cond_init
   const pthread_condattr_t *attr)
 {
 #ifdef HAVE_PSI_COND_INTERFACE
-  that->m_psi= PSI_server->init_cond(key, &that->m_cond);
+  that->m_psi= PSI_CALL(init_cond)(key, &that->m_cond);
 #else
   that->m_psi= NULL;
 #endif
@@ -1010,7 +1010,7 @@ static inline int inline_mysql_cond_dest
   mysql_cond_t *that)
 {
 #ifdef HAVE_PSI_COND_INTERFACE
-  PSI_server->destroy_cond(that->m_psi);
+  PSI_CALL(destroy_cond)(that->m_psi);
   that->m_psi= NULL;
 #endif
   return pthread_cond_destroy(&that->m_cond);
@@ -1028,13 +1028,13 @@ static inline int inline_mysql_cond_wait
 #ifdef HAVE_PSI_COND_INTERFACE
   struct PSI_cond_locker *locker;
   PSI_cond_locker_state state;
-  locker= PSI_server->get_thread_cond_locker(&state, that->m_psi, mutex->m_psi,
-                                             PSI_COND_WAIT);
+  locker= PSI_CALL(get_thread_cond_locker)(&state, that->m_psi, mutex->m_psi,
+                                           PSI_COND_WAIT);
   if (likely(locker != NULL))
   {
-    PSI_server->start_cond_wait(locker, src_file, src_line);
+    PSI_CALL(start_cond_wait)(locker, src_file, src_line);
     result= pthread_cond_wait(&that->m_cond, &mutex->m_mutex);
-    PSI_server->end_cond_wait(locker, result);
+    PSI_CALL(end_cond_wait)(locker, result);
     return result;
   }
 #endif
@@ -1056,13 +1056,13 @@ static inline int inline_mysql_cond_time
 #ifdef HAVE_PSI_COND_INTERFACE
   struct PSI_cond_locker *locker;
   PSI_cond_locker_state state;
-  locker= PSI_server->get_thread_cond_locker(&state, that->m_psi, mutex->m_psi,
-                                             PSI_COND_TIMEDWAIT);
+  locker= PSI_CALL(get_thread_cond_locker)(&state, that->m_psi, mutex->m_psi,
+                                           PSI_COND_TIMEDWAIT);
   if (likely(locker != NULL))
   {
-    PSI_server->start_cond_wait(locker, src_file, src_line);
+    PSI_CALL(start_cond_wait)(locker, src_file, src_line);
     result= pthread_cond_timedwait(&that->m_cond, &mutex->m_mutex, abstime);
-    PSI_server->end_cond_wait(locker, result);
+    PSI_CALL(end_cond_wait)(locker, result);
     return result;
   }
 #endif
@@ -1076,7 +1076,7 @@ static inline int inline_mysql_cond_sign
 {
   int result;
 #ifdef HAVE_PSI_COND_INTERFACE
-  PSI_server->signal_cond(that->m_psi);
+  PSI_CALL(signal_cond)(that->m_psi);
 #endif
   result= pthread_cond_signal(&that->m_cond);
   return result;
@@ -1087,7 +1087,7 @@ static inline int inline_mysql_cond_broa
 {
   int result;
 #ifdef HAVE_PSI_COND_INTERFACE
-  PSI_server->broadcast_cond(that->m_psi);
+  PSI_CALL(broadcast_cond)(that->m_psi);
 #endif
   result= pthread_cond_broadcast(&that->m_cond);
   return result;
@@ -1106,7 +1106,7 @@ static inline void inline_mysql_thread_r
 )
 {
 #ifdef HAVE_PSI_THREAD_INTERFACE
-  PSI_server->register_thread(category, info, count);
+  PSI_CALL(register_thread)(category, info, count);
 #endif
 }
 
@@ -1117,15 +1117,15 @@ static inline int inline_mysql_thread_cr
   void *(*start_routine)(void*), void *arg)
 {
   int result;
-  result= PSI_server->spawn_thread(key, thread, attr, start_routine, arg);
+  result= PSI_CALL(spawn_thread)(key, thread, attr, start_routine, arg);
   return result;
 }
 
 static inline void inline_mysql_thread_set_psi_id(ulong id)
 {
-  struct PSI_thread *psi= PSI_server->get_thread();
+  struct PSI_thread *psi= PSI_CALL(get_thread)();
   if (likely(psi != NULL))
-    PSI_server->set_thread_id(psi, id);
+    PSI_CALL(set_thread_id)(psi, id);
 }
 #endif
 

=== modified file 'include/mysql/psi/psi.h'
--- a/include/mysql/psi/psi.h	2011-04-26 20:35:24 +0000
+++ b/include/mysql/psi/psi.h	2011-05-04 05:02:43 +0000
@@ -1961,6 +1961,18 @@ typedef struct PSI_stage_info_none PSI_s
 
 extern MYSQL_PLUGIN_IMPORT PSI *PSI_server;
 
+#define PSI_CALL(API) PSI_server->API
+
+/* Not implemented yet: static calls for statically compiled code */
+#ifdef LATER
+#ifdef USE_PSI_1
+#define PSI_CALL(API) pfs_ ## API ## _v1
+#endif
+#ifdef USE_PSI_2
+#define PSI_CALL(API) pfs_ ## API ## _v2
+#endif
+#endif
+
 /** @} */
 
 C_MODE_END

=== modified file 'mysys/psi_noop.cc'
--- a/mysys/psi_noop.cc	2011-05-04 03:19:36 +0000
+++ b/mysys/psi_noop.cc	2011-05-04 05:12:55 +0000
@@ -15,6 +15,7 @@
 
 #include "my_global.h"
 #include "my_pthread.h"
+#include "my_sys.h"
 #include "mysql/psi/psi.h"
 
 #ifdef HAVE_PSI_INTERFACE
@@ -615,6 +616,8 @@ static PSI PSI_noop=
 };
 #endif
 
+extern "C" {
+
 /**
   Hook for the instrumentation interface.
   Code implementing the instrumentation interface should register here.
@@ -632,5 +635,5 @@ struct PSI_bootstrap *PSI_hook= NULL;
 */
 PSI *PSI_server= & PSI_noop;
 
-
+}
 

=== modified file 'storage/innobase/include/os0file.h'
--- a/storage/innobase/include/os0file.h	2011-04-13 08:34:16 +0000
+++ b/storage/innobase/include/os0file.h	2011-05-04 05:02:43 +0000
@@ -204,20 +204,18 @@ used to register actual file read, write
 # define register_pfs_file_open_begin(state, locker, key, op, name,	\
 				      src_file, src_line)		\
 do {									\
-	if (PSI_server) {						\
-		locker = PSI_server->get_thread_file_name_locker(	\
-			state, key, op, name, &locker);			\
-		if (locker) {						\
-			PSI_server->start_file_open_wait(		\
-				locker, src_file, src_line);		\
-		}							\
+	locker = PSI_CALL(get_thread_file_name_locker)(			\
+		state, key, op, name, &locker);				\
+	if (UNIV_LIKELY(locker != NULL)) {				\
+		PSI_CALL(start_file_open_wait)(				\
+			locker, src_file, src_line);			\
 	}								\
 } while (0)
 
 # define register_pfs_file_open_end(locker, file)			\
 do {									\
-	if (locker) {							\
-		PSI_server->end_file_open_wait_and_bind_to_descriptor(	\
+	if (UNIV_LIKELY(locker != NULL)) {				\
+		PSI_CALL(end_file_open_wait_and_bind_to_descriptor)(	\
 			locker, file);					\
 	}								\
 } while (0)
@@ -225,20 +223,18 @@ do {									\
 # define register_pfs_file_io_begin(state, locker, file, count, op,	\
 				    src_file, src_line)			\
 do {									\
-	if (PSI_server) {						\
-		locker = PSI_server->get_thread_file_descriptor_locker(	\
-			state, file, op);				\
-		if (locker) {						\
-			PSI_server->start_file_wait(			\
-				locker, count, src_file, src_line);	\
-		}							\
+	locker = PSI_CALL(get_thread_file_descriptor_locker)(		\
+		state, file, op);					\
+	if (UNIV_LIKELY(locker != NULL)) {				\
+		PSI_CALL(start_file_wait)(				\
+			locker, count, src_file, src_line);		\
 	}								\
 } while (0)
 
 # define register_pfs_file_io_end(locker, count)			\
 do {									\
-	if (locker) {							\
-		PSI_server->end_file_wait(locker, count);		\
+	if (UNIV_LIKELY(locker != NULL)) {				\
+		PSI_CALL(end_file_wait)(locker, count);			\
 	}								\
 } while (0)
 #endif /* UNIV_PFS_IO  */

=== modified file 'storage/innobase/include/os0sync.ic'
--- a/storage/innobase/include/os0sync.ic	2011-05-04 03:17:46 +0000
+++ b/storage/innobase/include/os0sync.ic	2011-05-04 05:02:43 +0000
@@ -66,7 +66,7 @@ pfs_os_fast_mutex_init(
 	os_fast_mutex_t*	fast_mutex)	/*!< out: fast mutex */
 {
 #ifdef HAVE_PSI_MUTEX_INTERFACE
-	fast_mutex->pfs_psi = PSI_server->init_mutex(key, &fast_mutex->mutex);
+	fast_mutex->pfs_psi = PSI_CALL(init_mutex)(key, &fast_mutex->mutex);
 #else
 	fast_mutex->pfs_psi = NULL;
 #endif
@@ -85,7 +85,7 @@ pfs_os_fast_mutex_free(
 	os_fast_mutex_t*	fast_mutex)  /*!< in/out: mutex */
 {
 #ifdef HAVE_PSI_MUTEX_INTERFACE
-	PSI_server->destroy_mutex(fast_mutex->pfs_psi);
+	PSI_CALL(destroy_mutex)(fast_mutex->pfs_psi);
 #endif
 	fast_mutex->pfs_psi = NULL;
 
@@ -109,13 +109,13 @@ pfs_os_fast_mutex_lock(
 	struct PSI_mutex_locker*        locker;
 	PSI_mutex_locker_state          state;
 
-	locker = PSI_server->get_thread_mutex_locker(
+	locker = PSI_CALL(get_thread_mutex_locker)(
 			&state, fast_mutex->pfs_psi, PSI_MUTEX_LOCK);
 	if (UNIV_LIKELY(locker != NULL))
 	{
-		PSI_server->start_mutex_wait(locker, file_name, line);
+		PSI_CALL(start_mutex_wait)(locker, file_name, line);
 		os_fast_mutex_lock_func(&fast_mutex->mutex);
-		PSI_server->end_mutex_wait(locker, 0);
+		PSI_CALL(end_mutex_wait)(locker, 0);
 		return;
 	}
 #endif
@@ -134,7 +134,7 @@ pfs_os_fast_mutex_unlock(
 	os_fast_mutex_t*	fast_mutex)	/*!< in/out: mutex to release */
 {
 #ifdef HAVE_PSI_MUTEX_INTERFACE
-	PSI_server->unlock_mutex(fast_mutex->pfs_psi);
+	PSI_CALL(unlock_mutex)(fast_mutex->pfs_psi);
 #endif
 
 	os_fast_mutex_unlock_func(&fast_mutex->mutex);

=== modified file 'storage/innobase/include/srv0srv.h'
--- a/storage/innobase/include/srv0srv.h	2011-04-26 18:59:22 +0000
+++ b/storage/innobase/include/srv0srv.h	2011-05-04 05:02:43 +0000
@@ -360,20 +360,16 @@ extern mysql_pfs_key_t	srv_purge_thread_
 schema */
 #  define pfs_register_thread(key)			\
 do {								\
-	if (PSI_server) {					\
-		struct PSI_thread* psi = PSI_server->new_thread(key, NULL, 0);\
-		if (psi) {					\
-			PSI_server->set_thread(psi);		\
-		}						\
+	struct PSI_thread* psi = PSI_CALL(new_thread)(key, NULL, 0);\
+	if (UNIV_LIKELY(psi != NULL)) {				\
+		PSI_CALL(set_thread)(psi);			\
 	}							\
 } while (0)
 
 /* This macro delist the current thread from performance schema */
 #  define pfs_delete_thread()				\
 do {								\
-	if (PSI_server) {					\
-		PSI_server->delete_current_thread();		\
-	}							\
+	PSI_CALL(delete_current_thread)();			\
 } while (0)
 # endif /* UNIV_PFS_THREAD */
 

=== modified file 'storage/innobase/include/sync0rw.ic'
--- a/storage/innobase/include/sync0rw.ic	2011-05-04 03:17:46 +0000
+++ b/storage/innobase/include/sync0rw.ic	2011-05-04 05:02:43 +0000
@@ -647,7 +647,7 @@ pfs_rw_lock_create_func(
 {
 #ifdef HAVE_PSI_RWLOCK_INTERFACE
 	/* Initialize the rwlock for performance schema */
-	lock->pfs_psi = PSI_server->init_rwlock(key, lock);
+	lock->pfs_psi = PSI_CALL(init_rwlock)(key, lock);
 #else
 	lock->pfs_psi = NULL;
 #endif
@@ -682,14 +682,14 @@ pfs_rw_lock_x_lock_func(
 	PSI_rwlock_locker_state		state;
 
 	/* Record the entry of rw x lock request in performance schema */
-	locker = PSI_server->get_thread_rwlock_locker(
+	locker = PSI_CALL(get_thread_rwlock_locker)(
 			&state, lock->pfs_psi, PSI_RWLOCK_WRITELOCK);
 
 	if (UNIV_LIKELY(locker != NULL))
 	{
-		PSI_server->start_rwlock_wrwait(locker, file_name, line);
+		PSI_CALL(start_rwlock_wrwait)(locker, file_name, line);
 		rw_lock_x_lock_func(lock, pass, file_name, line);
-		PSI_server->end_rwlock_wrwait(locker, 0);
+		PSI_CALL(end_rwlock_wrwait)(locker, 0);
 		return;
 	}
 #endif
@@ -717,14 +717,14 @@ pfs_rw_lock_x_lock_func_nowait(
 	ibool	ret;
 
 	/* Record the entry of rw x lock request in performance schema */
-	locker = PSI_server->get_thread_rwlock_locker(
+	locker = PSI_CALL(get_thread_rwlock_locker)(
 			&state, lock->pfs_psi, PSI_RWLOCK_WRITELOCK);
 
 	if (UNIV_LIKELY(locker != NULL))
 	{
-		PSI_server->start_rwlock_wrwait(locker, file_name, line);
+		PSI_CALL(start_rwlock_wrwait)(locker, file_name, line);
 		ret = rw_lock_x_lock_func_nowait(lock, file_name, line);
-		PSI_server->end_rwlock_wrwait(locker, 0);
+		PSI_CALL(end_rwlock_wrwait)(locker, 0);
 		return(ret);
 	}
 #endif
@@ -743,7 +743,7 @@ pfs_rw_lock_free_func(
 	rw_lock_t*	lock)	/*!< in: pointer to rw-lock */
 {
 #ifdef HAVE_PSI_RWLOCK_INTERFACE
-	PSI_server->destroy_rwlock(lock->pfs_psi);
+	PSI_CALL(destroy_rwlock)(lock->pfs_psi);
 #endif
 	lock->pfs_psi = NULL;
 
@@ -770,13 +770,13 @@ pfs_rw_lock_s_lock_func(
 	PSI_rwlock_locker_state		state;
 
 	/* Instrumented to inform we are aquiring a shared rwlock */
-	locker = PSI_server->get_thread_rwlock_locker(
+	locker = PSI_CALL(get_thread_rwlock_locker)(
 			&state, lock->pfs_psi, PSI_RWLOCK_READLOCK);
 	if (UNIV_LIKELY(locker != NULL))
 	{
-		PSI_server->start_rwlock_rdwait(locker, file_name, line);
+		PSI_CALL(start_rwlock_rdwait)(locker, file_name, line);
 		rw_lock_s_lock_func(lock, pass, file_name, line);
-		PSI_server->end_rwlock_rdwait(locker, 0);
+		PSI_CALL(end_rwlock_rdwait)(locker, 0);
 		return;
 	}
 #endif
@@ -805,13 +805,13 @@ pfs_rw_lock_s_lock_low(
 	ibool	ret;
 
 	/* Instrumented to inform we are aquiring a shared rwlock */
-	locker = PSI_server->get_thread_rwlock_locker(
+	locker = PSI_CALL(get_thread_rwlock_locker)(
 			&state, lock->pfs_psi, PSI_RWLOCK_READLOCK);
 	if (UNIV_LIKELY(locker != NULL))
 	{
-		PSI_server->start_rwlock_rdwait(locker, file_name, line);
+		PSI_CALL(start_rwlock_rdwait)(locker, file_name, line);
 		ret = rw_lock_s_lock_low(lock, pass, file_name, line);
-		PSI_server->end_rwlock_rdwait(locker, 0);
+		PSI_CALL(end_rwlock_rdwait)(locker, 0);
 		return(ret);
 	}
 #endif
@@ -837,7 +837,7 @@ pfs_rw_lock_x_unlock_func(
 {
 #ifdef HAVE_PSI_RWLOCK_INTERFACE
 	/* Inform performance schema we are unlocking the lock */
-	PSI_server->unlock_rwlock(lock->pfs_psi);
+	PSI_CALL(unlock_rwlock)(lock->pfs_psi);
 #endif
 
 	rw_lock_x_unlock_func(
@@ -864,7 +864,7 @@ pfs_rw_lock_s_unlock_func(
 {
 #ifdef HAVE_PSI_RWLOCK_INTERFACE
 	/* Inform performance schema we are unlocking the lock */
-	PSI_server->unlock_rwlock(lock->pfs_psi);
+	PSI_CALL(unlock_rwlock)(lock->pfs_psi);
 #endif
 
 	rw_lock_s_unlock_func(

=== modified file 'storage/innobase/include/sync0sync.ic'
--- a/storage/innobase/include/sync0sync.ic	2011-05-04 03:17:46 +0000
+++ b/storage/innobase/include/sync0sync.ic	2011-05-04 05:02:43 +0000
@@ -240,13 +240,13 @@ pfs_mutex_enter_func(
 	struct PSI_mutex_locker*	locker;
 	PSI_mutex_locker_state		state;
 
-	locker = PSI_server->get_thread_mutex_locker(
+	locker = PSI_CALL(get_thread_mutex_locker)(
 				&state, mutex->pfs_psi, PSI_MUTEX_LOCK);
 	if (UNIV_LIKELY(locker != NULL))
 	{
-		PSI_server->start_mutex_wait(locker, file_name, line);
+		PSI_CALL(start_mutex_wait)(locker, file_name, line);
 		mutex_enter_func(mutex, file_name, line);
-		PSI_server->end_mutex_wait(locker, 0);
+		PSI_CALL(end_mutex_wait)(locker, 0);
 		return;
 	}
 #endif
@@ -274,13 +274,13 @@ pfs_mutex_enter_nowait_func(
 	struct PSI_mutex_locker*	locker = NULL;
 	PSI_mutex_locker_state		state;
 
-	locker = PSI_server->get_thread_mutex_locker(
+	locker = PSI_CALL(get_thread_mutex_locker)(
 				&state, mutex->pfs_psi, PSI_MUTEX_LOCK);
 	if (UNIV_LIKELY(locker != NULL))
 	{
-		PSI_server->start_mutex_wait(locker, file_name, line);
+		PSI_CALL(start_mutex_wait)(locker, file_name, line);
 		ret = mutex_enter_nowait_func(mutex, file_name, line);
-		PSI_server->end_mutex_wait(locker, 0);
+		PSI_CALL(end_mutex_wait)(locker, 0);
 		return(ret);
 	}
 #endif
@@ -300,7 +300,7 @@ pfs_mutex_exit_func(
 	mutex_t*	mutex)	/*!< in: pointer to mutex */
 {
 #ifdef HAVE_PSI_MUTEX_INTERFACE
-	PSI_server->unlock_mutex(mutex->pfs_psi);
+	PSI_CALL(unlock_mutex)(mutex->pfs_psi);
 #endif
 
 	mutex_exit_func(mutex);
@@ -328,7 +328,7 @@ pfs_mutex_create_func(
 	ulint		cline)		/*!< in: file line where created */
 {
 #ifdef HAVE_PSI_MUTEX_INTERFACE
-	mutex->pfs_psi = PSI_server->init_mutex(key, mutex);
+	mutex->pfs_psi = PSI_CALL(init_mutex)(key, mutex);
 #else
 	mutex->pfs_psi = NULL;
 #endif
@@ -355,7 +355,7 @@ pfs_mutex_free_func(
 	mutex_t*	mutex)	/*!< in: mutex */
 {
 #ifdef HAVE_PSI_MUTEX_INTERFACE
-	PSI_server->destroy_mutex(mutex->pfs_psi);
+	PSI_CALL(destroy_mutex)(mutex->pfs_psi);
 #endif
 	mutex->pfs_psi = NULL;
 

No bundle (reason: useless for push emails).
Thread
bzr push into mysql-trunk-pfs-tuning branch (marc.alff:3367 to 3369) Marc Alff4 May