List:Commits« Previous MessageNext Message »
From:Christopher Powers Date:February 12 2011 12:23am
Subject:bzr push into mysql-trunk-wl5379 branch (chris.powers:3227 to 3229) WL#4896
View as plain text  
 3229 cpowers	2011-02-11
      WL#4896 "Performance Schema Net IO"
      
      - Corrected assignment of object_instance_begin field
      - Added VIEW_SOCKET to events_waits_summary_by_thread_by_event_name
      - Added VIEW_SOCKET to events_waits_summary_global_by_event_name
      - Fixed conditions to invoke set_socket_info() in mysql_socket.h

    modified:
      include/mysql/psi/mysql_socket.h
      storage/perfschema/pfs.cc
      storage/perfschema/pfs_instr.cc
      storage/perfschema/table_ews_by_thread_by_event_name.cc
      storage/perfschema/table_ews_global_by_event_name.cc
      storage/perfschema/table_ews_global_by_event_name.h
      storage/perfschema/table_socket_instances.cc
 3228 cpowers	2011-02-11
      WL#4896 "Performance Schema Net IO"
      
      - Adjusted socket_instances table definition 
      - Fixed copy/paste bug in setup_instruments

    modified:
      scripts/mysql_system_tables.sql
      storage/perfschema/table_setup_instruments.cc
 3227 cpowers	2011-02-08
      WL#4896 "Performance Schema Net IO"
      
      - Fixed problem with socket_summary_by_instance definition.
      - Fixed runtime column type warnings.

    modified:
      scripts/mysql_system_tables.sql
      storage/perfschema/pfs_engine_table.cc
      storage/perfschema/table_socket_instances.cc
      storage/perfschema/table_socket_summary_by_instance.cc
=== modified file 'include/mysql/psi/mysql_socket.h'
--- a/include/mysql/psi/mysql_socket.h	2011-02-04 22:00:44 +0000
+++ b/include/mysql/psi/mysql_socket.h	2011-02-12 00:22:15 +0000
@@ -358,7 +358,7 @@ inline_mysql_socket_socket
 {
   MYSQL_SOCKET mysql_socket = {0, NULL};
 #ifdef HAVE_PSI_INTERFACE
-  mysql_socket.m_psi = PSI_server ? PSI_server->init_socket(key, &mysql_socket.fd)
+  mysql_socket.m_psi = PSI_server ? PSI_server->init_socket(key, NULL) //TBD &mysql_socket.fd)
                                   : NULL;
 #endif
   mysql_socket.fd= socket(domain, type, protocol);
@@ -731,7 +731,7 @@ inline_mysql_socket_accept
   struct PSI_socket_locker *locker= NULL;
   PSI_socket_locker_state state;
 
-  socket_accept.m_psi = PSI_server ? PSI_server->init_socket(key, &socket_accept.fd)
+  socket_accept.m_psi = PSI_server ? PSI_server->init_socket(key, NULL)//TBD: &socket_accept.fd)
                                    : NULL;
   if (likely(PSI_server != NULL && socket_accept.m_psi != NULL))
   {
@@ -745,7 +745,7 @@ inline_mysql_socket_accept
 #ifdef HAVE_PSI_INTERFACE
   /** Set socket address info */
   if (likely(PSI_server != NULL && socket_accept.m_psi != NULL
-      && socket_accept.fd > -1))
+      && socket_accept.fd != -1))
     PSI_server->set_socket_info(socket_accept.m_psi, socket_accept.fd, addr);
 
   if (likely(locker != NULL))
@@ -770,7 +770,7 @@ inline_mysql_socket_accept
     struct PSI_socket_locker *locker= NULL;
     PSI_socket_locker_state state;
 
-    socket_accept.m_psi = PSI_server ? PSI_server->init_socket(key, &socket_accept.fd)
+    socket_accept.m_psi = PSI_server ? PSI_server->init_socket(key, NULL)// &socket_accept.fd) // TBD: check this
                                      : NULL;
     if (likely(PSI_server != NULL && socket_accept.m_psi != NULL))
     {
@@ -783,7 +783,7 @@ inline_mysql_socket_accept
   #ifdef HAVE_PSI_INTERFACE
     /** Set socket address info */
     if (likely(PSI_server != NULL && socket_accept.m_psi != NULL
-        && socket_accept.fd > -1))
+        && socket_accept.fd != -1))
       PSI_server->set_socket_info(socket_accept.m_psi, socket_accept.fd, addr);
 
     if (likely(locker != NULL))

=== modified file 'scripts/mysql_system_tables.sql'
--- a/scripts/mysql_system_tables.sql	2011-02-08 23:01:39 +0000
+++ b/scripts/mysql_system_tables.sql	2011-02-11 21:01:56 +0000
@@ -383,10 +383,10 @@ DROP PREPARE stmt;
 SET @cmd="CREATE TABLE performance_schema.socket_instances("
   "EVENT_NAME VARCHAR(128) not null,"
   "OBJECT_INSTANCE_BEGIN BIGINT unsigned not null,"
