From: Marc Alff Date: November 4 2011 1:12am Subject: bzr push into mysql-trunk-marc branch (marc.alff:3558 to 3559) List-Archive: http://lists.mysql.com/commits/141729 Message-Id: <201111040113.pA41D2a0020095@acsmt356.oracle.com> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit 3559 Marc Alff 2011-11-03 Added benchmarks for table io and table lock modified: storage/perfschema/unittest/pfs_benchmark-t.cc 3558 Marc Alff 2011-11-03 Added tooling from mysql-trunk-perfschema for benchmarks added: storage/perfschema/unittest/doit-linux storage/perfschema/unittest/pfs_benchmark-t.cc storage/perfschema/unittest/pfs_benchmark_helper.cc storage/perfschema/unittest/pfs_benchmark_helper.h modified: storage/perfschema/unittest/CMakeLists.txt === modified file 'storage/perfschema/unittest/pfs_benchmark-t.cc' --- a/storage/perfschema/unittest/pfs_benchmark-t.cc 2011-11-03 22:38:27 +0000 +++ b/storage/perfschema/unittest/pfs_benchmark-t.cc 2011-11-04 01:12:21 +0000 @@ -42,6 +42,9 @@ #include "stub_server_misc.h" #include "pfs_benchmark_helper.h" +/* TABLE_SHARE */ +#include "table.h" + #include /* memset */ static bool bench_pfs_enabled= false; @@ -77,15 +80,12 @@ PSI_file_info all_bench_files[]= { & bench_file_key, "benchmark", 0} }; -static PSI_thread_key key_thread_main; +static PSI_thread_key key_bm_thread_main; static PSI_thread_info all_bench_threads[]= { - { & key_thread_main, "main", 0} + { & key_bm_thread_main, "main", 0} }; -// static PSI_table_share *bench_table_share= NULL; -static PSI_table *bench_table_handle= NULL; - static void setup(bool pfs_enabled) { PFS_global_param param; @@ -141,7 +141,7 @@ static void setup(bool pfs_enabled) PSI_server->register_file("unittest", all_bench_files, 1); PSI_server->register_thread("unittest", all_bench_threads, 1); - PSI_thread *psi= PSI_server->new_thread(key_thread_main, NULL, 0); + PSI_thread *psi= PSI_server->new_thread(key_bm_thread_main, NULL, 0); ok(!pfs_enabled || psi != NULL, "main thread"); PSI_server->set_thread(psi); @@ -390,14 +390,25 @@ void benchmark_file_open(uint count, con count, timer_cycles, timer_cycles/count); } -void benchmark_table_open(uint count, const char *test) +void fake_TABLE_SHARE(TABLE_SHARE *fake) +{ + fake->db.str = (char*) "test"; + fake->db.length = 4; + fake->table_name.str = (char*) "t1"; + fake->table_name.length = 2; + fake->keys= 0; +} + +void benchmark_create_table_share(uint count, const char *test) { ulonglong timer_start; ulonglong timer_end; ulonglong timer_cycles; - PSI_table *that= bench_table_handle; - ok(that == NULL, "table is not instrumented yet"); + TABLE_SHARE table_share; + fake_TABLE_SHARE(& table_share); + + PSI_table_share *that; timer_start= my_timer_cycles(); @@ -405,18 +416,86 @@ void benchmark_table_open(uint count, co start_some_work(); for (i= 0 ; im_timed= timed; bench_file_class->m_enabled= enabled; bench_file_class->m_timed= timed; + global_table_io_class.m_enabled= enabled; + global_table_io_class.m_timed= timed; + global_table_lock_class.m_enabled= enabled; + global_table_lock_class.m_timed= timed; benchmark_all(enabled, timed, "bigbang"); @@ -584,6 +694,16 @@ void test_all(bool enabled, bool timed) void do_print_config() { +#ifdef MY_ATOMIC_MODE_DUMMY + diag("MY_ATOMIC_MODE_DUMMY : something is wrong here"); +#endif + +#ifdef MY_ATOMIC_MODE_RWLOCKS + diag("MY_ATOMIC_MODE_RWLOCKS : something is wrong here"); +#endif + + diag("MY_ATOMIC_MODE compiled with : " MY_ATOMIC_MODE); + #ifdef HAVE_PSI_MUTEX_INTERFACE diag("MUTEX INSTRUMENTATION compiled in"); #else No bundle (reason: useless for push emails).