--- /old/mysql-5.0.41/sql/sql_select.cc 2007-05-02 07:39:29.000000000 -0700 +++ /new/mysql-5.0.41/sql/sql_select.cc 2008-04-01 15:39:37.981370000 -0700 @@ -23,7 +23,7 @@ #include "mysql_priv.h" #include "sql_select.h" #include "sql_cursor.h" - +#include #include #include #include @@ -4307,6 +4307,7 @@ static void choose_plan(JOIN *join, table_map join_tables) { + DTRACE_QUERY_PLAN_START(join->thd->query); uint search_depth= join->thd->variables.optimizer_search_depth; uint prune_level= join->thd->variables.optimizer_prune_level; bool straight_join= test(join->select_options & SELECT_STRAIGHT_JOIN); @@ -4354,6 +4355,7 @@ */ if (join->thd->lex->orig_sql_command != SQLCOM_SHOW_STATUS) join->thd->status_var.last_query_cost= join->best_read; + DTRACE_QUERY_PLAN_FINISH(join->thd->query); DBUG_VOID_RETURN; } --- /old/mysql-5.0.41/sql/sql_parse.cc 2007-05-02 07:40:46.000000000 -0700 +++ /new/mysql-5.0.41/sql/sql_parse.cc 2008-04-08 13:59:36.706988000 -0700 @@ -12,6 +12,7 @@ You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ +/* Copyright (C) 2007 Sun Microsystems, Inc. All rights reserved. Unpublished - rights reserved under the Copyright Laws of the United States.U.S. Government Rights - Commercial software. Government users are subject to the Sun Microsystems, Inc. standard license agreement and applicable provisions of the FAR and its supplements. Use is subject to license terms. Sun, Sun Microsystems, the Sun logo, Java, Solaris and Dynamic Tracing (DTrace) probes are trademarks or registered trademarks of Sun Microsystems, Inc. in the U.S. and other countries */ #define MYSQL_LEX 1 #include "mysql_priv.h" @@ -20,6 +21,7 @@ #include #include #include +#include #ifdef HAVE_INNOBASE_DB #include "ha_innodb.h" @@ -1536,7 +1538,10 @@ thd->clear_error(); // Clear error message net_new_transaction(net); - if ((packet_length=my_net_read(net)) == packet_error) + DTRACE_DATA_RECEIVE_START(thd->thread_id); + packet_length=my_net_read(net); + DTRACE_DATA_RECEIVE_FINISH(thd->thread_id); + if (packet_length == packet_error) { DBUG_PRINT("info",("Got error %d reading command from socket %s", net->error, @@ -2438,6 +2443,7 @@ bool mysql_execute_command(THD *thd) { + DTRACE_QUERY_EXECUTE_START((void *)thd, thd->db,thd->security_ctx->user, (char *)thd->security_ctx->host_or_ip,thd->query); bool res= FALSE; bool need_start_waiting= FALSE; // have protection against global read lock int up_result= 0; @@ -5110,6 +5116,7 @@ send_ok(thd); break; } + DTRACE_QUERY_EXECUTE_FINISH((void*)thd, thd->db,thd->security_ctx->user, (char *)thd->security_ctx->host_or_ip,thd->query, res ==0 ? 0: -1); thd_proc_info(thd, "query end"); /* Two binlog-related cleanups: */ @@ -5140,6 +5147,7 @@ goto end; error: + DTRACE_QUERY_EXECUTE_FINISH((void *)thd, thd->db,thd->security_ctx->user, (char *)thd->security_ctx->host_or_ip, thd->query,-1); res= TRUE; end: --- /old/mysql-5.0.41/sql/sql_cache.cc 2007-05-02 07:40:41.000000000 -0700 +++ /new/mysql-5.0.41/sql/sql_cache.cc 2008-03-05 17:40:43.811096000 -0800 @@ -12,6 +12,7 @@ You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ +/* Copyright (C) 2007 Sun Microsystems, Inc. All rights reserved. Unpublished - rights reserved under the Copyright Laws of the United States.U.S. Government Rights - Commercial software. Government users are subject to the Sun Microsystems, Inc. standard license agreement and applicable provisions of the FAR and its supplements. Use is subject to license terms. Sun, Sun Microsystems, the Sun logo, Java, Solaris and Dynamic Tracing (DTrace) probes are trademarks or registered trademarks of Sun Microsystems, Inc. in the U.S. and other countries */ /* Description of the query cache: @@ -304,7 +305,7 @@ #else #include "../myisammrg/myrg_def.h" #endif - +#include #ifdef EMBEDDED_LIBRARY #include "emb_qcache.h" #endif @@ -1287,13 +1288,14 @@ thd->limit_found_rows = query->found_rows(); thd->status_var.last_query_cost= 0.0; - + DTRACE_QUERY_CACHE_HIT((void *)thd, thd->db,thd->security_ctx->user, (char *)thd->security_ctx->host_or_ip, sql); BLOCK_UNLOCK_RD(query_block); DBUG_RETURN(1); // Result sent to client err_unlock: STRUCT_UNLOCK(&structure_guard_mutex); err: + DTRACE_QUERY_CACHE_MISS((void *)thd, thd->db,thd->security_ctx->user, (char *)thd->security_ctx->host_or_ip, sql); DBUG_RETURN(0); // Query was not cached } --- /old/mysql-5.0.41/sql/ha_innodb.cc 2007-05-02 07:40:56.000000000 -0700 +++ /new/mysql-5.0.41/sql/ha_innodb.cc 2008-04-08 14:19:02.946097000 -0700 @@ -12,6 +12,7 @@ You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ +/* Copyright (C) 2007 Sun Microsystems, Inc. All rights reserved. Unpublished - rights reserved under the Copyright Laws of the United States.U.S. Government Rights - Commercial software. Government users are subject to the Sun Microsystems, Inc. standard license agreement and applicable provisions of the FAR and its supplements. Use is subject to license terms. Sun, Sun Microsystems, the Sun logo, Java, Solaris and Dynamic Tracing (DTrace) probes are trademarks or registered trademarks of Sun Microsystems, Inc. in the U.S. and other countries */ /* This file defines the InnoDB handler: the interface between MySQL and InnoDB NOTE: You can only use noninlined InnoDB functions in this file, because we @@ -43,6 +44,7 @@ #define MAX_ULONG_BIT ((ulong) 1 << (sizeof(ulong)*8-1)) #include "ha_innodb.h" +#include pthread_mutex_t innobase_share_mutex, /* to protect innobase_open_files */ prepare_commit_mutex; /* to force correct commit order in @@ -1507,7 +1509,7 @@ bool result = 0; DBUG_ENTER("innobase_flush_logs"); - + log_buffer_flush_to_disk(); DBUG_RETURN(result); @@ -4019,10 +4021,14 @@ mysql_byte* buf) /* in/out: buffer for next row in MySQL format */ { + DTRACE_INNODB_INDEX_NEXT_START(current_thd->query); statistic_increment(current_thd->status_var.ha_read_next_count, &LOCK_status); - return(general_fetch(buf, ROW_SEL_NEXT, 0)); +// return(general_fetch(buf, ROW_SEL_NEXT, 0)); + int a = general_fetch(buf, ROW_SEL_NEXT, 0); + DTRACE_INNODB_INDEX_NEXT_FINISH(current_thd->query); + return a; } /*********************************************************************** @@ -4037,10 +4043,14 @@ const mysql_byte* key, /* in: key value */ uint keylen) /* in: key value length */ { + DTRACE_INNODB_INDEX_NEXT_SAME_START(current_thd->query); statistic_increment(current_thd->status_var.ha_read_next_count, &LOCK_status); - return(general_fetch(buf, ROW_SEL_NEXT, last_match_mode)); + int a = general_fetch(buf, ROW_SEL_NEXT, last_match_mode); +// return(general_fetch(buf, ROW_SEL_NEXT, last_match_mode)); + DTRACE_INNODB_INDEX_NEXT_SAME_FINISH(current_thd->query); + return a; } /*************************************************************************** @@ -4057,8 +4067,12 @@ { statistic_increment(current_thd->status_var.ha_read_prev_count, &LOCK_status); + DTRACE_INNODB_INDEX_PREV_START(current_thd->query); + int a = general_fetch(buf, ROW_SEL_PREV, 0); +// return(general_fetch(buf, ROW_SEL_PREV, 0)); + DTRACE_INNODB_INDEX_PREV_FINISH(current_thd->query); + return a; - return(general_fetch(buf, ROW_SEL_PREV, 0)); } /************************************************************************ @@ -4072,6 +4086,7 @@ or error code */ mysql_byte* buf) /* in/out: buffer for the row */ { + DTRACE_INNODB_INDEX_FIRST_START(current_thd->query); int error; DBUG_ENTER("index_first"); @@ -4085,7 +4100,7 @@ if (error == HA_ERR_KEY_NOT_FOUND) { error = HA_ERR_END_OF_FILE; } - + DTRACE_INNODB_INDEX_FIRST_FINISH(current_thd->query); DBUG_RETURN(error); } @@ -4099,6 +4114,7 @@ /* out: 0, HA_ERR_END_OF_FILE, or error code */ mysql_byte* buf) /* in/out: buffer for the row */ { + DTRACE_INNODB_INDEX_LAST_START(current_thd->query); int error; DBUG_ENTER("index_last"); @@ -4112,7 +4128,7 @@ if (error == HA_ERR_KEY_NOT_FOUND) { error = HA_ERR_END_OF_FILE; } - + DTRACE_INNODB_INDEX_LAST_FINISH(current_thd->query); DBUG_RETURN(error); } @@ -4125,6 +4141,7 @@ /* out: 0 or error number */ bool scan) /* in: ???????? */ { + DTRACE_INNODB_RND_INIT_START(current_thd->query); int err; row_prebuilt_t* prebuilt = (row_prebuilt_t*) innobase_prebuilt; @@ -4139,6 +4156,7 @@ } start_of_scan = 1; + DTRACE_INNODB_RND_INIT_FINISH(current_thd->query); return(err); } @@ -4151,9 +4169,13 @@ /*======================*/ /* out: 0 or error number */ { - return(index_end()); -} + DTRACE_INNODB_RND_END_START(current_thd->query); + int a = index_end(); + DTRACE_INNODB_RND_END_FINISH(current_thd->query); + return a; +// return(index_end()); +} /********************************************************************* Reads the next row in a table scan (also used to read the FIRST row in a table scan). */ @@ -4165,6 +4187,7 @@ mysql_byte* buf)/* in/out: returns the row in this buffer, in MySQL format */ { + DTRACE_INNODB_RND_NEXT_START(current_thd->query); int error; DBUG_ENTER("rnd_next"); @@ -4180,6 +4203,7 @@ } else { error = general_fetch(buf, ROW_SEL_NEXT, 0); } + DTRACE_INNODB_RND_NEXT_FINISH(current_thd->query); DBUG_RETURN(error); } @@ -4199,6 +4223,7 @@ the length of data in pos has to be ref_length */ { + DTRACE_INNODB_RND_POS_START(current_thd->query); row_prebuilt_t* prebuilt = (row_prebuilt_t*) innobase_prebuilt; int error; uint keynr = active_index; @@ -4224,6 +4249,7 @@ if (error) { DBUG_PRINT("error", ("Got error: %d", error)); + DTRACE_INNODB_RND_POS_FINISH(current_thd->query); DBUG_RETURN(error); } @@ -4237,7 +4263,7 @@ } change_active_index(keynr); - + DTRACE_INNODB_RND_POS_FINISH(current_thd->query); DBUG_RETURN(error); } --- /old/mysql-5.0.41/mysys/thr_lock.c 2007-05-02 07:40:09.000000000 -0700 +++ /new/mysql-5.0.41/mysys/thr_lock.c 2008-03-05 17:40:45.741556000 -0800 @@ -12,6 +12,7 @@ You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ +/* Copyright (C) 2007 Sun Microsystems, Inc. All rights reserved. Unpublished - rights reserved under the Copyright Laws of the United States.U.S. Government Rights - Commercial software. Government users are subject to the Sun Microsystems, Inc. standard license agreement and applicable provisions of the FAR and its supplements. Use is subject to license terms. Sun, Sun Microsystems, the Sun logo, Java, Solaris and Dynamic Tracing (DTrace) probes are trademarks or registered trademarks of Sun Microsystems, Inc. in the U.S. and other countries */ /* Read and write locks for Posix threads. All tread must acquire @@ -75,7 +76,7 @@ #endif #include "mysys_priv.h" - +#include #ifdef THREAD #include "thr_lock.h" #include @@ -409,10 +410,12 @@ set_timespec(wait_timeout, table_lock_wait_timeout); while (!thread_var->abort || in_wait_list) { + DTRACE_MYISAM_WRLCK_START(); int rc= (can_deadlock ? pthread_cond_timedwait(cond, &data->lock->mutex, &wait_timeout) : pthread_cond_wait(cond, &data->lock->mutex)); + DTRACE_MYISAM_WRLCK_FINISH(); /* We must break the wait if one of the following occurs: - the connection has been aborted (!thread_var->abort), but --- /old/mysql-5.0.41/innobase/log/log0log.c 2007-05-02 07:40:44.000000000 -0700 +++ /new/mysql-5.0.41/innobase/log/log0log.c 2008-03-05 17:40:33.797421000 -0800 @@ -23,7 +23,7 @@ #include "srv0start.h" #include "trx0sys.h" #include "trx0trx.h" - +#include /* General philosophy of InnoDB redo-logs: @@ -209,18 +209,18 @@ len_upper_limit = LOG_BUF_WRITE_MARGIN + (5 * len) / 4; if (log->buf_free + len_upper_limit > log->buf_size) { - + mutex_exit(&(log->mutex)); /* Not enough free space, do a syncronous flush of the log buffer */ - + DTRACE_FLUSH_LOG_START(); log_buffer_flush_to_disk(); + DTRACE_FLUSH_LOG_FINISH(); srv_log_waits++; ut_ad(++count < 50); - goto loop; } --- /old/mysql-5.0.41/innobase/buf/buf0rea.c 2007-05-02 07:40:25.000000000 -0700 +++ /new/mysql-5.0.41/innobase/buf/buf0rea.c 2008-04-08 14:25:57.645635000 -0700 @@ -19,6 +19,7 @@ #include "trx0sys.h" #include "os0file.h" #include "srv0start.h" +#include extern ulint srv_read_ahead_rnd; extern ulint srv_read_ahead_seq; @@ -327,9 +328,10 @@ /* We do the i/o in the synchronous aio mode to save thread switches: hence TRUE */ - + DTRACE_INNODB_WAIT_BUFF_START(); count2 = buf_read_page_low(&err, TRUE, BUF_READ_ANY_PAGE, space, tablespace_version, offset); + DTRACE_INNODB_WAIT_BUFF_FINISH(); srv_buf_pool_reads+= count2; if (err == DB_TABLESPACE_DELETED) { ut_print_timestamp(stderr); @@ -376,7 +378,7 @@ ulint space, /* in: space id */ ulint offset) /* in: page number of a page; NOTE: the current thread must want access to this page (see NOTE 3 above) */ -{ +{ ib_longlong tablespace_version; buf_block_t* block; buf_frame_t* frame; --- /old/mysql-5.0.41/include/mysql_dtrace.h 1969-12-31 16:00:00.000000000 -0800 +++ /new/mysql-5.0.41/include/mysql_dtrace.h 2008-04-19 23:02:23.345054000 -0700 @@ -0,0 +1,294 @@ +/* Copyright (C) 2007 Sun Microsystems, Inc. All rights reserved. Unpublished - rights reserved under the Copyright Laws of the United States.U.S. Government Rights - Commercial software. Government users are subject to the Sun Microsystems, Inc. standard license agreement and applicable provisions of the FAR and its supplements. Use is subject to license terms. Sun, Sun Microsystems, the Sun logo, Java, Solaris and Dynamic Tracing (DTrace) probes are trademarks or registered trademarks of Sun Microsystems, Inc. in the U.S. and other countries */ + +#include "config.h" + +#ifndef _MYSQL_H +#define _MYSQL_H + +#ifdef __cplusplus +extern "C" { +#endif + +#ifdef ENABLE_DTRACE + +#define DTRACE_DATA_RECEIVE_FINISH(arg0) \ + __dtrace_mysql___data__receive__finish(arg0) +#define DTRACE_DATA_RECEIVE_FINISH_ENABLED() \ + __dtraceenabled_mysql___data__receive__finish() + +#define DTRACE_FLUSH_LOG_FINISH() \ + __dtrace_mysql___flush__log__finish() +#define DTRACE_FLUSH_LOG_FINISH_ENABLED() \ + __dtraceenabled_mysql___flush__log__finish() + +#define DTRACE_FLUSH_LOG_START() \ + __dtrace_mysql___flush__log__start() +#define DTRACE_FLUSH_LOG_START_ENABLED() \ + __dtraceenabled_mysql___flush__log__start() + +#define DTRACE_INNODB_WAIT_BUFF_FINISH() \ + __dtrace_mysql___innodb__wait__buff__finish() +#define DTRACE_INNODB_WAIT_BUFF_FINISH_ENABLED() \ + __dtraceenabled_mysql___innodb__wait__buff__finish() + +#define DTRACE_INNODB_WAIT_BUFF_START() \ + __dtrace_mysql___innodb__wait__buff__start() +#define DTRACE_INNODB_WAIT_BUFF_START_ENABLED() \ + __dtraceenabled_mysql___innodb__wait__buff__start() + +#define DTRACE_DATA_RECEIVE_START(arg0) \ + __dtrace_mysql___data__receive__start(arg0) +#define DTRACE_DATA_RECEIVE_START_ENABLED() \ + __dtraceenabled_mysql___data__receive__start() +#define DTRACE_INNODB_INDEX_FIRST_FINISH(arg0) \ + __dtrace_mysql___innodb__index__first__finish(arg0) +#define DTRACE_INNODB_INDEX_FIRST_FINISH_ENABLED() \ + __dtraceenabled_mysql___innodb__index__first__finish() +#define DTRACE_INNODB_INDEX_FIRST_START(arg0) \ + __dtrace_mysql___innodb__index__first__start(arg0) +#define DTRACE_INNODB_INDEX_FIRST_START_ENABLED() \ + __dtraceenabled_mysql___innodb__index__first__start() +#define DTRACE_INNODB_INDEX_LAST_FINISH(arg0) \ + __dtrace_mysql___innodb__index__last__finish(arg0) +#define DTRACE_INNODB_INDEX_LAST_FINISH_ENABLED() \ + __dtraceenabled_mysql___innodb__index__last__finish() +#define DTRACE_INNODB_INDEX_LAST_START(arg0) \ + __dtrace_mysql___innodb__index__last__start(arg0) +#define DTRACE_INNODB_INDEX_LAST_START_ENABLED() \ + __dtraceenabled_mysql___innodb__index__last__start() +#define DTRACE_INNODB_INDEX_NEXT_FINISH(arg0) \ + __dtrace_mysql___innodb__index__next__finish(arg0) +#define DTRACE_INNODB_INDEX_NEXT_FINISH_ENABLED() \ + __dtraceenabled_mysql___innodb__index__next__finish() +#define DTRACE_INNODB_INDEX_NEXT_SAME_FINISH(arg0) \ + __dtrace_mysql___innodb__index__next__same__finish(arg0) +#define DTRACE_INNODB_INDEX_NEXT_SAME_FINISH_ENABLED() \ + __dtraceenabled_mysql___innodb__index__next__same__finish() +#define DTRACE_INNODB_INDEX_NEXT_SAME_START(arg0) \ + __dtrace_mysql___innodb__index__next__same__start(arg0) +#define DTRACE_INNODB_INDEX_NEXT_SAME_START_ENABLED() \ + __dtraceenabled_mysql___innodb__index__next__same__start() +#define DTRACE_INNODB_INDEX_NEXT_START(arg0) \ + __dtrace_mysql___innodb__index__next__start(arg0) +#define DTRACE_INNODB_INDEX_NEXT_START_ENABLED() \ + __dtraceenabled_mysql___innodb__index__next__start() +#define DTRACE_INNODB_INDEX_PREV_FINISH(arg0) \ + __dtrace_mysql___innodb__index__prev__finish(arg0) +#define DTRACE_INNODB_INDEX_PREV_FINISH_ENABLED() \ + __dtraceenabled_mysql___innodb__index__prev__finish() +#define DTRACE_INNODB_INDEX_PREV_START(arg0) \ + __dtrace_mysql___innodb__index__prev__start(arg0) +#define DTRACE_INNODB_INDEX_PREV_START_ENABLED() \ + __dtraceenabled_mysql___innodb__index__prev__start() +#define DTRACE_INNODB_RND_END_FINISH(arg0) \ + __dtrace_mysql___innodb__rnd__end__finish(arg0) +#define DTRACE_INNODB_RND_END_FINISH_ENABLED() \ + __dtraceenabled_mysql___innodb__rnd__end__finish() +#define DTRACE_INNODB_RND_END_START(arg0) \ + __dtrace_mysql___innodb__rnd__end__start(arg0) +#define DTRACE_INNODB_RND_END_START_ENABLED() \ + __dtraceenabled_mysql___innodb__rnd__end__start() +#define DTRACE_INNODB_RND_INIT_FINISH(arg0) \ + __dtrace_mysql___innodb__rnd__init__finish(arg0) +#define DTRACE_INNODB_RND_INIT_FINISH_ENABLED() \ + __dtraceenabled_mysql___innodb__rnd__init__finish() +#define DTRACE_INNODB_RND_INIT_START(arg0) \ + __dtrace_mysql___innodb__rnd__init__start(arg0) +#define DTRACE_INNODB_RND_INIT_START_ENABLED() \ + __dtraceenabled_mysql___innodb__rnd__init__start() +#define DTRACE_INNODB_RND_NEXT_FINISH(arg0) \ + __dtrace_mysql___innodb__rnd__next__finish(arg0) +#define DTRACE_INNODB_RND_NEXT_FINISH_ENABLED() \ + __dtraceenabled_mysql___innodb__rnd__next__finish() +#define DTRACE_INNODB_RND_NEXT_START(arg0) \ + __dtrace_mysql___innodb__rnd__next__start(arg0) +#define DTRACE_INNODB_RND_NEXT_START_ENABLED() \ + __dtraceenabled_mysql___innodb__rnd__next__start() +#define DTRACE_INNODB_RND_POS_FINISH(arg0) \ + __dtrace_mysql___innodb__rnd__pos__finish(arg0) +#define DTRACE_INNODB_RND_POS_FINISH_ENABLED() \ + __dtraceenabled_mysql___innodb__rnd__pos__finish() +#define DTRACE_INNODB_RND_POS_START(arg0) \ + __dtrace_mysql___innodb__rnd__pos__start(arg0) +#define DTRACE_INNODB_RND_POS_START_ENABLED() \ + __dtraceenabled_mysql___innodb__rnd__pos__start() +#define DTRACE_MYISAM_WRLCK_FINISH() \ + __dtrace_mysql___myisam__wrlck__finish() +#define DTRACE_MYISAM_WRLCK_FINISH_ENABLED() \ + __dtraceenabled_mysql___myisam__wrlck__finish() +#define DTRACE_MYISAM_WRLCK_START() \ + __dtrace_mysql___myisam__wrlck__start() +#define DTRACE_MYISAM_WRLCK_START_ENABLED() \ + __dtraceenabled_mysql___myisam__wrlck__start() +#define DTRACE_QUERY_CACHE_HIT(arg0, arg1, arg2, arg3, arg4) \ + __dtrace_mysql___query__cache__hit(arg0, arg1, arg2, arg3, arg4) +#define DTRACE_QUERY_CACHE_HIT_ENABLED() \ + __dtraceenabled_mysql___query__cache__hit() +#define DTRACE_QUERY_CACHE_MISS(arg0, arg1, arg2, arg3, arg4) \ + __dtrace_mysql___query__cache__miss(arg0, arg1, arg2, arg3, arg4) +#define DTRACE_QUERY_CACHE_MISS_ENABLED() \ + __dtraceenabled_mysql___query__cache__miss() +#define DTRACE_QUERY_EXECUTE_FINISH(arg0, arg1, arg2, arg3, arg4, arg5) \ + __dtrace_mysql___query__execute__finish(arg0, arg1, arg2, arg3, arg4, arg5) +#define DTRACE_QUERY_EXECUTE_FINISH_ENABLED() \ + __dtraceenabled_mysql___query__execute__finish() +#define DTRACE_QUERY_EXECUTE_START(arg0, arg1, arg2, arg3, arg4) \ + __dtrace_mysql___query__execute__start(arg0, arg1, arg2, arg3, arg4) +#define DTRACE_QUERY_EXECUTE_START_ENABLED() \ + __dtraceenabled_mysql___query__execute__start() +#define DTRACE_QUERY_PLAN_FINISH(arg0) \ + __dtrace_mysql___query__plan__finish(arg0) +#define DTRACE_QUERY_PLAN_FINISH_ENABLED() \ + __dtraceenabled_mysql___query__plan__finish() +#define DTRACE_QUERY_PLAN_START(arg0) \ + __dtrace_mysql___query__plan__start(arg0) +#define DTRACE_QUERY_PLAN_START_ENABLED() \ + __dtraceenabled_mysql___query__plan__start() + + +extern void __dtrace_mysql___data__receive__finish(int); +extern int __dtraceenabled_mysql___data__receive__finish(void); +extern void __dtrace_mysql___data__receive__start(int); +extern int __dtraceenabled_mysql___data__receive__start(void); +extern void __dtrace_mysql___innodb__index__first__finish(char *); +extern int __dtraceenabled_mysql___innodb__index__first__finish(void); +extern void __dtrace_mysql___innodb__index__first__start(char *); +extern int __dtraceenabled_mysql___innodb__index__first__start(void); +extern void __dtrace_mysql___innodb__index__last__finish(char *); +extern int __dtraceenabled_mysql___innodb__index__last__finish(void); +extern void __dtrace_mysql___innodb__index__last__start(char *); +extern int __dtraceenabled_mysql___innodb__index__last__start(void); +extern void __dtrace_mysql___innodb__index__next__finish(char *); +extern int __dtraceenabled_mysql___innodb__index__next__finish(void); +extern void __dtrace_mysql___innodb__index__next__same__finish(char *); +extern int __dtraceenabled_mysql___innodb__index__next__same__finish(void); +extern void __dtrace_mysql___innodb__index__next__same__start(char *); +extern int __dtraceenabled_mysql___innodb__index__next__same__start(void); +extern void __dtrace_mysql___innodb__index__next__start(char *); +extern int __dtraceenabled_mysql___innodb__index__next__start(void); +extern void __dtrace_mysql___innodb__index__prev__finish(char *); +extern int __dtraceenabled_mysql___innodb__index__prev__finish(void); +extern void __dtrace_mysql___innodb__index__prev__start(char *); +extern int __dtraceenabled_mysql___innodb__index__prev__start(void); +extern void __dtrace_mysql___innodb__rnd__end__finish(char *); +extern int __dtraceenabled_mysql___innodb__rnd__end__finish(void); +extern void __dtrace_mysql___innodb__rnd__end__start(char *); +extern int __dtraceenabled_mysql___innodb__rnd__end__start(void); +extern void __dtrace_mysql___innodb__rnd__init__finish(char *); +extern int __dtraceenabled_mysql___innodb__rnd__init__finish(void); +extern void __dtrace_mysql___innodb__rnd__init__start(char *); +extern int __dtraceenabled_mysql___innodb__rnd__init__start(void); +extern void __dtrace_mysql___innodb__rnd__next__finish(char *); +extern int __dtraceenabled_mysql___innodb__rnd__next__finish(void); +extern void __dtrace_mysql___innodb__rnd__next__start(char *); +extern int __dtraceenabled_mysql___innodb__rnd__next__start(void); +extern void __dtrace_mysql___innodb__rnd__pos__finish(char *); +extern int __dtraceenabled_mysql___innodb__rnd__pos__finish(void); +extern void __dtrace_mysql___innodb__rnd__pos__start(char *); +extern int __dtraceenabled_mysql___innodb__rnd__pos__start(void); +extern void __dtrace_mysql___myisam__wrlck__finish(void); +extern int __dtraceenabled_mysql___myisam__wrlck__finish(void); +extern void __dtrace_mysql___myisam__wrlck__start(void); +extern int __dtraceenabled_mysql___myisam__wrlck__start(void); +extern void __dtrace_mysql___flush__log__start(void); +extern int __dtraceenabled_mysql___flush__log__start(void); +extern void __dtrace_mysql___flush__log__finish(void); +extern int __dtraceenabled_mysql___flush__log__finish(void); +extern void __dtrace_mysql___innodb__wait__buff__start(void); +extern int __dtraceenabled_mysql___innodb__wait__buff__start(void); +extern void __dtrace_mysql___innodb__wait__buff__finish(void); +extern int __dtraceenabled_mysql___innodb__wait__buff__finish(void); +extern void __dtrace_mysql___query__cache__hit(void *, char *, char *, char *, char *); +extern int __dtraceenabled_mysql___query__cache__hit(void); +extern void __dtrace_mysql___query__cache__miss(void *, char *, char *, char *, char *); +extern int __dtraceenabled_mysql___query__cache__miss(void); +extern void __dtrace_mysql___query__execute__finish(void *, char *, char *, char *, char *, int); +extern int __dtraceenabled_mysql___query__execute__finish(void); +extern void __dtrace_mysql___query__execute__start(void *, char *, char *, char *, char *); +extern int __dtraceenabled_mysql___query__execute__start(void); +extern void __dtrace_mysql___query__plan__finish(char *); +extern int __dtraceenabled_mysql___query__plan__finish(void); +extern void __dtrace_mysql___query__plan__start(char *); +extern int __dtraceenabled_mysql___query__plan__start(void); + +#else +/* + * Unless DTrace is explicitly enabled with --enable-dtrace, the DTRACE + * macros will expand to no-ops. + */ +#define DTRACE_DATA_RECEIVE_FINISH(arg0) +#define DTRACE_DATA_RECEIVE_FINISH_ENABLED() +#define DTRACE_DATA_RECEIVE_START(arg0) +#define DTRACE_DATA_RECEIVE_START_ENABLED() + +#define DTRACE_FLUSH_LOG_FINISH() +#define DTRACE_FLUSH_LOG_FINISH_ENABLED() +#define DTRACE_FLUSH_LOG_START() +#define DTRACE_FLUSH_LOG_START_ENABLED() + +#define DTRACE_INNODB_WAIT_BUFF_FINISH() +#define DTRACE_INNODB_WAIT_BUFF_FINISH_ENABLED() +#define DTRACE_INNODB_WAIT_BUFF_START() +#define DTRACE_INNODB_WAIT_BUFF_START_ENABLED() + +#define DTRACE_INNODB_INDEX_FIRST_FINISH(arg0) +#define DTRACE_INNODB_INDEX_FIRST_FINISH_ENABLED() +#define DTRACE_INNODB_INDEX_FIRST_START(arg0) +#define DTRACE_INNODB_INDEX_FIRST_START_ENABLED() +#define DTRACE_INNODB_INDEX_LAST_FINISH(arg0) +#define DTRACE_INNODB_INDEX_LAST_FINISH_ENABLED() +#define DTRACE_INNODB_INDEX_LAST_START(arg0) +#define DTRACE_INNODB_INDEX_LAST_START_ENABLED() +#define DTRACE_INNODB_INDEX_NEXT_FINISH(arg0) +#define DTRACE_INNODB_INDEX_NEXT_FINISH_ENABLED() +#define DTRACE_INNODB_INDEX_NEXT_SAME_FINISH(arg0) +#define DTRACE_INNODB_INDEX_NEXT_SAME_FINISH_ENABLED() +#define DTRACE_INNODB_INDEX_NEXT_SAME_START(arg0) +#define DTRACE_INNODB_INDEX_NEXT_SAME_START_ENABLED() +#define DTRACE_INNODB_INDEX_NEXT_START(arg0) +#define DTRACE_INNODB_INDEX_NEXT_START_ENABLED() +#define DTRACE_INNODB_INDEX_PREV_FINISH(arg0) +#define DTRACE_INNODB_INDEX_PREV_FINISH_ENABLED() +#define DTRACE_INNODB_INDEX_PREV_START(arg0) +#define DTRACE_INNODB_INDEX_PREV_START_ENABLED() +#define DTRACE_INNODB_RND_END_FINISH(arg0) +#define DTRACE_INNODB_RND_END_FINISH_ENABLED() +#define DTRACE_INNODB_RND_END_START(arg0) +#define DTRACE_INNODB_RND_END_START_ENABLED() +#define DTRACE_INNODB_RND_INIT_FINISH(arg0) +#define DTRACE_INNODB_RND_INIT_FINISH_ENABLED() +#define DTRACE_INNODB_RND_INIT_START(arg0) +#define DTRACE_INNODB_RND_INIT_START_ENABLED() +#define DTRACE_INNODB_RND_NEXT_FINISH(arg0) +#define DTRACE_INNODB_RND_NEXT_FINISH_ENABLED() +#define DTRACE_INNODB_RND_NEXT_START(arg0) +#define DTRACE_INNODB_RND_NEXT_START_ENABLED() +#define DTRACE_INNODB_RND_POS_FINISH(arg0) +#define DTRACE_INNODB_RND_POS_FINISH_ENABLED() +#define DTRACE_INNODB_RND_POS_START(arg0) +#define DTRACE_INNODB_RND_POS_START_ENABLED() +#define DTRACE_MYISAM_WRLCK_FINISH() +#define DTRACE_MYISAM_WRLCK_FINISH_ENABLED() +#define DTRACE_MYISAM_WRLCK_START() +#define DTRACE_MYISAM_WRLCK_START_ENABLED() +#define DTRACE_QUERY_CACHE_HIT(arg0, arg1, arg2, arg3, arg4) +#define DTRACE_QUERY_CACHE_HIT_ENABLED() (0) +#define DTRACE_QUERY_CACHE_MISS(arg0, arg1, arg2, arg3, arg4) +#define DTRACE_QUERY_CACHE_MISS_ENABLED() (0) +#define DTRACE_QUERY_EXECUTE_FINISH(arg0, arg1, arg2, arg3, arg4, arg5) +#define DTRACE_QUERY_EXECUTE_FINISH_ENABLED() +#define DTRACE_QUERY_EXECUTE_START(arg0, arg1, arg2, arg3, arg4) +#define DTRACE_QUERY_EXECUTE_START_ENABLED() +#define DTRACE_QUERY_PLAN_FINISH(arg0) +#define DTRACE_QUERY_PLAN_FINISH_ENABLED() +#define DTRACE_QUERY_PLAN_START(arg0) +#define DTRACE_QUERY_PLAN_START_ENABLED() + +#endif /* not ENABLE_DTRACE */ + +#ifdef __cplusplus +} +#endif + +#endif /* _MYSQL_H */ + --- /old/mysql-5.0.41/sql/Makefile.in 2007-05-02 07:43:23.000000000 -0700 +++ /new/mysql-5.0.41/sql/Makefile.in 2008-04-01 15:51:07.481698000 -0700 @@ -13,6 +13,7 @@ # PARTICULAR PURPOSE. @SET_MAKE@ +# Copyright (C) 2007 Sun Microsystems, Inc. All rights reserved. Unpublished - rights reserved under the Copyright Laws of the United States.U.S. Government Rights - Commercial software. Government users are subject to the Sun Microsystems, Inc. standard license agreement and applicable provisions of the FAR and its supplements. Use is subject to license terms. Sun, Sun Microsystems, the Sun logo, Java, Solaris and Dynamic Tracing (DTrace) probes are trademarks or registered trademarks of Sun Microsystems, Inc. in the U.S. and other countries # Copyright (C) 2000-2006 MySQL AB # @@ -111,6 +112,9 @@ mysql_tzinfo_to_sql_OBJECTS = $(am_mysql_tzinfo_to_sql_OBJECTS) mysql_tzinfo_to_sql_DEPENDENCIES = $(am__DEPENDENCIES_1) \ $(am__DEPENDENCIES_2) +enable_dtrace = @enable_dtrace@ +DTRACEFLAGS = @DTRACEFLAGS@ +dtrace_OBJECTS = $(top_srcdir)/mysys/thr_lock.o $(top_srcdir)/innobase/log/log0log.o $(top_srcdir)/innobase/buf/buf0rea.o am_mysqld_OBJECTS = sql_lex.$(OBJEXT) sql_handler.$(OBJEXT) \ item.$(OBJEXT) item_sum.$(OBJEXT) item_buff.$(OBJEXT) \ item_func.$(OBJEXT) item_cmpfunc.$(OBJEXT) \ @@ -152,7 +156,11 @@ parse_file.$(OBJEXT) sql_trigger.$(OBJEXT) \ ha_example.$(OBJEXT) ha_archive.$(OBJEXT) ha_tina.$(OBJEXT) \ ha_blackhole.$(OBJEXT) ha_federated.$(OBJEXT) -mysqld_OBJECTS = $(am_mysqld_OBJECTS) +ifeq ($(enable_dtrace),yes) + mysqld_OBJECTS = $(am_mysqld_OBJECTS) mysql_dtrace.$(OBJEXT) +else + mysqld_OBJECTS = $(am_mysqld_OBJECTS) +endif mysqld_DEPENDENCIES = $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_2) \ $(am__DEPENDENCIES_2) $(am__DEPENDENCIES_2) \ $(am__DEPENDENCIES_2) @@ -824,6 +832,9 @@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(CXXCOMPILE) -c -o $@ $< +mysql_dtrace.o:$(top_srcdir)/include/mysql_dtrace.d $(am_mysqld_OBJECTS) + dtrace -G $(DTRACEFLAGS) -s $(top_srcdir)/include/mysql_dtrace.d $(am_mysqld_OBJECTS) $(dtrace_OBJECTS) + .cc.obj: @am__fastdepCXX_TRUE@ if $(CXXCOMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ `$(CYGPATH_W) '$<'`; \ @am__fastdepCXX_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi --- /old/mysql-5.0.41/mysys/Makefile.in 2007-05-02 07:42:29.000000000 -0700 +++ /new/mysql-5.0.41/mysys/Makefile.in 2008-04-01 15:51:07.521680000 -0700 @@ -13,6 +13,7 @@ # PARTICULAR PURPOSE. @SET_MAKE@ +# Copyright (C) 2007 Sun Microsystems, Inc. All rights reserved. Unpublished - rights reserved under the Copyright Laws of the United States.U.S. Government Rights - Commercial software. Government users are subject to the Sun Microsystems, Inc. standard license agreement and applicable provisions of the FAR and its supplements. Use is subject to license terms. Sun, Sun Microsystems, the Sun logo, Java, Solaris and Dynamic Tracing (DTrace) probes are trademarks or registered trademarks of Sun Microsystems, Inc. in the U.S. and other countries # Copyright (C) 2000-2006 MySQL AB # @@ -43,6 +44,8 @@ install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) +enable_dtrace = @enable_dtrace@ +DTRACEFLAGS = @DTRACEFLAGS@ transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : @@ -128,7 +131,12 @@ my_handler.$(OBJEXT) my_netware.$(OBJEXT) \ my_largepage.$(OBJEXT) my_memmem.$(OBJEXT) my_windac.$(OBJEXT) \ my_access.$(OBJEXT) base64.$(OBJEXT) my_libwrap.$(OBJEXT) -libmysys_a_OBJECTS = $(am_libmysys_a_OBJECTS) +ifeq ($(enable_dtrace),yes) + libmysys_a_OBJECTS = $(am_libmysys_a_OBJECTS) mysql_dtrace.o +else + libmysys_a_OBJECTS = $(am_libmysys_a_OBJECTS) +endif + DEFAULT_INCLUDES = -I. -I$(srcdir) -I$(top_builddir) depcomp = $(SHELL) $(top_srcdir)/depcomp am__depfiles_maybe = depfiles @@ -664,6 +672,10 @@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(COMPILE) -c $< +mysql_dtrace.o:$(top_srcdir)/include/mysql_dtrace.d $(THREAD_LOBJECTS) + dtrace -G $(DTRACEFLAGS) -s $(top_srcdir)/include/mysql_dtrace.d $(THREAD_LOBJECTS) + + .c.obj: @am__fastdepCC_TRUE@ if $(COMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ `$(CYGPATH_W) '$<'`; \ @am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi --- /old/mysql-5.0.41/configure.in 2007-05-02 07:39:58.000000000 -0700 +++ /new/mysql-5.0.41/configure.in 2008-03-05 17:40:36.632692000 -0800 @@ -653,6 +653,17 @@ [ THREAD_SAFE_CLIENT=no ] ) +#DTrace support +AC_ARG_ENABLE(dtrace, + [ --enable-dtrace Build with DTrace support], + [ ENABLE_DTRACE=$enableval]) +if test "$ENABLE_DTRACE" == "yes"; then + AC_DEFINE([ENABLE_DTRACE],[1],[Build with DTrace support]) +fi + AC_SUBST(DTRACEFLAGS) + AC_SUBST(enable_dtrace) + + # compile with strings functions in assembler AC_ARG_ENABLE(assembler, [ --enable-assembler Use assembler versions of some string @@ -2940,6 +2951,7 @@ AC_CONFIG_COMMANDS([default], , test -z "$CONFIG_HEADERS" || echo timestamp > stamp-h) AC_OUTPUT +cp config.h include/ echo echo "MySQL has a Web site at http://www.mysql.com/ which carries details on the" echo "latest release, upcoming features, and other information to make your" --- /old/mysql-5.0.41/config.h.in 2007-05-02 07:41:48.000000000 -0700 +++ /new/mysql-5.0.41/config.h.in 2008-04-01 15:55:01.183870000 -0700 @@ -27,6 +27,9 @@ /* If SHOW PROFILE should be enabled */ #undef ENABLED_PROFILING +/* Build with DTrace support */ +#undef ENABLE_DTRACE + /* Do we have FIONREAD */ #undef FIONREAD_IN_SYS_IOCTL --- /old/mysql-5.0.41/configure 2008-04-19 23:41:19.575319000 -0700 +++ /new/mysql-5.0.41/configure 2008-04-01 15:51:59.325865000 -0700 @@ -477,7 +477,7 @@ #endif" ac_subdirs_all="$ac_subdirs_all innobase" -ac_subst_vars='SHELL PATH_SEPARATOR PACKAGE_NAME PACKAGE_TARNAME PACKAGE_VERSION PACKAGE_STRING PACKAGE_BUGREPORT exec_prefix prefix program_transform_name bindir sbindir libexecdir datadir sysconfdir sharedstatedir localstatedir libdir includedir oldincludedir infodir mandir build_alias host_alias target_alias DEFS ECHO_C ECHO_N ECHO_T LIBS build build_cpu build_vendor build_os host host_cpu host_vendor host_os target target_cpu target_vendor target_os INSTALL_PROGRAM INSTALL_SCRIPT INSTALL_DATA CYGPATH_W PACKAGE VERSION ACLOCAL AUTOCONF AUTOMAKE AUTOHEADER MAKEINFO install_sh STRIP ac_ct_STRIP INSTALL_STRIP_PROGRAM mkdir_p AWK SET_MAKE am__leading_dot AMTAR am__tar am__untar MYSQL_NO_DASH_VERSION MYSQL_BASE_VERSION MYSQL_VERSION_ID PROTOCOL_VERSION DOT_FRM_VERSION SHARED_LIB_MAJOR_VERSION SHARED_LIB_VERSION NDB_SHARED_LIB_MAJOR_VERSION NDB_SHARED_LIB_VERSION AVAILABLE_LANGUAGES NDB_VERSION_MAJOR NDB_VERSION_MINOR NDB_VERSION_BUILD NDB_VERSION_STATUS SYSTEM_TYPE MACHINE_TYPE CONF_COMMAND SAVE_ASFLAGS SAVE_CFLAGS SAVE_CXXFLAGS SAVE_LDFLAGS SAVE_CXXLDFLAGS CXXLDFLAGS AR RANLIB DARWIN_MWCC_TRUE DARWIN_MWCC_FALSE CC CFLAGS LDFLAGS CPPFLAGS ac_ct_CC EXEEXT OBJEXT DEPDIR am__include am__quote AMDEP_TRUE AMDEP_FALSE AMDEPBACKSLASH CCDEPMODE am__fastdepCC_TRUE am__fastdepCC_FALSE CXX CXXFLAGS ac_ct_CXX CXXDEPMODE am__fastdepCXX_TRUE am__fastdepCXX_FALSE CPP CC_VERSION CXX_VERSION AS ac_ct_RANLIB EGREP LN_S ECHO ac_ct_AR CXXCPP F77 FFLAGS ac_ct_F77 LIBTOOL NM YACC PDFMANUAL DVIS uname_prog LD ARFLAGS LD_VERSION_SCRIPT MYSQLD_DEFAULT_SWITCHES TARGET_LINUX LN LN_CP_F MV RM CP SED CMP CHMOD HOSTNAME TAR PERL PERL5 DOXYGEN PDFLATEX MAKEINDEX ICHECK PS FIND_PROC KILL CHECK_PID CCAS CCASFLAGS NOINST_LDFLAGS MYSQL_SERVER_SUFFIX ASSEMBLER_x86_TRUE ASSEMBLER_x86_FALSE ASSEMBLER_sparc32_TRUE ASSEMBLER_sparc32_FALSE ASSEMBLER_sparc64_TRUE ASSEMBLER_sparc64_FALSE ASSEMBLER_TRUE ASSEMBLER_FALSE MYSQL_UNIX_ADDR MYSQL_TCP_PORT MYSQL_TCP_PORT_DEFAULT MYSQLD_USER GETCONF ac_ct_GETCONF zlib_dir ZLIB_LIBS ZLIB_DEPS ZLIB_INCLUDES WRAPLIBS pstack_dirs pstack_libs COMPILE_PSTACK_TRUE COMPILE_PSTACK_FALSE LIBDL MYSQLD_EXTRA_LDFLAGS CLIENT_EXTRA_LDFLAGS LIB_EXTRA_CCFLAGS LM_CFLAGS COMPILATION_COMMENT ALLOCA MAKE_SHELL TERMCAP_LIB LIBEDIT_LOBJECTS tools_dirs openssl_libs openssl_includes yassl_taocrypt_extra_cxxflags yassl_h_ln_cmd yassl_libs yassl_dir HAVE_YASSL_TRUE HAVE_YASSL_FALSE libmysqld_dirs linked_libmysqld_targets docs_dirs bench_dirs readline_dir readline_topdir readline_basedir readline_link readline_h_ln_cmd bdb_includes bdb_libs bdb_libs_with_path innodb_includes innodb_libs innodb_system_libs NDB_SCI_INCLUDES NDB_SCI_LIBS NDB_LD_VERSION_SCRIPT HAVE_NDBCLUSTER_DB_TRUE HAVE_NDBCLUSTER_DB_FALSE ndbcluster_includes ndbcluster_libs ndbcluster_system_libs ndb_mgmclient_libs man_dirs man1_files man8_files CLIENT_LIBS NON_THREADED_LIBS STATIC_NSS_FLAGS sql_client_dirs linked_client_targets netware_dir linked_netware_sources HAVE_NETWARE_TRUE HAVE_NETWARE_FALSE THREAD_LOBJECTS subdirs sql_server_dirs thread_dirs server_scripts sql_union_dirs GXX NDB_DEFS ndb_cxxflags_fix ndb_port ndb_transporter_opt_objs ndb_bin_am_ldflags ndb_opt_subdirs NDB_SIZEOF_CHARP NDB_SIZEOF_CHAR NDB_SIZEOF_SHORT NDB_SIZEOF_INT NDB_SIZEOF_LONG NDB_SIZEOF_LONG_LONG MAKE_BINARY_DISTRIBUTION_OPTIONS LIBOBJS LTLIBOBJS' +ac_subst_vars='SHELL PATH_SEPARATOR PACKAGE_NAME PACKAGE_TARNAME PACKAGE_VERSION PACKAGE_STRING PACKAGE_BUGREPORT exec_prefix prefix program_transform_name bindir sbindir libexecdir datadir sysconfdir sharedstatedir localstatedir libdir includedir oldincludedir infodir mandir build_alias host_alias target_alias DEFS ECHO_C ECHO_N ECHO_T LIBS build build_cpu build_vendor build_os host host_cpu host_vendor host_os target target_cpu target_vendor target_os INSTALL_PROGRAM INSTALL_SCRIPT INSTALL_DATA CYGPATH_W PACKAGE VERSION ACLOCAL AUTOCONF AUTOMAKE AUTOHEADER MAKEINFO install_sh STRIP ac_ct_STRIP INSTALL_STRIP_PROGRAM mkdir_p AWK SET_MAKE am__leading_dot AMTAR am__tar am__untar MYSQL_NO_DASH_VERSION MYSQL_BASE_VERSION MYSQL_VERSION_ID PROTOCOL_VERSION DOT_FRM_VERSION SHARED_LIB_MAJOR_VERSION SHARED_LIB_VERSION NDB_SHARED_LIB_MAJOR_VERSION NDB_SHARED_LIB_VERSION AVAILABLE_LANGUAGES NDB_VERSION_MAJOR NDB_VERSION_MINOR NDB_VERSION_BUILD NDB_VERSION_STATUS SYSTEM_TYPE MACHINE_TYPE CONF_COMMAND SAVE_ASFLAGS SAVE_CFLAGS SAVE_CXXFLAGS SAVE_LDFLAGS SAVE_CXXLDFLAGS CXXLDFLAGS AR RANLIB DARWIN_MWCC_TRUE DARWIN_MWCC_FALSE CC CFLAGS LDFLAGS CPPFLAGS ac_ct_CC EXEEXT OBJEXT DEPDIR am__include am__quote AMDEP_TRUE AMDEP_FALSE AMDEPBACKSLASH CCDEPMODE am__fastdepCC_TRUE am__fastdepCC_FALSE CXX CXXFLAGS ac_ct_CXX CXXDEPMODE am__fastdepCXX_TRUE am__fastdepCXX_FALSE CPP CC_VERSION CXX_VERSION AS ac_ct_RANLIB EGREP LN_S ECHO ac_ct_AR CXXCPP F77 FFLAGS ac_ct_F77 LIBTOOL NM YACC PDFMANUAL DVIS uname_prog LD ARFLAGS LD_VERSION_SCRIPT MYSQLD_DEFAULT_SWITCHES TARGET_LINUX LN LN_CP_F MV RM CP SED CMP CHMOD HOSTNAME TAR PERL PERL5 DOXYGEN PDFLATEX MAKEINDEX ICHECK PS FIND_PROC KILL CHECK_PID CCAS CCASFLAGS NOINST_LDFLAGS MYSQL_SERVER_SUFFIX DTRACEFLAGS enable_dtrace ASSEMBLER_x86_TRUE ASSEMBLER_x86_FALSE ASSEMBLER_sparc32_TRUE ASSEMBLER_sparc32_FALSE ASSEMBLER_sparc64_TRUE ASSEMBLER_sparc64_FALSE ASSEMBLER_TRUE ASSEMBLER_FALSE MYSQL_UNIX_ADDR MYSQL_TCP_PORT MYSQL_TCP_PORT_DEFAULT MYSQLD_USER GETCONF ac_ct_GETCONF zlib_dir ZLIB_LIBS ZLIB_DEPS ZLIB_INCLUDES WRAPLIBS pstack_dirs pstack_libs COMPILE_PSTACK_TRUE COMPILE_PSTACK_FALSE LIBDL MYSQLD_EXTRA_LDFLAGS CLIENT_EXTRA_LDFLAGS LIB_EXTRA_CCFLAGS LM_CFLAGS COMPILATION_COMMENT ALLOCA MAKE_SHELL TERMCAP_LIB LIBEDIT_LOBJECTS tools_dirs openssl_libs openssl_includes yassl_taocrypt_extra_cxxflags yassl_h_ln_cmd yassl_libs yassl_dir HAVE_YASSL_TRUE HAVE_YASSL_FALSE libmysqld_dirs linked_libmysqld_targets docs_dirs bench_dirs readline_dir readline_topdir readline_basedir readline_link readline_h_ln_cmd bdb_includes bdb_libs bdb_libs_with_path innodb_includes innodb_libs innodb_system_libs NDB_SCI_INCLUDES NDB_SCI_LIBS NDB_LD_VERSION_SCRIPT HAVE_NDBCLUSTER_DB_TRUE HAVE_NDBCLUSTER_DB_FALSE ndbcluster_includes ndbcluster_libs ndbcluster_system_libs ndb_mgmclient_libs man_dirs man1_files man8_files CLIENT_LIBS NON_THREADED_LIBS STATIC_NSS_FLAGS sql_client_dirs linked_client_targets netware_dir linked_netware_sources HAVE_NETWARE_TRUE HAVE_NETWARE_FALSE THREAD_LOBJECTS subdirs sql_server_dirs thread_dirs server_scripts sql_union_dirs GXX NDB_DEFS ndb_cxxflags_fix ndb_port ndb_transporter_opt_objs ndb_bin_am_ldflags ndb_opt_subdirs NDB_SIZEOF_CHARP NDB_SIZEOF_CHAR NDB_SIZEOF_SHORT NDB_SIZEOF_INT NDB_SIZEOF_LONG NDB_SIZEOF_LONG_LONG MAKE_BINARY_DISTRIBUTION_OPTIONS LIBOBJS LTLIBOBJS' ac_subst_files='' # Initialize some variables set by options. @@ -1057,6 +1057,7 @@ --disable-libtool-lock avoid locking (might break parallel builds) --enable-thread-safe-client Compile the client with threads. + --enable-dtrace Build with DTrace support --enable-assembler Use assembler versions of some string functions if available. --disable-profiling Build a version without query profiling code @@ -21932,6 +21933,20 @@ fi; +#DTrace support +# Check whether --enable-dtrace or --disable-dtrace was given. +if test "${enable_dtrace+set}" = set; then + enableval="$enable_dtrace" + ENABLE_DTRACE=$enableval +fi; +if test "$ENABLE_DTRACE" == "yes"; then + +cat >>confdefs.h <<\_ACEOF +#define ENABLE_DTRACE 1 +_ACEOF + +fi + # compile with strings functions in assembler # Check whether --enable-assembler or --disable-assembler was given. if test "${enable_assembler+set}" = set; then @@ -42618,6 +42633,8 @@ s,@CCASFLAGS@,$CCASFLAGS,;t t s,@NOINST_LDFLAGS@,$NOINST_LDFLAGS,;t t s,@MYSQL_SERVER_SUFFIX@,$MYSQL_SERVER_SUFFIX,;t t +s,@DTRACEFLAGS@,$DTRACEFLAGS,;t t +s,@enable_dtrace@,$enable_dtrace,;t t s,@ASSEMBLER_x86_TRUE@,$ASSEMBLER_x86_TRUE,;t t s,@ASSEMBLER_x86_FALSE@,$ASSEMBLER_x86_FALSE,;t t s,@ASSEMBLER_sparc32_TRUE@,$ASSEMBLER_sparc32_TRUE,;t t --- /old/mysql-5.0.41/include/mysql_dtrace.d 1969-12-31 16:00:00.000000000 -0800 +++ /new/mysql-5.0.41/include/mysql_dtrace.d 2008-04-08 13:49:41.571271000 -0700 @@ -0,0 +1,37 @@ +/* Copyright (C) 2007 Sun Microsystems, Inc. All rights reserved. Unpublished - rights reserved under the Copyright Laws of the United States.U.S. Government Rights - Commercial software. Government users are subject to the Sun Microsystems, Inc. standard license agreement and applicable provisions of the FAR and its supplements. Use is subject to license terms. Sun, Sun Microsystems, the Sun logo, Java, Solaris and Dynamic Tracing (DTrace) probes are trademarks or registered trademarks of Sun Microsystems, Inc. in the U.S. and other countries */ + + +provider mysql { + probe data__receive__start(int); + probe data__receive__finish(int); + probe query__plan__start(char *); + probe query__plan__finish(char *); + probe query__execute__start(void *, char *, char *, const char *, char *); + probe query__execute__finish(void *, char *, char *, const char *, char *,int); + probe query__cache__hit(void *, char *, char *, const char *, char *); + probe query__cache__miss(void *, char *, char *, const char *, char *); + probe myisam__wrlck__start(); + probe myisam__wrlck__finish(); + probe innodb__index__next__start(char *); + probe innodb__index__next__finish(char *); + probe innodb__index__next__same__start(char *); + probe innodb__index__next__same__finish(char *); + probe innodb__index__prev__start(char *); + probe innodb__index__prev__finish(char *); + probe innodb__index__first__start(char *); + probe innodb__index__first__finish(char *); + probe innodb__index__last__start(char *); + probe innodb__index__last__finish(char *); + probe innodb__rnd__init__start(char *); + probe innodb__rnd__init__finish(char *); + probe innodb__rnd__end__start(char *); + probe innodb__rnd__end__finish(char *); + probe innodb__rnd__next__start(char *); + probe innodb__rnd__next__finish(char *); + probe innodb__rnd__pos__start(char *); + probe innodb__rnd__pos__finish(char *); + probe flush__log__start(); + probe flush__log__finish(); + probe innodb__wait__buff__start(); + probe innodb__wait__buff__finish(); +}; --- /old/mysql-5.0.41/innobase/buf/Makefile.in 2007-05-02 07:44:24.000000000 -0700 +++ /new/mysql-5.0.41/innobase/buf/Makefile.in 2008-04-01 15:51:08.080323000 -0700 @@ -33,6 +33,8 @@ srcdir = @srcdir@ top_srcdir = @top_srcdir@ +enable_dtrace = @enable_dtrace@ +DTRACEFLAGS = @DTRACEFLAGS@ VPATH = @srcdir@ pkgdatadir = $(datadir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ @@ -70,7 +72,11 @@ libbuf_a_LIBADD = am_libbuf_a_OBJECTS = buf0buf.$(OBJEXT) buf0flu.$(OBJEXT) \ buf0lru.$(OBJEXT) buf0rea.$(OBJEXT) -libbuf_a_OBJECTS = $(am_libbuf_a_OBJECTS) +ifeq ($(enable_dtrace),yes) + libbuf_a_OBJECTS = $(am_libbuf_a_OBJECTS) mysql_dtrace.$(OBJEXT) +else + libbuf_a_OBJECTS = $(am_libbuf_a_OBJECTS) +endif DEFAULT_INCLUDES = -I. -I$(srcdir) -I$(top_builddir) depcomp = $(SHELL) $(top_srcdir)/../depcomp am__depfiles_maybe = depfiles @@ -235,6 +241,9 @@ $(libbuf_a_AR) libbuf.a $(libbuf_a_OBJECTS) $(libbuf_a_LIBADD) $(RANLIB) libbuf.a +mysql_dtrace.o:$(top_srcdir)/../include/mysql_dtrace.d $(am_libbuf_a_OBJECTS) + dtrace -G $(DTRACEFLAGS) -s $(top_srcdir)/../include/mysql_dtrace.d $(am_libbuf_a_OBJECTS) + mostlyclean-compile: -rm -f *.$(OBJEXT) --- /old/mysql-5.0.41/innobase/log/Makefile.in 2007-05-02 07:44:28.000000000 -0700 +++ /new/mysql-5.0.41/innobase/log/Makefile.in 2008-04-01 15:51:08.048349000 -0700 @@ -33,6 +33,8 @@ srcdir = @srcdir@ top_srcdir = @top_srcdir@ +enable_dtrace = @enable_dtrace@ +DTRACEFLAGS = @DTRACEFLAGS@ VPATH = @srcdir@ pkgdatadir = $(datadir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ @@ -69,7 +71,11 @@ liblog_a_AR = $(AR) $(ARFLAGS) liblog_a_LIBADD = am_liblog_a_OBJECTS = log0log.$(OBJEXT) log0recv.$(OBJEXT) -liblog_a_OBJECTS = $(am_liblog_a_OBJECTS) +ifeq ($(enable_dtrace),yes) + liblog_a_OBJECTS = $(am_liblog_a_OBJECTS) mysql_dtrace.$(OBJEXT) +else + liblog_a_OBJECTS = $(am_liblog_a_OBJECTS) +endif DEFAULT_INCLUDES = -I. -I$(srcdir) -I$(top_builddir) depcomp = $(SHELL) $(top_srcdir)/../depcomp am__depfiles_maybe = depfiles @@ -234,6 +240,9 @@ $(liblog_a_AR) liblog.a $(liblog_a_OBJECTS) $(liblog_a_LIBADD) $(RANLIB) liblog.a +mysql_dtrace.o:$(top_srcdir)/../include/mysql_dtrace.d $(am_liblog_a_OBJECTS) + dtrace -G $(DTRACEFLAGS) -s $(top_srcdir)/../include/mysql_dtrace.d $(am_liblog_a_OBJECTS) + mostlyclean-compile: -rm -f *.$(OBJEXT) --- /old/mysql-5.0.41/innobase/configure.in 2007-05-02 07:39:16.000000000 -0700 +++ /new/mysql-5.0.41/innobase/configure.in 2008-03-05 17:40:34.070297000 -0800 @@ -47,7 +47,19 @@ #AC_C_INLINE Already checked in MySQL AC_C_BIGENDIAN -# Build optimized or debug version ? +if test "${enable_dtrace+set}" = set; then + enableval=$enable_dtrace; ENABLE_DTRACE=$enableval +fi + +if test "$ENABLE_DTRACE" == "yes"; then + +cat >>confdefs.h <<\_ACEOF +define ENABLE_DTRACE 1 +_ACEOF + +fi + + # First check for gcc and g++ if test "$ac_cv_prog_gcc" = "yes" then @@ -124,6 +136,17 @@ fi AC_SUBST(ARFLAGS) +#DTrace support +AC_ARG_ENABLE(dtrace, + [ --enable-dtrace Build with DTrace support], + [ ENABLE_DTRACE=$enableval]) +if test "$ENABLE_DTRACE" == "yes"; then + AC_DEFINE([ENABLE_DTRACE],[1],[Build with DTrace support]) +fi + AC_SUBST(DTRACEFLAGS) + AC_SUBST(enable_dtrace) + + AC_OUTPUT(Makefile os/Makefile ut/Makefile btr/Makefile dnl buf/Makefile data/Makefile dnl dict/Makefile dyn/Makefile dnl --- /old/mysql-5.0.41/innobase/configure 2007-05-02 07:44:36.000000000 -0700 +++ /new/mysql-5.0.41/innobase/configure 2008-03-05 17:40:33.776203000 -0800 @@ -462,7 +462,7 @@ # include #endif" -ac_subst_vars='SHELL PATH_SEPARATOR PACKAGE_NAME PACKAGE_TARNAME PACKAGE_VERSION PACKAGE_STRING PACKAGE_BUGREPORT exec_prefix prefix program_transform_name bindir sbindir libexecdir datadir sysconfdir sharedstatedir localstatedir libdir includedir oldincludedir infodir mandir build_alias host_alias target_alias DEFS ECHO_C ECHO_N ECHO_T LIBS build build_cpu build_vendor build_os host host_cpu host_vendor host_os target target_cpu target_vendor target_os MAINTAINER_MODE_TRUE MAINTAINER_MODE_FALSE MAINT INSTALL_PROGRAM INSTALL_SCRIPT INSTALL_DATA CYGPATH_W PACKAGE VERSION ACLOCAL AUTOCONF AUTOMAKE AUTOHEADER MAKEINFO install_sh STRIP ac_ct_STRIP INSTALL_STRIP_PROGRAM mkdir_p AWK SET_MAKE am__leading_dot AMTAR am__tar am__untar CC CFLAGS LDFLAGS CPPFLAGS ac_ct_CC EXEEXT OBJEXT DEPDIR am__include am__quote AMDEP_TRUE AMDEP_FALSE AMDEPBACKSLASH CCDEPMODE am__fastdepCC_TRUE am__fastdepCC_FALSE RANLIB ac_ct_RANLIB EGREP LN_S ECHO AR ac_ct_AR CPP CXX CXXFLAGS ac_ct_CXX CXXDEPMODE am__fastdepCXX_TRUE am__fastdepCXX_FALSE CXXCPP F77 FFLAGS ac_ct_F77 LIBTOOL ARFLAGS LIBOBJS LTLIBOBJS' +ac_subst_vars='SHELL PATH_SEPARATOR PACKAGE_NAME PACKAGE_TARNAME PACKAGE_VERSION PACKAGE_STRING PACKAGE_BUGREPORT exec_prefix prefix program_transform_name bindir sbindir libexecdir datadir sysconfdir sharedstatedir localstatedir libdir includedir oldincludedir infodir mandir build_alias host_alias target_alias DEFS ECHO_C ECHO_N ECHO_T LIBS build build_cpu build_vendor build_os host host_cpu host_vendor host_os target target_cpu target_vendor target_os MAINTAINER_MODE_TRUE MAINTAINER_MODE_FALSE MAINT INSTALL_PROGRAM INSTALL_SCRIPT INSTALL_DATA CYGPATH_W PACKAGE VERSION ACLOCAL AUTOCONF AUTOMAKE AUTOHEADER MAKEINFO install_sh STRIP ac_ct_STRIP INSTALL_STRIP_PROGRAM mkdir_p AWK SET_MAKE am__leading_dot AMTAR am__tar am__untar CC CFLAGS LDFLAGS CPPFLAGS ac_ct_CC EXEEXT OBJEXT DEPDIR am__include am__quote AMDEP_TRUE AMDEP_FALSE AMDEPBACKSLASH CCDEPMODE am__fastdepCC_TRUE am__fastdepCC_FALSE RANLIB ac_ct_RANLIB EGREP LN_S ECHO AR ac_ct_AR CPP CXX CXXFLAGS ac_ct_CXX CXXDEPMODE am__fastdepCXX_TRUE am__fastdepCXX_FALSE CXXCPP F77 FFLAGS ac_ct_F77 LIBTOOL ARFLAGS enable_dtrace DTRACEFLAGS LIBOBJS LTLIBOBJS' ac_subst_files='' # Initialize some variables set by options. @@ -20834,6 +20834,19 @@ ARFLAGS="cru" fi +#DTrace support +# Check whether --enable-dtrace was given. +if test "${enable_dtrace+set}" = set; then + enableval=$enable_dtrace; ENABLE_DTRACE=$enableval +fi + +if test "$ENABLE_DTRACE" == "yes"; then + +cat >>confdefs.h <<\_ACEOF +#define ENABLE_DTRACE 1 +_ACEOF + +fi ac_config_files="$ac_config_files Makefile os/Makefile ut/Makefile btr/Makefile buf/Makefile data/Makefile dict/Makefile dyn/Makefile eval/Makefile fil/Makefile fsp/Makefile fut/Makefile ha/Makefile ibuf/Makefile include/Makefile lock/Makefile log/Makefile mach/Makefile mem/Makefile mtr/Makefile page/Makefile pars/Makefile que/Makefile read/Makefile rem/Makefile row/Makefile srv/Makefile sync/Makefile thr/Makefile trx/Makefile usr/Makefile" cat >confcache <<\_ACEOF @@ -21590,6 +21603,8 @@ s,@ac_ct_F77@,$ac_ct_F77,;t t s,@LIBTOOL@,$LIBTOOL,;t t s,@ARFLAGS@,$ARFLAGS,;t t +s,@DTRACEFLAGS@,$DTRACEFLAGS,;t t +s,@enable_dtrace@,$enable_dtrace,;t t s,@LIBOBJS@,$LIBOBJS,;t t s,@LTLIBOBJS@,$LTLIBOBJS,;t t CEOF