-  "THREAD_ID INTEGER,"
-  "SOCKET_ID INTEGER,"
-  "IP VARCHAR(64),"
-  "PORT INTEGER"
+  "THREAD_ID INTEGER not null,"
+  "SOCKET_ID INTEGER not null,"
+  "IP VARCHAR(64) not null,"
+  "PORT INTEGER not null"
   ")ENGINE=PERFORMANCE_SCHEMA;";
 
 SET @str = IF(@have_pfs = 1, @cmd, 'SET @dummy = 0');
@@ -399,9 +399,9 @@ DROP PREPARE stmt;
 --
 
 SET @cmd="CREATE TABLE performance_schema.socket_summary_by_instance("
-  "EVENT_NAME VARCHAR(128),"
+  "EVENT_NAME VARCHAR(128) not null,"
   "OBJECT_INSTANCE_BEGIN BIGINT unsigned not null,"
-  "OBJECT_NAME VARCHAR(64),"
+  "OBJECT_NAME VARCHAR(64) default '' not null,"
   "COUNT_STAR BIGINT unsigned not null,"
   "SUM_TIMER_WAIT BIGINT unsigned not null,"
   "MIN_TIMER_WAIT BIGINT unsigned not null,"

=== modified file 'storage/perfschema/pfs.cc'
--- a/storage/perfschema/pfs.cc	2011-02-07 22:17:15 +0000
+++ b/storage/perfschema/pfs.cc	2011-02-12 00:22:15 +0000
@@ -2577,7 +2577,7 @@ get_thread_socket_locker_v1(PSI_socket_l
       wait->m_class= klass;
       wait->m_timer_start= 0;
       wait->m_timer_end= 0;
-      wait->m_object_instance_addr= pfs_socket;
+      wait->m_object_instance_addr= pfs_socket->m_identity;
    // wait->m_object_name= pfs_socket->m_ip;   // TBD: Where is object_name defined?
    // wait->m_object_name_length= pfs_socket->m_ip_length;
       wait->m_event_id= pfs_thread->m_event_id++;

=== modified file 'storage/perfschema/pfs_instr.cc'
--- a/storage/perfschema/pfs_instr.cc	2011-02-07 21:34:45 +0000
+++ b/storage/perfschema/pfs_instr.cc	2011-02-12 00:22:15 +0000
@@ -1201,7 +1201,7 @@ PFS_socket* create_socket(PFS_socket_cla
       {
         if (pfs->m_lock.free_to_dirty())
         {
-          pfs->m_identity= identity;
+          pfs->m_identity= (identity == NULL ? pfs : identity); // TBD: fix this
           pfs->m_class= klass;
           pfs->m_wait_stat.reset();
           pfs->m_socket_stat.reset();

=== modified file 'storage/perfschema/table_ews_by_thread_by_event_name.cc'
--- a/storage/perfschema/table_ews_by_thread_by_event_name.cc	2011-01-07 16:20:19 +0000
+++ b/storage/perfschema/table_ews_by_thread_by_event_name.cc	2011-02-12 00:22:15 +0000
@@ -120,6 +120,7 @@ int table_ews_by_thread_by_event_name::r
   PFS_cond_class *cond_class;
   PFS_file_class *file_class;
   PFS_instr_class *table_class;
+  PFS_socket_class *socket_class;
 
   for (m_pos.set_at(&m_next_pos);
        m_pos.has_more_view();
@@ -227,6 +228,26 @@ int table_ews_by_thread_by_event_name::r
         }
       } while (table_class != NULL);
       break;
+    case pos_ews_by_thread_by_event_name::VIEW_SOCKET:
+      do
+      {
+        socket_class= find_socket_class(m_pos.m_index_2);
+        if (socket_class)
+        {
+          for ( ; m_pos.has_more_thread(); m_pos.next_thread())
+          {
+            thread= &thread_array[m_pos.m_index_3];
+            if (thread->m_lock.is_populated())
+            {
+              make_row(thread, socket_class);
+              m_next_pos.set_after(&m_pos);
+              return 0;
+            }
+          }
+          m_pos.next_instrument();
+        }
+      } while (socket_class != NULL);
+      break;
     default:
       break;
     }
@@ -244,6 +265,7 @@ table_ews_by_thread_by_event_name::rnd_p
   PFS_cond_class *cond_class;
   PFS_file_class *file_class;
   PFS_instr_class *table_class;
+  PFS_socket_class *socket_class;
 
   set_position(pos);
   DBUG_ASSERT(m_pos.m_index_3 < thread_max);
@@ -294,6 +316,14 @@ table_ews_by_thread_by_event_name::rnd_p
       return 0;
     }
     break;
+  case pos_ews_by_thread_by_event_name::VIEW_SOCKET:
+    socket_class= find_socket_class(m_pos.m_index_2);
+    if (socket_class)
+    {
+      make_row(thread, socket_class);
+      return 0;
+    }
+    break;
   }
 
   return HA_ERR_RECORD_DELETED;

