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
3142 Marc Alff 2010-05-05
WL#4895 PERFORMANCE SCHEMA Instrument Table IO
Port in progress
added:
include/mysql/psi/mysql_table.h
modified:
include/Makefile.am
include/mysql/psi/psi.h
mysql-test/include/mtr_check.sql
mysql-test/suite/perfschema/include/start_server_common.inc
mysql-test/suite/perfschema/r/dml_events_waits_current.result
mysql-test/suite/perfschema/r/dml_events_waits_history.result
mysql-test/suite/perfschema/r/dml_events_waits_history_long.result
mysql-test/suite/perfschema/r/func_file_io.result
mysql-test/suite/perfschema/r/func_mutex.result
mysql-test/suite/perfschema/r/myisam_file_io.result
mysql-test/suite/perfschema/r/no_threads.result
mysql-test/suite/perfschema/r/start_server_no_cond_class.result
mysql-test/suite/perfschema/r/start_server_no_cond_inst.result
mysql-test/suite/perfschema/r/start_server_no_file_class.result
mysql-test/suite/perfschema/r/start_server_no_file_inst.result
mysql-test/suite/perfschema/r/start_server_no_mutex_class.result
mysql-test/suite/perfschema/r/start_server_no_mutex_inst.result
mysql-test/suite/perfschema/r/start_server_no_rwlock_class.result
mysql-test/suite/perfschema/r/start_server_no_rwlock_inst.result
mysql-test/suite/perfschema/r/start_server_no_thread_class.result
mysql-test/suite/perfschema/r/start_server_no_thread_inst.result
mysql-test/suite/perfschema/r/start_server_off.result
mysql-test/suite/perfschema/r/start_server_on.result
mysql-test/suite/perfschema/t/dml_events_waits_current.test
mysql-test/suite/perfschema/t/dml_events_waits_history.test
mysql-test/suite/perfschema/t/dml_events_waits_history_long.test
mysql-test/suite/perfschema/t/func_file_io.test
mysql-test/suite/perfschema/t/func_mutex.test
mysql-test/suite/perfschema/t/myisam_file_io.test
mysql-test/suite/perfschema/t/no_threads.test
mysys/thr_lock.c
sql/event_db_repository.cc
sql/filesort.cc
sql/ha_partition.cc
sql/handler.cc
sql/handler.h
sql/item_subselect.cc
sql/log_event.cc
sql/log_event_old.cc
sql/opt_range.cc
sql/opt_sum.cc
sql/records.cc
sql/sp.cc
sql/sql_acl.cc
sql/sql_base.cc
sql/sql_cursor.cc
sql/sql_handler.cc
sql/sql_help.cc
sql/sql_insert.cc
sql/sql_partition.cc
sql/sql_plugin.cc
sql/sql_select.cc
sql/sql_servers.cc
sql/sql_show.cc
sql/sql_table.cc
sql/sql_udf.cc
sql/sql_update.cc
sql/table.cc
sql/tztime.cc
storage/perfschema/ha_perfschema.cc
storage/perfschema/pfs.cc
storage/perfschema/pfs_column_types.h
storage/perfschema/pfs_events_waits.h
storage/perfschema/pfs_instr.cc
storage/perfschema/pfs_instr.h
storage/perfschema/pfs_instr_class.cc
storage/perfschema/pfs_instr_class.h
storage/perfschema/table_events_waits.cc
storage/perfschema/table_events_waits.h
storage/perfschema/table_setup_instruments.cc
storage/perfschema/table_setup_instruments.h
storage/perfschema/table_setup_objects.cc
storage/perfschema/unittest/pfs_instr-t.cc
storage/perfschema/unittest/pfs_instr_class-t.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 push into mysql-next-mr-wl4895 branch (marc.alff:3142 to 3143)WL#4895 | Marc Alff | 6 May |