List:Commits« Previous MessageNext Message »
From:Marc Alff Date:May 6 2010 7:02am
Subject:bzr commit into mysql-next-mr-wl4895 branch (marc.alff:3143) WL#4895
View as plain text  
#At file:///Users/malff/BZR_TREE/mysql-next-mr-wl4895/ based on revid:marc.alff@stripped

 3143 Marc Alff	2010-05-06
      WL#4895 PERFORMANCE SCHEMA TABLE IO
      
      Port, continued

    modified:
      include/mysql/psi/psi_abi_v1.h.pp
      include/mysql/psi/psi_abi_v2.h.pp
      mysql-test/suite/perfschema/r/selects.result
      mysql-test/suite/perfschema/t/selects.test
      storage/perfschema/pfs.cc
      storage/perfschema/pfs_instr_class.cc
=== modified file 'include/mysql/psi/psi_abi_v1.h.pp'
--- a/include/mysql/psi/psi_abi_v1.h.pp	2010-01-26 23:42:54 +0000
+++ b/include/mysql/psi/psi_abi_v1.h.pp	2010-05-06 07:02:06 +0000
@@ -1,5 +1,6 @@
 #include "mysql/psi/psi.h"
 C_MODE_START
+struct TABLE_SHARE;
 struct PSI_mutex;
 struct PSI_rwlock;
 struct PSI_cond;
@@ -7,6 +8,7 @@ struct PSI_table_share;
 struct PSI_table;
 struct PSI_thread;
 struct PSI_file;
+struct PSI_table_locker;
 struct PSI_bootstrap
 {
   void* (*get_interface)(int version);
@@ -52,7 +54,15 @@ enum PSI_file_operation
   PSI_FILE_RENAME= 15,
   PSI_FILE_SYNC= 16
 };
-struct PSI_table_locker;
+enum PSI_table_operation
+{
+  PSI_TABLE_LOCK= 0,
+  PSI_TABLE_EXTERNAL_LOCK= 1,
+  PSI_TABLE_FETCH_ROW= 2,
+  PSI_TABLE_WRITE_ROW= 3,
+  PSI_TABLE_UPDATE_ROW= 4,
+  PSI_TABLE_DELETE_ROW= 5
+};
 typedef unsigned int PSI_mutex_key;
 typedef unsigned int PSI_rwlock_key;
 typedef unsigned int PSI_cond_key;
