List:Commits« Previous MessageNext Message »
From:Marc Alff Date:May 3 2011 11:50pm
Subject:bzr push into mysql-trunk-pfs-tuning branch (marc.alff:3364 to 3365)
View as plain text  
 3365 Marc Alff	2011-05-03
      PERFORMANCE SCHEMA optimization.
      
      Potential optimization, to benchmark:
      - removed "if (likely(PSI_server != NULL))" from the instrumented code path.
      
      PSI_server is guaranteed to exist, it may point to PSI_noop.

    added:
      mysys/psi_noop.cc
    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
      mysys/CMakeLists.txt
      mysys/my_static.c
 3364 Marc Alff	2011-05-03
      New branch, dedicated to performance schema optimizations for 5.6

    modified:
      .bzr-mysql/default.conf
=== modified file 'include/mysql/psi/mysql_file.h'
--- a/include/mysql/psi/mysql_file.h	2011-04-28 03:11:43 +0000
+++ b/include/mysql/psi/mysql_file.h	2011-05-03 23:49:32 +0000
@@ -518,8 +518,7 @@ static inline void inline_mysql_file_reg
 )
 {
 #ifdef HAVE_PSI_FILE_INTERFACE
-  if (likely(PSI_server != NULL))
-    PSI_server->register_file(category, info, count);
+  PSI_server->register_file(category, info, count);
 #endif
 }
 