=== modified file 'storage/perfschema/table_ews_global_by_event_name.cc'
--- a/storage/perfschema/table_ews_global_by_event_name.cc	2011-01-07 16:20:19 +0000
+++ b/storage/perfschema/table_ews_global_by_event_name.cc	2011-02-12 00:22:15 +0000
@@ -118,6 +118,7 @@ int table_ews_global_by_event_name::rnd_
   PFS_rwlock_class *rwlock_class;
   PFS_cond_class *cond_class;
   PFS_file_class *file_class;
+  PFS_socket_class *socket_class;
 
   if (global_instr_class_waits_array == NULL)
     return HA_ERR_END_OF_FILE;
@@ -178,6 +179,15 @@ int table_ews_global_by_event_name::rnd_
         return 0;
       }
       break;
+    case pos_ews_global_by_event_name::VIEW_SOCKET:
+      socket_class= find_socket_class(m_pos.m_index_2);
+      if (socket_class)
+      {
+        make_socket_row(socket_class);
+        m_next_pos.set_after(&m_pos);
+        return 0;
+      }
+      break;
     default:
       break;
     }
@@ -193,6 +203,7 @@ table_ews_global_by_event_name::rnd_pos(
   PFS_rwlock_class *rwlock_class;
   PFS_cond_class *cond_class;
   PFS_file_class *file_class;
+  PFS_socket_class *socket_class;
 
   set_position(pos);
 
@@ -241,6 +252,14 @@ table_ews_global_by_event_name::rnd_pos(
     else
       make_table_lock_row(&global_table_lock_class);
     break;
+  case pos_ews_global_by_event_name::VIEW_SOCKET:
+    socket_class= find_socket_class(m_pos.m_index_2);
+    if (socket_class)
+    {
+      make_socket_row(socket_class);
+      return 0;
+    }
+    break;
   }
 
   return HA_ERR_RECORD_DELETED;
@@ -324,6 +343,19 @@ void table_ews_global_by_event_name
   m_row_exists= true;
 }
 
+void table_ews_global_by_event_name
+::make_socket_row(PFS_socket_class *klass)
+{
+  m_row.m_event_name.make_row(klass);
+
+  PFS_instance_wait_visitor visitor;
+  PFS_instance_iterator::visit_socket_instances(klass, &visitor);
+
+  time_normalizer *normalizer= time_normalizer::get(wait_timer);
+  m_row.m_stat.set(normalizer, &visitor.m_stat);
+  m_row_exists= true;
+}
+
 int table_ews_global_by_event_name
 ::read_row_values(TABLE *table, unsigned char *, Field **fields,
                   bool read_all)

=== modified file 'storage/perfschema/table_ews_global_by_event_name.h'
--- a/storage/perfschema/table_ews_global_by_event_name.h	2011-01-07 16:20:19 +0000
+++ b/storage/perfschema/table_ews_global_by_event_name.h	2011-02-12 00:22:15 +0000
@@ -110,6 +110,7 @@ protected:
   void make_file_row(PFS_file_class *klass);
   void make_table_io_row(PFS_instr_class *klass);
   void make_table_lock_row(PFS_instr_class *klass);
+  void make_socket_row(PFS_socket_class *klass);
 
 private:
   /** Table share lock. */

=== modified file 'storage/perfschema/table_setup_instruments.cc'
--- a/storage/perfschema/table_setup_instruments.cc	2011-02-07 21:34:45 +0000
+++ b/storage/perfschema/table_setup_instruments.cc	2011-02-11 21:01:56 +0000
@@ -113,7 +113,7 @@ int table_setup_instruments::rnd_next(vo
       instr_class= find_table_class(m_pos.m_index_2);
       break;
     case pos_setup_instruments::VIEW_SOCKET:
-      instr_class= find_table_class(m_pos.m_index_2);
+      instr_class= find_socket_class(m_pos.m_index_2);
       break;
     }
     if (instr_class)

=== modified file 'storage/perfschema/table_socket_instances.cc'
--- a/storage/perfschema/table_socket_instances.cc	2011-02-08 23:01:39 +0000
+++ b/storage/perfschema/table_socket_instances.cc	2011-02-12 00:22:15 +0000
@@ -62,7 +62,6 @@ static const TABLE_FIELD_TYPE field_type
   }
 };
 
-
 TABLE_FIELD_DEF
 table_socket_instances::m_field_def=
 { 6, field_types };


Attachment: [text/bzr-bundle] bzr/cpowers@tma-1-20110212002215-lne86pesxclo411j.bundle
Thread
bzr push into mysql-trunk-wl5379 branch (chris.powers:3227 to 3229) WL#4896Christopher Powers12 Feb