@@ -108,9 +118,11 @@ typedef struct PSI_cond* (*init_cond_v1_
   (PSI_cond_key key, const void *identity);
 typedef void (*destroy_cond_v1_t)(struct PSI_cond *cond);
 typedef struct PSI_table_share* (*get_table_share_v1_t)
-  (const char *schema_name, int schema_name_length, const char *table_name,
-   int table_name_length, const void *identity);
+  (my_bool temporary, struct TABLE_SHARE *share);
 typedef void (*release_table_share_v1_t)(struct PSI_table_share *share);
+typedef void (*drop_table_share_v1_t)
+  (const char *schema_name, int schema_name_length,
+   const char *table_name, int table_name_length);
 typedef struct PSI_table* (*open_table_v1_t)
   (struct PSI_table_share *share, const void *identity);
 typedef void (*close_table_v1_t)(struct PSI_table *table);
@@ -136,7 +148,7 @@ typedef struct PSI_cond_locker* (*get_th
   (struct PSI_cond *cond, struct PSI_mutex *mutex,
    enum PSI_cond_operation op);
 typedef struct PSI_table_locker* (*get_thread_table_locker_v1_t)
-  (struct PSI_table *table);
+  (struct PSI_table *table, enum PSI_table_operation op, ulong flags);
 typedef struct PSI_file_locker* (*get_thread_file_name_locker_v1_t)
   (PSI_file_key key, enum PSI_file_operation op, const char *name,
    const void *identity);
@@ -169,7 +181,7 @@ typedef void (*start_cond_wait_v1_t)
 typedef void (*end_cond_wait_v1_t)
   (struct PSI_cond_locker *locker, int rc);
 typedef void (*start_table_wait_v1_t)
-  (struct PSI_table_locker *locker, const char *src_file, uint src_line);
+  (struct PSI_table_locker *locker, uint index, const char *src_file, uint src_line);
 typedef void (*end_table_wait_v1_t)(struct PSI_table_locker *locker);
 typedef struct PSI_file* (*start_file_open_wait_v1_t)
   (struct PSI_file_locker *locker, const char *src_file, uint src_line);
@@ -196,6 +208,7 @@ struct PSI_v1
   destroy_cond_v1_t destroy_cond;
   get_table_share_v1_t get_table_share;
   release_table_share_v1_t release_table_share;
+  drop_table_share_v1_t drop_table_share;
   open_table_v1_t open_table;
   close_table_v1_t close_table;
   create_file_v1_t create_file;

=== modified file 'include/mysql/psi/psi_abi_v2.h.pp'
--- a/include/mysql/psi/psi_abi_v2.h.pp	2009-12-01 00:49:15 +0000
+++ b/include/mysql/psi/psi_abi_v2.h.pp	2010-05-06 07:02:06 +0000
@@ -1,5 +1,6 @@
 #include "mysql/psi/psi.h"
 C_MODE_START
+struct TABLE_SHARE;
 struct PSI_mutex;
 struct PSI_rwlock;
 struct PSI_cond;
@@ -7,6 +8,7 @@ struct PSI_table_share;
 struct PSI_table;
 struct PSI_thread;
 struct PSI_file;
+struct PSI_table_locker;
 struct PSI_bootstrap
 {
   void* (*get_interface)(int version);
@@ -52,7 +54,15 @@ enum PSI_file_operation
   PSI_FILE_RENAME= 15,
   PSI_FILE_SYNC= 16
 };
-struct PSI_table_locker;
+enum PSI_table_operation
+{
+  PSI_TABLE_LOCK= 0,
+  PSI_TABLE_EXTERNAL_LOCK= 1,
+  PSI_TABLE_FETCH_ROW= 2,
+  PSI_TABLE_WRITE_ROW= 3,
+  PSI_TABLE_UPDATE_ROW= 4,
+  PSI_TABLE_DELETE_ROW= 5
+};
 typedef unsigned int PSI_mutex_key;
 typedef unsigned int PSI_rwlock_key;
 typedef unsigned int PSI_cond_key;

=== modified file 'mysql-test/suite/perfschema/r/selects.result'
--- a/mysql-test/suite/perfschema/r/selects.result	2010-01-12 01:47:27 +0000
+++ b/mysql-test/suite/perfschema/r/selects.result	2010-05-06 07:02:06 +0000
@@ -1,4 +1,6 @@
 UPDATE performance_schema.SETUP_INSTRUMENTS SET enabled = 'YES', timed = 'YES';
+UPDATE performance_schema.SETUP_INSTRUMENTS SET enabled = 'NO', timed = 'NO'
+  where NAME='wait/io/table/sql/handler';
 DROP TABLE IF EXISTS t1;
 CREATE TABLE t1 (id INT PRIMARY KEY, b CHAR(100) DEFAULT 'initial value')
 ENGINE=MyISAM;
@@ -95,3 +97,4 @@ t_ps_func(0) = @p_id
 DROP PROCEDURE t_ps_proc;
 DROP FUNCTION t_ps_func;
 DROP TABLE t1;
+UPDATE performance_schema.SETUP_INSTRUMENTS SET enabled = 'YES', timed = 'YES';

=== modified file 'mysql-test/suite/perfschema/t/selects.test'
--- a/mysql-test/suite/perfschema/t/selects.test	2010-01-12 01:47:27 +0000
+++ b/mysql-test/suite/perfschema/t/selects.test	2010-05-06 07:02:06 +0000
@@ -24,6 +24,12 @@
 
 UPDATE performance_schema.SETUP_INSTRUMENTS SET enabled = 'YES', timed = 'YES';
 
+# Disable ALL table IO, to avoid generating events from the selects
+# To be revised after WL#5342 PERFORMANCE SCHEMA SETUP OBJECTS
+
+UPDATE performance_schema.SETUP_INSTRUMENTS SET enabled = 'NO', timed = 'NO'
+  where NAME='wait/io/table/sql/handler';
+
 --disable_warnings
 DROP TABLE IF EXISTS t1;
 --enable_warnings
@@ -154,3 +160,6 @@ DROP FUNCTION t_ps_func;
 
 # Clean up
 DROP TABLE t1;
+
+UPDATE performance_schema.SETUP_INSTRUMENTS SET enabled = 'YES', timed = 'YES';
+

=== modified file 'storage/perfschema/pfs.cc'
--- a/storage/perfschema/pfs.cc	2010-05-05 08:16:47 +0000
+++ b/storage/perfschema/pfs.cc	2010-05-06 07:02:06 +0000
@@ -1294,13 +1294,14 @@ get_thread_table_locker_v1(PSI_table *ta
   DBUG_ASSERT(pfs_table != NULL);
   DBUG_ASSERT(pfs_table->m_share != NULL);
 
+  if (! flag_events_waits_current)
+    return NULL;
+  if (! global_table_class.m_enabled)
+    return NULL;
   /*
-    See the handler::external_lock() API design,
-    there is no handler::external_unlock().
+    Table locks will be recorded with WL#5371.
   */
-  if ((op == PSI_TABLE_EXTERNAL_LOCK) && (flags == F_UNLCK))
-    return NULL;
-  if (! flag_events_waits_current)
+  if ((op == PSI_TABLE_EXTERNAL_LOCK) || (op == PSI_TABLE_LOCK))
     return NULL;
   if (! pfs_table->m_share->m_enabled)
     return NULL;

=== modified file 'storage/perfschema/pfs_instr_class.cc'
--- a/storage/perfschema/pfs_instr_class.cc	2010-05-05 08:16:47 +0000
+++ b/storage/perfschema/pfs_instr_class.cc	2010-05-06 07:02:06 +0000
@@ -108,8 +108,8 @@ PFS_table_share *table_share_array= NULL
 
 PFS_instr_class global_table_class=
 {
-  "wait/table", /* name */
-  10, /* name length */
+  "wait/io/table/sql/handler", /* name */
+  25, /* name length */
   0, /* flags */
   true, /* enabled */
   true, /* timed */


Attachment: [text/bzr-bundle] bzr/marc.alff@oracle.com-20100506070206-avhyqjl9ipiki1uv.bundle
Thread
bzr commit into mysql-next-mr-wl4895 branch (marc.alff:3143) WL#4895Marc Alff6 May