@@ -534,7 +533,7 @@ inline_mysql_file_fgets(
 #ifdef HAVE_PSI_FILE_INTERFACE
   struct PSI_file_locker *locker= NULL;
   PSI_file_locker_state state;
-  if (likely(PSI_server && file->m_psi))
+  if (likely(file->m_psi != NULL))
   {
     locker= PSI_server->get_thread_file_stream_locker(&state, file->m_psi,
                                                       PSI_FILE_READ);
@@ -561,7 +560,7 @@ inline_mysql_file_fgetc(
 #ifdef HAVE_PSI_FILE_INTERFACE
   struct PSI_file_locker *locker= NULL;
   PSI_file_locker_state state;
-  if (likely(PSI_server && file->m_psi))
+  if (likely(file->m_psi != NULL))
   {
     locker= PSI_server->get_thread_file_stream_locker(&state, file->m_psi,
                                                       PSI_FILE_READ);
@@ -589,7 +588,7 @@ inline_mysql_file_fputs(
   struct PSI_file_locker *locker= NULL;
   PSI_file_locker_state state;
   size_t bytes= 0;
-  if (likely(PSI_server && file->m_psi))
+  if (likely(file->m_psi != NULL))
   {
     locker= PSI_server->get_thread_file_stream_locker(&state, file->m_psi,
                                                       PSI_FILE_WRITE);
@@ -619,7 +618,7 @@ inline_mysql_file_fputc(
 #ifdef HAVE_PSI_FILE_INTERFACE
   struct PSI_file_locker *locker= NULL;
   PSI_file_locker_state state;
-  if (likely(PSI_server && file->m_psi))
+  if (likely(file->m_psi != NULL))
   {
     locker= PSI_server->get_thread_file_stream_locker(&state, file->m_psi,
                                                       PSI_FILE_WRITE);
@@ -646,7 +645,7 @@ inline_mysql_file_fprintf(MYSQL_FILE *fi
 #ifdef HAVE_PSI_FILE_INTERFACE
   struct PSI_file_locker *locker= NULL;
   PSI_file_locker_state state;
-  if (likely(PSI_server && file->m_psi))
+  if (likely(file->m_psi != NULL))
   {
     locker= PSI_server->get_thread_file_stream_locker(&state, file->m_psi,
                                                       PSI_FILE_WRITE);
@@ -675,7 +674,7 @@ inline_mysql_file_vfprintf(
 #ifdef HAVE_PSI_FILE_INTERFACE
   struct PSI_file_locker *locker= NULL;
   PSI_file_locker_state state;
-  if (likely(PSI_server && file->m_psi))
+  if (likely(file->m_psi != NULL))
   {
     locker= PSI_server->get_thread_file_stream_locker(&state, file->m_psi,
                                                       PSI_FILE_WRITE);
@@ -702,7 +701,7 @@ inline_mysql_file_fflush(
 #ifdef HAVE_PSI_FILE_INTERFACE
   struct PSI_file_locker *locker= NULL;
   PSI_file_locker_state state;
-  if (likely(PSI_server && file->m_psi))
+  if (likely(file->m_psi != NULL))
   {
     locker= PSI_server->get_thread_file_stream_locker(&state, file->m_psi,
                                                       PSI_FILE_FLUSH);
@@ -735,13 +734,10 @@ inline_mysql_file_fstat(
 #ifdef HAVE_PSI_FILE_INTERFACE
   struct PSI_file_locker *locker= NULL;
   PSI_file_locker_state state;
-  if (likely(PSI_server != NULL))
-  {
-    locker= PSI_server->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);
-  }
+  locker= PSI_server->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);
 #endif
   result= my_fstat(filenr, stat_area, flags);
 #ifdef HAVE_PSI_FILE_INTERFACE
@@ -762,14 +758,11 @@ inline_mysql_file_stat(
 #ifdef HAVE_PSI_FILE_INTERFACE
   struct PSI_file_locker *locker= NULL;
   PSI_file_locker_state state;
-  if (likely(PSI_server != NULL))
-  {
-    locker= PSI_server->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);
-  }
+  locker= PSI_server->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);
 #endif
   result= my_stat(path, stat_area, flags);
 #ifdef HAVE_PSI_FILE_INTERFACE
@@ -790,14 +783,11 @@ inline_mysql_file_chsize(
 #ifdef HAVE_PSI_FILE_INTERFACE
   struct PSI_file_locker *locker= NULL;
   PSI_file_locker_state state;
-  if (likely(PSI_server != NULL))
-  {
-    locker= PSI_server->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);
-  }
+  locker= PSI_server->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);
 #endif
   result= my_chsize(file, newlength, filler, flags);
 #ifdef HAVE_PSI_FILE_INTERFACE
@@ -823,14 +813,11 @@ inline_mysql_file_fopen(
 #ifdef HAVE_PSI_FILE_INTERFACE
       struct PSI_file_locker *locker= NULL;
       PSI_file_locker_state state;
-      if (likely(PSI_server != NULL))
-      {
-        locker= PSI_server->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);
-      }
+      locker= PSI_server->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);
 #endif
       that->m_file= my_fopen(filename, flags, myFlags);
 #ifdef HAVE_PSI_FILE_INTERFACE
@@ -861,7 +848,7 @@ inline_mysql_file_fclose(
     struct PSI_file_locker *locker= NULL;
     PSI_file_locker_state state;
     DBUG_ASSERT(file != NULL);
-    if (likely(PSI_server && file->m_psi))
+    if (likely(file->m_psi != NULL))
     {
       locker= PSI_server->get_thread_file_stream_locker(&state, file->m_psi,
                                                         PSI_FILE_STREAM_CLOSE);
@@ -890,7 +877,7 @@ inline_mysql_file_fread(
 #ifdef HAVE_PSI_FILE_INTERFACE
   struct PSI_file_locker *locker= NULL;
   PSI_file_locker_state state;
-  if (likely(PSI_server && file->m_psi))
+  if (likely(file->m_psi != NULL))
   {
     locker= PSI_server->get_thread_file_stream_locker(&state, file->m_psi,
                                                       PSI_FILE_READ);
@@ -924,7 +911,7 @@ inline_mysql_file_fwrite(
 #ifdef HAVE_PSI_FILE_INTERFACE
   struct PSI_file_locker *locker= NULL;
   PSI_file_locker_state state;
-  if (likely(PSI_server && file->m_psi))
+  if (likely(file->m_psi != NULL))
   {
     locker= PSI_server->get_thread_file_stream_locker(&state, file->m_psi,
                                                       PSI_FILE_WRITE);
@@ -958,7 +945,7 @@ inline_mysql_file_fseek(
 #ifdef HAVE_PSI_FILE_INTERFACE
   struct PSI_file_locker *locker= NULL;
   PSI_file_locker_state state;
-  if (likely(PSI_server && file->m_psi))
+  if (likely(file->m_psi != NULL))
   {
     locker= PSI_server->get_thread_file_stream_locker(&state, file->m_psi,
                                                       PSI_FILE_SEEK);
@@ -985,7 +972,7 @@ inline_mysql_file_ftell(
 #ifdef HAVE_PSI_FILE_INTERFACE
   struct PSI_file_locker *locker= NULL;
   PSI_file_locker_state state;
-  if (likely(PSI_server && file->m_psi))
+  if (likely(file->m_psi != NULL))
   {
     locker= PSI_server->get_thread_file_stream_locker(&state, file->m_psi,
                                                       PSI_FILE_TELL);
@@ -1012,13 +999,10 @@ inline_mysql_file_create(
 #ifdef HAVE_PSI_FILE_INTERFACE
   struct PSI_file_locker *locker= NULL;
   PSI_file_locker_state state;
-  if (likely(PSI_server != NULL))
-  {
-    locker= PSI_server->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);
-  }
+  locker= PSI_server->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);
 #endif
   file= my_create(filename, create_flags, access_flags, myFlags);
 #ifdef HAVE_PSI_FILE_INTERFACE
@@ -1043,8 +1027,7 @@ inline_mysql_file_create_temp(
   */
   file= create_temp_file(to, dir, pfx, mode, myFlags);
 #ifdef HAVE_PSI_FILE_INTERFACE
-  if (likely(PSI_server != NULL))
-    PSI_server->create_file(key, to, file);
+  PSI_server->create_file(key, to, file);
 #endif
   return file;
 }
@@ -1060,13 +1043,10 @@ inline_mysql_file_open(
 #ifdef HAVE_PSI_FILE_INTERFACE
   struct PSI_file_locker *locker= NULL;
   PSI_file_locker_state state;
-  if (likely(PSI_server != NULL))
-  {
-    locker= PSI_server->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);
-  }
+  locker= PSI_server->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);
 #endif
   file= my_open(filename, flags, myFlags);
 #ifdef HAVE_PSI_FILE_INTERFACE
@@ -1087,13 +1067,10 @@ inline_mysql_file_close(
 #ifdef HAVE_PSI_FILE_INTERFACE
   struct PSI_file_locker *locker= NULL;
   PSI_file_locker_state state;
-  if (likely(PSI_server != NULL))
-  {
-    locker= PSI_server->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);
-  }
+  locker= PSI_server->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);
 #endif
   result= my_close(file, flags);
 #ifdef HAVE_PSI_FILE_INTERFACE
@@ -1114,13 +1091,10 @@ inline_mysql_file_read(
 #ifdef HAVE_PSI_FILE_INTERFACE
   struct PSI_file_locker *locker= NULL;
   PSI_file_locker_state state;
-  if (likely(PSI_server != NULL))
-  {
-    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);
-  }
+  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
@@ -1148,13 +1122,10 @@ inline_mysql_file_write(
 #ifdef HAVE_PSI_FILE_INTERFACE
   struct PSI_file_locker *locker= NULL;
   PSI_file_locker_state state;
-  if (likely(PSI_server != NULL))
-  {
-    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);
-  }
+  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
@@ -1182,12 +1153,9 @@ inline_mysql_file_pread(
 #ifdef HAVE_PSI_FILE_INTERFACE
   struct PSI_file_locker *locker= NULL;
   PSI_file_locker_state state;
-  if (likely(PSI_server != NULL))
-  {
-    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);
-  }
+  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
@@ -1215,13 +1183,10 @@ inline_mysql_file_pwrite(
 #ifdef HAVE_PSI_FILE_INTERFACE
   struct PSI_file_locker *locker= NULL;
   PSI_file_locker_state state;
-  if (likely(PSI_server != NULL))
-  {
-    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);
-  }
+  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
@@ -1249,12 +1214,9 @@ inline_mysql_file_seek(
 #ifdef HAVE_PSI_FILE_INTERFACE
   struct PSI_file_locker *locker= NULL;
   PSI_file_locker_state state;
-  if (likely(PSI_server != NULL))
-  {
-    locker= PSI_server->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);
-  }
+  locker= PSI_server->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);
 #endif
   result= my_seek(file, pos, whence, flags);
 #ifdef HAVE_PSI_FILE_INTERFACE
@@ -1275,12 +1237,9 @@ inline_mysql_file_tell(
 #ifdef HAVE_PSI_FILE_INTERFACE
   struct PSI_file_locker *locker= NULL;
   PSI_file_locker_state state;
-  if (likely(PSI_server != NULL))
-  {
-    locker= PSI_server->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);
-  }
+  locker= PSI_server->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);
 #endif
   result= my_tell(file, flags);
 #ifdef HAVE_PSI_FILE_INTERFACE
@@ -1301,13 +1260,10 @@ inline_mysql_file_delete(
 #ifdef HAVE_PSI_FILE_INTERFACE
   struct PSI_file_locker *locker= NULL;
   PSI_file_locker_state state;
-  if (likely(PSI_server != NULL))
-  {
-    locker= PSI_server->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);
-  }
+  locker= PSI_server->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);
 #endif
   result= my_delete(name, flags);
 #ifdef HAVE_PSI_FILE_INTERFACE
@@ -1328,13 +1284,10 @@ inline_mysql_file_rename(
 #ifdef HAVE_PSI_FILE_INTERFACE
   struct PSI_file_locker *locker= NULL;
   PSI_file_locker_state state;
-  if (likely(PSI_server != NULL))
-  {
-    locker= PSI_server->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);
-  }
+  locker= PSI_server->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);
 #endif
   result= my_rename(from, to, flags);
 #ifdef HAVE_PSI_FILE_INTERFACE
@@ -1356,13 +1309,10 @@ inline_mysql_file_create_with_symlink(
 #ifdef HAVE_PSI_FILE_INTERFACE
   struct PSI_file_locker *locker= NULL;
   PSI_file_locker_state state;
-  if (likely(PSI_server != NULL))
-  {
-    locker= PSI_server->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);
-  }
+  locker= PSI_server->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);
 #endif
   file= my_create_with_symlink(linkname, filename, create_flags, access_flags,
                                flags);
@@ -1384,13 +1334,10 @@ inline_mysql_file_delete_with_symlink(
 #ifdef HAVE_PSI_FILE_INTERFACE
   struct PSI_file_locker *locker= NULL;
   PSI_file_locker_state state;
-  if (likely(PSI_server != NULL))
-  {
-    locker= PSI_server->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);
-  }
+  locker= PSI_server->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);
 #endif
   result= my_delete_with_symlink(name, flags);
 #ifdef HAVE_PSI_FILE_INTERFACE
@@ -1411,13 +1358,10 @@ inline_mysql_file_rename_with_symlink(
 #ifdef HAVE_PSI_FILE_INTERFACE
   struct PSI_file_locker *locker= NULL;
   PSI_file_locker_state state;
-  if (likely(PSI_server != NULL))
-  {
-    locker= PSI_server->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);
-  }
+  locker= PSI_server->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);
 #endif
   result= my_rename_with_symlink(from, to, flags);
 #ifdef HAVE_PSI_FILE_INTERFACE
@@ -1438,12 +1382,9 @@ inline_mysql_file_sync(
 #ifdef HAVE_PSI_FILE_INTERFACE
   struct PSI_file_locker *locker= NULL;
   PSI_file_locker_state state;
-  if (likely(PSI_server != NULL))
-  {
-    locker= PSI_server->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);
-  }
+  locker= PSI_server->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);
 #endif
   result= my_sync(fd, flags);
 #ifdef HAVE_PSI_FILE_INTERFACE

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

=== modified file 'include/mysql/psi/mysql_statement.h'
--- a/include/mysql/psi/mysql_statement.h	2011-04-19 03:29:06 +0000
+++ b/include/mysql/psi/mysql_statement.h	2011-05-03 23:49:32 +0000
@@ -101,8 +101,7 @@
 static inline void inline_mysql_statement_register(
   const char *category, PSI_statement_info *info, int count)
 {
-  if (likely(PSI_server != NULL))
-    PSI_server->register_statement(category, info, count);
+  PSI_server->register_statement(category, info, count);
 }
 
 static inline struct PSI_statement_locker *
@@ -112,12 +111,9 @@ inline_mysql_start_statement(PSI_stateme
                              const char *src_file, int src_line)
 {
   PSI_statement_locker *locker= NULL;
-  if (likely(PSI_server != NULL))
-  {
-    locker= PSI_server->get_thread_statement_locker(state, key);
-    if (likely(locker != NULL))
-      PSI_server->start_statement(locker, db, db_len, src_file, src_line);
-  }
+  locker= PSI_server->get_thread_statement_locker(state, key);
+  if (likely(locker != NULL))
+    PSI_server->start_statement(locker, db, db_len, src_file, src_line);
   return locker;
 }
 
@@ -125,7 +121,7 @@ static inline struct PSI_statement_locke
 inline_mysql_refine_statement(PSI_statement_locker *locker,
                               PSI_statement_key key)
 {
-  if (likely(PSI_server && locker))
+  if (likely(locker != NULL))
   {
     locker= PSI_server->refine_statement(locker, key);
   }
@@ -136,7 +132,7 @@ static inline void
 inline_mysql_set_statement_text(PSI_statement_locker *locker,
                                 const char *text, uint text_len)
 {
-  if (likely(PSI_server && locker))
+  if (likely(locker != NULL))
   {
     PSI_server->set_statement_text(locker, text, text_len);
   }
@@ -146,7 +142,7 @@ static inline void
 inline_mysql_set_statement_lock_time(PSI_statement_locker *locker,
                                      ulonglong count)
 {
-  if (likely(PSI_server && locker))
+  if (likely(locker != NULL))
   {
     PSI_server->set_statement_lock_time(locker, count);
   }
@@ -156,7 +152,7 @@ static inline void
 inline_mysql_set_statement_rows_sent(PSI_statement_locker *locker,
                                      ulonglong count)
 {
-  if (likely(PSI_server && locker))
+  if (likely(locker != NULL))
   {
     PSI_server->set_statement_rows_sent(locker, count);
   }
@@ -166,7 +162,7 @@ static inline void
 inline_mysql_set_statement_rows_examined(PSI_statement_locker *locker,
                                          ulonglong count)
 {
-  if (likely(PSI_server && locker))
+  if (likely(locker != NULL))
   {
     PSI_server->set_statement_rows_examined(locker, count);
   }
@@ -176,12 +172,9 @@ static inline void
 inline_mysql_end_statement(struct PSI_statement_locker *locker,
                            Diagnostics_area *stmt_da)
 {
-  if (likely(PSI_server != NULL))
-  {
-    PSI_server->end_stage();
-    if (likely(locker != NULL))
-      PSI_server->end_statement(locker, stmt_da);
-  }
+  PSI_server->end_stage();
+  if (likely(locker != NULL))
+    PSI_server->end_statement(locker, stmt_da);
 }
 #endif
 

=== modified file 'include/mysql/psi/mysql_table.h'
--- a/include/mysql/psi/mysql_table.h	2011-04-19 03:29:06 +0000
+++ b/include/mysql/psi/mysql_table.h	2011-05-03 23:49:32 +0000
@@ -98,7 +98,7 @@ inline_mysql_start_table_io_wait(PSI_tab
                                  const char *src_file, int src_line)
 {
   struct PSI_table_locker *locker= NULL;
-  if (likely(PSI_server && psi))
+  if (likely(psi != NULL))
   {
     locker= PSI_server->get_thread_table_io_locker(state, psi, op, index);
     if (likely(locker != NULL))
@@ -166,7 +166,7 @@ inline_mysql_start_table_lock_wait(PSI_t
                                    ulong flags, const char *src_file, int src_line)
 {
   struct PSI_table_locker *locker= NULL;
-  if (likely(PSI_server && psi))
+  if (likely(psi != NULL))
   {
     locker= PSI_server->get_thread_table_lock_locker(state, psi, op, flags);
     if (likely(locker != NULL))

=== modified file 'include/mysql/psi/mysql_thread.h'
--- a/include/mysql/psi/mysql_thread.h	2011-04-28 08:46:34 +0000
+++ b/include/mysql/psi/mysql_thread.h	2011-05-03 23:49:32 +0000
@@ -588,8 +588,7 @@ static inline void inline_mysql_mutex_re
 )
 {
 #ifdef HAVE_PSI_MUTEX_INTERFACE
-  if (likely(PSI_server != NULL))
-    PSI_server->register_mutex(category, info, count);
+  PSI_server->register_mutex(category, info, count);
 #endif
 }
 
@@ -605,8 +604,7 @@ static inline int inline_mysql_mutex_ini
   )
 {
 #ifdef HAVE_PSI_MUTEX_INTERFACE
-  that->m_psi= PSI_server ? PSI_server->init_mutex(key, &that->m_mutex)
-                          : NULL;
+  that->m_psi= PSI_server->init_mutex(key, &that->m_mutex);
 #else
   that->m_psi= NULL;
 #endif
@@ -625,7 +623,7 @@ static inline int inline_mysql_mutex_des
   )
 {
 #ifdef HAVE_PSI_MUTEX_INTERFACE
-  if (likely(PSI_server && that->m_psi))
+  if (likely(that->m_psi != NULL))
   {
     PSI_server->destroy_mutex(that->m_psi);
     that->m_psi= NULL;
@@ -649,7 +647,7 @@ static inline int inline_mysql_mutex_loc
 #ifdef HAVE_PSI_MUTEX_INTERFACE
   struct PSI_mutex_locker *locker= NULL;
   PSI_mutex_locker_state state;
-  if (likely(PSI_server && that->m_psi))
+  if (likely(that->m_psi != NULL))
   {
     locker= PSI_server->get_thread_mutex_locker(&state, that->m_psi, PSI_MUTEX_LOCK);
     if (likely(locker != NULL))
@@ -679,7 +677,7 @@ static inline int inline_mysql_mutex_try
 #ifdef HAVE_PSI_MUTEX_INTERFACE
   struct PSI_mutex_locker *locker= NULL;
   PSI_mutex_locker_state state;
-  if (likely(PSI_server && that->m_psi))
+  if (likely(that->m_psi != NULL))
   {
     locker= PSI_server->get_thread_mutex_locker(&state, that->m_psi, PSI_MUTEX_TRYLOCK);
     if (likely(locker != NULL))
@@ -707,7 +705,7 @@ static inline int inline_mysql_mutex_unl
 {
   int result;
 #ifdef HAVE_PSI_MUTEX_INTERFACE
-  if (likely(PSI_server && that->m_psi))
+  if (likely(that->m_psi != NULL))
     PSI_server->unlock_mutex(that->m_psi);
 #endif
 #ifdef SAFE_MUTEX
@@ -731,8 +729,7 @@ static inline void inline_mysql_rwlock_r
 )
 {
 #ifdef HAVE_PSI_RWLOCK_INTERFACE
-  if (likely(PSI_server != NULL))
-    PSI_server->register_rwlock(category, info, count);
+  PSI_server->register_rwlock(category, info, count);
 #endif
 }
 
@@ -743,8 +740,7 @@ static inline int inline_mysql_rwlock_in
   mysql_rwlock_t *that)
 {
 #ifdef HAVE_PSI_RWLOCK_INTERFACE
-  that->m_psi= (PSI_server ? PSI_server->init_rwlock(key, &that->m_rwlock)
-                           : NULL);
+  that->m_psi= PSI_server->init_rwlock(key, &that->m_rwlock);
 #else
   that->m_psi= NULL;
 #endif
@@ -762,8 +758,7 @@ static inline int inline_mysql_prlock_in
   mysql_prlock_t *that)
 {
 #ifdef HAVE_PSI_RWLOCK_INTERFACE
-  that->m_psi= (PSI_server ? PSI_server->init_rwlock(key, &that->m_prlock)
-                           : NULL);
+  that->m_psi= PSI_server->init_rwlock(key, &that->m_prlock);
 #else
   that->m_psi= NULL;
 #endif
@@ -775,7 +770,7 @@ static inline int inline_mysql_rwlock_de
   mysql_rwlock_t *that)
 {
 #ifdef HAVE_PSI_RWLOCK_INTERFACE
-  if (likely(PSI_server && that->m_psi))
+  if (likely(that->m_psi != NULL))
   {
     PSI_server->destroy_rwlock(that->m_psi);
     that->m_psi= NULL;
@@ -789,7 +784,7 @@ static inline int inline_mysql_prlock_de
   mysql_prlock_t *that)
 {
 #ifdef HAVE_PSI_RWLOCK_INTERFACE
-  if (likely(PSI_server && that->m_psi))
+  if (likely(that->m_psi != NULL))
   {
     PSI_server->destroy_rwlock(that->m_psi);
     that->m_psi= NULL;
@@ -810,7 +805,7 @@ static inline int inline_mysql_rwlock_rd
 #ifdef HAVE_PSI_RWLOCK_INTERFACE
   struct PSI_rwlock_locker *locker= NULL;
   PSI_rwlock_locker_state state;
-  if (likely(PSI_server && that->m_psi))
+  if (likely(that->m_psi != NULL))
   {
     locker= PSI_server->get_thread_rwlock_locker(&state, that->m_psi,
                                                  PSI_RWLOCK_READLOCK);
@@ -838,7 +833,7 @@ static inline int inline_mysql_prlock_rd
 #ifdef HAVE_PSI_RWLOCK_INTERFACE
   struct PSI_rwlock_locker *locker= NULL;
   PSI_rwlock_locker_state state;
-  if (likely(PSI_server && that->m_psi))
+  if (likely(that->m_psi != NULL))
   {
     locker= PSI_server->get_thread_rwlock_locker(&state, that->m_psi,
                                                  PSI_RWLOCK_READLOCK);
@@ -866,7 +861,7 @@ static inline int inline_mysql_rwlock_wr
 #ifdef HAVE_PSI_RWLOCK_INTERFACE
   struct PSI_rwlock_locker *locker= NULL;
   PSI_rwlock_locker_state state;
-  if (likely(PSI_server && that->m_psi))
+  if (likely(that->m_psi != NULL))
   {
     locker= PSI_server->get_thread_rwlock_locker(&state, that->m_psi,
                                                  PSI_RWLOCK_WRITELOCK);
@@ -894,7 +889,7 @@ static inline int inline_mysql_prlock_wr
 #ifdef HAVE_PSI_RWLOCK_INTERFACE
   struct PSI_rwlock_locker *locker= NULL;
   PSI_rwlock_locker_state state;
-  if (likely(PSI_server && that->m_psi))
+  if (likely(that->m_psi != NULL))
   {
     locker= PSI_server->get_thread_rwlock_locker(&state, that->m_psi,
                                                  PSI_RWLOCK_WRITELOCK);
@@ -922,7 +917,7 @@ static inline int inline_mysql_rwlock_tr
 #ifdef HAVE_PSI_RWLOCK_INTERFACE
   struct PSI_rwlock_locker *locker= NULL;
   PSI_rwlock_locker_state state;
-  if (likely(PSI_server && that->m_psi))
+  if (likely(that->m_psi != NULL))
   {
     locker= PSI_server->get_thread_rwlock_locker(&state, that->m_psi,
                                                  PSI_RWLOCK_TRYREADLOCK);
@@ -949,7 +944,7 @@ static inline int inline_mysql_rwlock_tr
 #ifdef HAVE_PSI_RWLOCK_INTERFACE
   struct PSI_rwlock_locker *locker= NULL;
   PSI_rwlock_locker_state state;
-  if (likely(PSI_server && that->m_psi))
+  if (likely(that->m_psi != NULL))
   {
     locker= PSI_server->get_thread_rwlock_locker(&state, that->m_psi,
                                                  PSI_RWLOCK_TRYWRITELOCK);
@@ -970,7 +965,7 @@ static inline int inline_mysql_rwlock_un
 {
   int result;
 #ifdef HAVE_PSI_RWLOCK_INTERFACE
-  if (likely(PSI_server && that->m_psi))
+  if (likely(that->m_psi != NULL))
     PSI_server->unlock_rwlock(that->m_psi);
 #endif
   result= rw_unlock(&that->m_rwlock);
@@ -983,7 +978,7 @@ static inline int inline_mysql_prlock_un
 {
   int result;
 #ifdef HAVE_PSI_RWLOCK_INTERFACE
-  if (likely(PSI_server && that->m_psi))
+  if (likely(that->m_psi != NULL))
     PSI_server->unlock_rwlock(that->m_psi);
 #endif
   result= rw_pr_unlock(&that->m_prlock);
@@ -1004,8 +999,7 @@ static inline void inline_mysql_cond_reg
 )
 {
 #ifdef HAVE_PSI_COND_INTERFACE
-  if (likely(PSI_server != NULL))
-    PSI_server->register_cond(category, info, count);
+  PSI_server->register_cond(category, info, count);
 #endif
 }
 
@@ -1017,8 +1011,7 @@ static inline int inline_mysql_cond_init
   const pthread_condattr_t *attr)
 {
 #ifdef HAVE_PSI_COND_INTERFACE
-  that->m_psi= (PSI_server ? PSI_server->init_cond(key, &that->m_cond)
-                           : NULL);
+  that->m_psi= PSI_server->init_cond(key, &that->m_cond);
 #else
   that->m_psi= NULL;
 #endif
@@ -1029,7 +1022,7 @@ static inline int inline_mysql_cond_dest
   mysql_cond_t *that)
 {
 #ifdef HAVE_PSI_COND_INTERFACE
-  if (likely(PSI_server && that->m_psi))
+  if (likely(that->m_psi != NULL))
   {
     PSI_server->destroy_cond(that->m_psi);
     that->m_psi= NULL;
@@ -1050,7 +1043,7 @@ static inline int inline_mysql_cond_wait
 #ifdef HAVE_PSI_COND_INTERFACE
   struct PSI_cond_locker *locker= NULL;
   PSI_cond_locker_state state;
-  if (likely(PSI_server && that->m_psi))
+  if (likely(that->m_psi != NULL))
   {
     locker= PSI_server->get_thread_cond_locker(&state, that->m_psi, mutex->m_psi,
                                                PSI_COND_WAIT);
@@ -1079,7 +1072,7 @@ static inline int inline_mysql_cond_time
 #ifdef HAVE_PSI_COND_INTERFACE
   struct PSI_cond_locker *locker= NULL;
   PSI_cond_locker_state state;
-  if (likely(PSI_server && that->m_psi))
+  if (likely(that->m_psi != NULL))
   {
     locker= PSI_server->get_thread_cond_locker(&state, that->m_psi, mutex->m_psi,
                                                PSI_COND_TIMEDWAIT);
@@ -1100,7 +1093,7 @@ static inline int inline_mysql_cond_sign
 {
   int result;
 #ifdef HAVE_PSI_COND_INTERFACE
-  if (likely(PSI_server && that->m_psi))
+  if (likely(that->m_psi != NULL))
     PSI_server->signal_cond(that->m_psi);
 #endif
   result= pthread_cond_signal(&that->m_cond);
@@ -1112,7 +1105,7 @@ static inline int inline_mysql_cond_broa
 {
   int result;
 #ifdef HAVE_PSI_COND_INTERFACE
-  if (likely(PSI_server && that->m_psi))
+  if (likely(that->m_psi != NULL))
     PSI_server->broadcast_cond(that->m_psi);
 #endif
   result= pthread_cond_broadcast(&that->m_cond);
@@ -1132,8 +1125,7 @@ static inline void inline_mysql_thread_r
 )
 {
 #ifdef HAVE_PSI_THREAD_INTERFACE
-  if (likely(PSI_server != NULL))
-    PSI_server->register_thread(category, info, count);
+  PSI_server->register_thread(category, info, count);
 #endif
 }
 
@@ -1144,21 +1136,15 @@ static inline int inline_mysql_thread_cr
   void *(*start_routine)(void*), void *arg)
 {
   int result;
-  if (likely(PSI_server != NULL))
-    result= PSI_server->spawn_thread(key, thread, attr, start_routine, arg);
-  else
-    result= pthread_create(thread, attr, start_routine, arg);
+  result= PSI_server->spawn_thread(key, thread, attr, start_routine, arg);
   return result;
 }
 
 static inline void inline_mysql_thread_set_psi_id(ulong id)
 {
-  if (likely(PSI_server != NULL))
-  {
-    struct PSI_thread *psi= PSI_server->get_thread();
-    if (likely(psi != NULL))
-      PSI_server->set_thread_id(psi, id);
-  }
+  struct PSI_thread *psi= PSI_server->get_thread();
+  if (likely(psi != NULL))
+    PSI_server->set_thread_id(psi, id);
 }
 #endif
 

=== modified file 'mysys/CMakeLists.txt'
--- a/mysys/CMakeLists.txt	2011-03-29 12:56:34 +0000
+++ b/mysys/CMakeLists.txt	2011-05-03 23:49:32 +0000
@@ -34,7 +34,7 @@ SET(MYSYS_SOURCES  array.c charset-def.c
 				thr_rwlock.c tree.c typelib.c base64.c my_memmem.c my_getpagesize.c
 				lf_alloc-pin.c lf_dynarray.c lf_hash.c
 				my_atomic.c my_getncpus.c
-				my_rdtsc.c waiting_threads.c)
+				my_rdtsc.c waiting_threads.c psi_noop.cc)
 
 IF (WIN32)
  SET (MYSYS_SOURCES ${MYSYS_SOURCES} my_winthread.c my_wincond.c my_winerr.c my_winfile.c my_windac.c my_conio.c)

=== modified file 'mysys/my_static.c'
--- a/mysys/my_static.c	2011-01-11 09:09:21 +0000
+++ b/mysys/my_static.c	2011-05-03 23:49:32 +0000
@@ -106,30 +106,3 @@ my_bool my_disable_async_io=0;
 my_bool my_disable_flush_key_blocks=0;
 my_bool my_disable_symlinks=0;
 
-/*
-  Note that PSI_hook and PSI_server are unconditionally
-  (no ifdef HAVE_PSI_INTERFACE) defined.
-  This is to ensure binary compatibility between the server and plugins,
-  in the case when:
-  - the server is not compiled with HAVE_PSI_INTERFACE
-  - a plugin is compiled with HAVE_PSI_INTERFACE
-  See the doxygen documentation for the performance schema.
-*/
-
-/**
-  Hook for the instrumentation interface.
-  Code implementing the instrumentation interface should register here.
-*/
-struct PSI_bootstrap *PSI_hook= NULL;
-
-/**
-  Instance of the instrumentation interface for the MySQL server.
-  @todo This is currently a global variable, which is handy when
-  compiling instrumented code that is bundled with the server.
-  When dynamic plugin are truly supported, this variable will need
-  to be replaced by a macro, so that each XYZ plugin can have it's own
-  xyz_psi_server variable, obtained from PSI_bootstrap::get_interface()
-  with the version used at compile time for plugin XYZ.
-*/
-PSI *PSI_server= NULL;
-

=== added file 'mysys/psi_noop.cc'
--- a/mysys/psi_noop.cc	1970-01-01 00:00:00 +0000
+++ b/mysys/psi_noop.cc	2011-05-03 23:49:32 +0000
@@ -0,0 +1,635 @@
+/* Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved.
+
+  This program is free software; you can redistribute it and/or modify
+  it under the terms of the GNU General Public License as published by
+  the Free Software Foundation; version 2 of the License.
+
+  This program is distributed in the hope that it will be useful,
+  but WITHOUT ANY WARRANTY; without even the implied warranty of
+  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+  GNU General Public License for more details.
+
+  You should have received a copy of the GNU General Public License
+  along with this program; if not, write to the Free Software Foundation,
+  51 Franklin Street, Suite 500, Boston, MA 02110-1335 USA */
+
+#include "my_global.h"
+#include "mysql/psi/psi.h"
+
+#ifdef HAVE_PSI_INTERFACE
+
+static void register_mutex_noop(const char *category,
+                                PSI_mutex_info *info,
+                                int count)
+{
+  return;
+}
+
+static void register_rwlock_noop(const char *category,
+                                 PSI_rwlock_info *info,
+                                 int count)
+{
+  return;
+}
+
+static void register_cond_noop(const char *category,
+                               PSI_cond_info *info,
+                               int count)
+{
+  return;
+}
+
+static void register_thread_noop(const char *category,
+                                 PSI_thread_info *info,
+                                 int count)
+{
+  return;
+}
+
+static void register_file_noop(const char *category,
+                               PSI_file_info *info,
+                               int count)
+{
+  return;
+}
+
+static void register_stage_noop(const char *category,
+                                PSI_stage_info **info_array,
+                                int count)
+{
+  return;
+}
+
+static void register_statement_noop(const char *category,
+                                    PSI_statement_info *info,
+                                    int count)
+{
+  return;
+}
+
+static PSI_mutex*
+init_mutex_noop(PSI_mutex_key key, const void *identity)
+{
+  return NULL;
+}
+
+static void destroy_mutex_noop(PSI_mutex* mutex)
+{
+  return;
+}
+
+static PSI_rwlock*
+init_rwlock_noop(PSI_rwlock_key key, const void *identity)
+{
+  return NULL;
+}
+
+static void destroy_rwlock_noop(PSI_rwlock* rwlock)
+{
+  return;
+}
+
+static PSI_cond*
+init_cond_noop(PSI_cond_key key, const void *identity)
+{
+  return NULL;
+}
+
+static void destroy_cond_noop(PSI_cond* cond)
+{
+  return;
+}
+
+static PSI_table_share*
+get_table_share_noop(my_bool temporary, TABLE_SHARE *share)
+{
+  return NULL;
+}
+
+static void release_table_share_noop(PSI_table_share* share)
+{
+  return;
+}
+
+static void
+drop_table_share_noop(const char *schema_name, int schema_name_length,
+                    const char *table_name, int table_name_length)
+{
+  return;
+}
+
+static PSI_table*
+open_table_noop(PSI_table_share *share, const void *identity)
+{
+  return NULL;
+}
+
+static void close_table_noop(PSI_table *table)
+{
+  return;
+}
+
+static void create_file_noop(PSI_file_key key, const char *name, File file)
+{
+  return;
+}
+
+static int spawn_thread_noop(PSI_thread_key key,
+                             pthread_t *thread, const pthread_attr_t *attr,
+                             void *(*start_routine)(void*), void *arg)
+{
+  return pthread_create(thread, attr, start_routine, arg);
+}
+
+static PSI_thread*
+new_thread_noop(PSI_thread_key key, const void *identity, ulong thread_id)
+{
+  return NULL;
+}
+
+static void set_thread_id_noop(PSI_thread *thread, unsigned long id)
+{
+  return;
+}
+
+static PSI_thread*
+get_thread_noop(void)
+{
+  return NULL;
+}
+
+static void set_thread_user_noop(const char *user, int user_len)
+{
+  return;
+}
+
+static void set_thread_user_host_noop(const char *user, int user_len,
+                                    const char *host, int host_len)
+{
+  return;
+}
+
+static void set_thread_db_noop(const char* db, int db_len)
+{
+  return;
+}
+
+static void set_thread_command_noop(int command)
+{
+  return;
+}
+
+static void set_thread_start_time_noop(time_t start_time)
+{
+  return;
+}
+
+static void set_thread_state_noop(const char* state)
+{
+  return;
+}
+
+static void set_thread_info_noop(const char* info, int info_len)
+{
+  return;
+}
+
+static void set_thread_noop(PSI_thread* thread)
+{
+  return;
+}
+
+static void delete_current_thread_noop(void)
+{
+  return;
+}
+
+static void delete_thread_noop(PSI_thread *thread)
+{
+  return;
+}
+
+static PSI_mutex_locker*
+get_thread_mutex_locker_noop(PSI_mutex_locker_state *state,
+                           PSI_mutex *mutex, PSI_mutex_operation op)
+{
+  return NULL;
+}
+
+static PSI_rwlock_locker*
+get_thread_rwlock_locker_noop(PSI_rwlock_locker_state *state,
+                            PSI_rwlock *rwlock, PSI_rwlock_operation op)
+{
+  return NULL;
+}
+
+static PSI_cond_locker*
+get_thread_cond_locker_noop(PSI_cond_locker_state *state,
+                          PSI_cond *cond, PSI_mutex *mutex,
+                          PSI_cond_operation op)
+{
+  return NULL;
+}
+
+static PSI_table_locker*
+get_thread_table_io_locker_noop(PSI_table_locker_state *state,
+                              PSI_table *table, PSI_table_io_operation op, uint index)
+{
+  return NULL;
+}
+
+static PSI_table_locker*
+get_thread_table_lock_locker_noop(PSI_table_locker_state *state,
+                                PSI_table *table, PSI_table_lock_operation op, ulong op_flags)
+{
+  return NULL;
+}
+
+static PSI_file_locker*
+get_thread_file_name_locker_noop(PSI_file_locker_state *state,
+                               PSI_file_key key,
+                               PSI_file_operation op,
+                               const char *name, const void *identity)
+{
+  return NULL;
+}
+
+static PSI_file_locker*
+get_thread_file_stream_locker_noop(PSI_file_locker_state *state,
+                                 PSI_file *file, PSI_file_operation op)
+{
+  return NULL;
+}
+
+
+static PSI_file_locker*
+get_thread_file_descriptor_locker_noop(PSI_file_locker_state *state,
+                                     File file, PSI_file_operation op)
+{
+  return NULL;
+}
+
+static void unlock_mutex_noop(PSI_mutex *mutex)
+{
+  return;
+}
+
+static void unlock_rwlock_noop(PSI_rwlock *rwlock)
+{
+  return;
+}
+
+static void signal_cond_noop(PSI_cond* cond)
+{
+  return;
+}
+
+static void broadcast_cond_noop(PSI_cond* cond)
+{
+  return;
+}
+
+static void start_mutex_wait_noop(PSI_mutex_locker* locker,
+                                const char *src_file, uint src_line)
+{
+  return;
+}
+
+static void end_mutex_wait_noop(PSI_mutex_locker* locker, int rc)
+{
+  return;
+}
+
+
+static void start_rwlock_rdwait_noop(PSI_rwlock_locker* locker,
+                                   const char *src_file, uint src_line)
+{
+  return;
+}
+
+static void end_rwlock_rdwait_noop(PSI_rwlock_locker* locker, int rc)
+{
+  return;
+}
+
+static void start_rwlock_wrwait_noop(PSI_rwlock_locker* locker,
+                                   const char *src_file, uint src_line)
+{
+  return;
+}
+
+static void end_rwlock_wrwait_noop(PSI_rwlock_locker* locker, int rc)
+{
+  return;
+}
+
+static void start_cond_wait_noop(PSI_cond_locker* locker,
+                               const char *src_file, uint src_line)
+{
+  return;
+}
+
+static void end_cond_wait_noop(PSI_cond_locker* locker, int rc)
+{
+  return;
+}
+
+static void start_table_io_wait_noop(PSI_table_locker* locker,
+                                   const char *src_file, uint src_line)
+{
+  return;
+}
+
+static void end_table_io_wait_noop(PSI_table_locker* locker)
+{
+  return;
+}
+
+static void start_table_lock_wait_noop(PSI_table_locker* locker,
+                                     const char *src_file, uint src_line)
+{
+  return;
+}
+
+static void end_table_lock_wait_noop(PSI_table_locker* locker)
+{
+  return;
+}
+
+static PSI_file* start_file_open_wait_noop(PSI_file_locker *locker,
+                                         const char *src_file,
+                                         uint src_line)
+{
+  return NULL;
+}
+
+static void end_file_open_wait_noop(PSI_file_locker *locker)
+{
+  return;
+}
+
+static void end_file_open_wait_and_bind_to_descriptor_noop
+  (PSI_file_locker *locker, File file)
+{
+  return;
+}
+
+static void start_file_wait_noop(PSI_file_locker *locker,
+                               size_t count,
+                               const char *src_file,
+                               uint src_line)
+{
+  return;
+}
+
+static void end_file_wait_noop(PSI_file_locker *locker,
+                             size_t count)
+{
+  return;
+}
+
+static void start_stage_noop(PSI_stage_key key, const char *src_file, int src_line)
+{
+  return;
+}
+
+static void end_stage_noop()
+{
+  return;
+}
+
+static PSI_statement_locker*
+get_thread_statement_locker_noop(PSI_statement_locker_state *state,
+                               PSI_statement_key key)
+{
+  return NULL;
+}
+
+static PSI_statement_locker*
+refine_statement_noop(PSI_statement_locker *locker,
+                    PSI_statement_key key)
+{
+  return NULL;
+}
+
+static void start_statement_noop(PSI_statement_locker *locker,
+                               const char *db, uint db_len,
+                               const char *src_file, uint src_line)
+{
+  return;
+}
+
+static void set_statement_text_noop(PSI_statement_locker *locker,
+                                  const char *text, uint text_len)
+{
+  return;
+}
+
+static void set_statement_lock_time_noop(PSI_statement_locker *locker,
+                                       ulonglong count)
+{
+  return;
+}
+
+static void set_statement_rows_sent_noop(PSI_statement_locker *locker,
+                                       ulonglong count)
+{
+  return;
+}
+
+static void set_statement_rows_examined_noop(PSI_statement_locker *locker,
+                                           ulonglong count)
+{
+  return;
+}
+
+static void inc_statement_created_tmp_disk_tables_noop(PSI_statement_locker *locker,
+                                                    ulonglong count)
+{
+  return;
+}
+
+static void inc_statement_created_tmp_tables_noop(PSI_statement_locker *locker,
+                                                ulonglong count)
+{
+  return;
+}
+
+static void inc_statement_select_full_join_noop(PSI_statement_locker *locker,
+                                              ulonglong count)
+{
+  return;
+}
+
+static void inc_statement_select_full_range_join_noop(PSI_statement_locker *locker,
+                                                    ulonglong count)
+{
+  return;
+}
+
+static void inc_statement_select_range_noop(PSI_statement_locker *locker,
+                                          ulonglong count)
+{
+  return;
+}
+
+static void inc_statement_select_range_check_noop(PSI_statement_locker *locker,
+                                                ulonglong count)
+{
+  return;
+}
+
+static void inc_statement_select_scan_noop(PSI_statement_locker *locker,
+                                         ulonglong count)
+{
+  return;
+}
+
+static void inc_statement_sort_merge_passes_noop(PSI_statement_locker *locker,
+                                               ulonglong count)
+{
+  return;
+}
+
+static void inc_statement_sort_range_noop(PSI_statement_locker *locker,
+                                        ulonglong count)
+{
+  return;
+}
+
+static void inc_statement_sort_rows_noop(PSI_statement_locker *locker,
+                                       ulonglong count)
+{
+  return;
+}
+
+static void inc_statement_sort_scan_noop(PSI_statement_locker *locker,
+                                       ulonglong count)
+{
+  return;
+}
+
+static void set_statement_no_index_used_noop(PSI_statement_locker *locker)
+{
+  return;
+}
+
+static void set_statement_no_good_index_used_noop(PSI_statement_locker *locker)
+{
+  return;
+}
+
+static void end_statement_noop(PSI_statement_locker *locker, void *stmt_da)
+{
+  return;
+}
+
+static PSI PSI_noop=
+{
+  register_mutex_noop,
+  register_rwlock_noop,
+  register_cond_noop,
+  register_thread_noop,
+  register_file_noop,
+  register_stage_noop,
+  register_statement_noop,
+  init_mutex_noop,
+  destroy_mutex_noop,
+  init_rwlock_noop,
+  destroy_rwlock_noop,
+  init_cond_noop,
+  destroy_cond_noop,
+  get_table_share_noop,
+  release_table_share_noop,
+  drop_table_share_noop,
+  open_table_noop,
+  close_table_noop,
+  create_file_noop,
+  spawn_thread_noop,
+  new_thread_noop,
+  set_thread_id_noop,
+  get_thread_noop,
+  set_thread_user_noop,
+  set_thread_user_host_noop,
+  set_thread_db_noop,
+  set_thread_command_noop,
+  set_thread_start_time_noop,
+  set_thread_state_noop,
+  set_thread_info_noop,
+  set_thread_noop,
+  delete_current_thread_noop,
+  delete_thread_noop,
+  get_thread_mutex_locker_noop,
+  get_thread_rwlock_locker_noop,
+  get_thread_cond_locker_noop,
+  get_thread_table_io_locker_noop,
+  get_thread_table_lock_locker_noop,
+  get_thread_file_name_locker_noop,
+  get_thread_file_stream_locker_noop,
+  get_thread_file_descriptor_locker_noop,
+  unlock_mutex_noop,
+  unlock_rwlock_noop,
+  signal_cond_noop,
+  broadcast_cond_noop,
+  start_mutex_wait_noop,
+  end_mutex_wait_noop,
+  start_rwlock_rdwait_noop,
+  end_rwlock_rdwait_noop,
+  start_rwlock_wrwait_noop,
+  end_rwlock_wrwait_noop,
+  start_cond_wait_noop,
+  end_cond_wait_noop,
+  start_table_io_wait_noop,
+  end_table_io_wait_noop,
+  start_table_lock_wait_noop,
+  end_table_lock_wait_noop,
+  start_file_open_wait_noop,
+  end_file_open_wait_noop,
+  end_file_open_wait_and_bind_to_descriptor_noop,
+  start_file_wait_noop,
+  end_file_wait_noop,
+  start_stage_noop,
+  end_stage_noop,
+  get_thread_statement_locker_noop,
+  refine_statement_noop,
+  start_statement_noop,
+  set_statement_text_noop,
+  set_statement_lock_time_noop,
+  set_statement_rows_sent_noop,
+  set_statement_rows_examined_noop,
+  inc_statement_created_tmp_disk_tables_noop,
+  inc_statement_created_tmp_tables_noop,
+  inc_statement_select_full_join_noop,
+  inc_statement_select_full_range_join_noop,
+  inc_statement_select_range_noop,
+  inc_statement_select_range_check_noop,
+  inc_statement_select_scan_noop,
+  inc_statement_sort_merge_passes_noop,
+  inc_statement_sort_range_noop,
+  inc_statement_sort_rows_noop,
+  inc_statement_sort_scan_noop,
+  set_statement_no_index_used_noop,
+  set_statement_no_good_index_used_noop,
+  end_statement_noop
+};
+#endif
+
+/**
+  Hook for the instrumentation interface.
+  Code implementing the instrumentation interface should register here.
+*/
+struct PSI_bootstrap *PSI_hook= NULL;
+
+/**
+  Instance of the instrumentation interface for the MySQL server.
+  @todo This is currently a global variable, which is handy when
+  compiling instrumented code that is bundled with the server.
+  When dynamic plugin are truly supported, this variable will need
+  to be replaced by a macro, so that each XYZ plugin can have it's own
+  xyz_psi_server variable, obtained from PSI_bootstrap::get_interface()
+  with the version used at compile time for plugin XYZ.
+*/
+PSI *PSI_server= & PSI_noop;
+
+
+

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