From: Marc Alff Date: May 3 2011 11:49pm Subject: bzr commit into mysql-trunk-pfs-tuning branch (marc.alff:3365) List-Archive: http://lists.mysql.com/commits/136601 Message-Id: <201105032349.p43NnmkN019300@acsmt358.oracle.com> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="===============2023834382934973300==" --===============2023834382934973300== MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Content-Disposition: inline #At file:///Users/malff/BZR_TREE/mysql-trunk-pfs-tuning/ based on revid:marc.alff@stripped 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 === 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; + + + --===============2023834382934973300== MIME-Version: 1.0 Content-Type: text/bzr-bundle; charset="us-ascii"; name="bzr/marc.alff@stripped" Content-Transfer-Encoding: 7bit Content-Disposition: inline # Bazaar merge directive format 2 (Bazaar 0.90) # revision_id: marc.alff@stripped # target_branch: file:///Users/malff/BZR_TREE/mysql-trunk-pfs-tuning/ # testament_sha1: 4be5a5af35d970195c952fe653f8f134d5e359ec # timestamp: 2011-05-03 17:49:40 -0600 # base_revision_id: marc.alff@stripped\ # ik4ym6wu2hd0zxdq # # Begin bundle IyBCYXphYXIgcmV2aXNpb24gYnVuZGxlIHY0CiMKQlpoOTFBWSZTWerOqVsAEKf/gHQwQf////// f+//8L////pgGw699vuPW303dx9sX3q972yL2Z2tsAAUAUb157rkfYqr7Dvvg0Vu5M+3K+989Vo3 mFtp7ndr1xzUOqdd26kuo2V1ZrCSQmgmINKejBPSjTGp6m0npNHqTQ0H6o9TQeUAaBp6mmR6glAg EE1PFBpMlNNNpGnqaNBoAAAAAADQ0DU8ghKaT9SHpAaNPKAAAANAAABoAAAJNRE0QmojyUeU8oyB iZkgNBoyAGg0ANNPUNAAiUQRkAmmRpGCZGU9EE00GZRoNNDDKAA0PUaAkSCaJkaaIyBT0xMTUnih +pNBk0aAZDQAAAZF8SJIuBycd5jl7TvLe4fwkgatOnU/wauebkYZhmZmGgKCxBVpoVBQZUShVCf0 75weo7PyqkquOwBYwAvgYBOZKlCIVS9kNiEg/psJ/H4DfhpgGcul179kRbQDOCQkUKC/bk0awhOG lE0f+aKwhCISFKQV3TM8MMTp1nwa5jyBSHnyef37HYLsdFwECwV2hcrY30jRCplTFq6ZI1wTkwE9 YoURBxUxDtDASsDF4ab30cIkFVQYy4YWS2hIVvmLWtHGgomj06kRNqInN5BUW5UGAjIKRAmyiFIi DIoof3HnSKMkRKnH4ygGHMDR9vF0IrYJf2fL1/LjfpJT0aJolQJ/2JfxFeptRBgYZRWnrZAesD7F 4LJAkSRRkkJGREN6HZpSNOgFKYVy5xn3jp0CCGOY5tVZzTPKo4arvJD1oyw4eHDW9BZW16b4owm6 W00qON9Y360sSJ1K3vei6q2Io8Pe84lZnne72qxaa0NNERrKmrCOCUG/deeTs7pd73LE008njFbZ rTs2uOnNxF4xUcUu+1Gm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