From 0478e0508dbd2edf93a25d359ba365dceb02c1c3 Mon Sep 17 00:00:00 2001 From: Mikael Ronstrom Date: Tue, 23 Dec 2008 00:56:44 +0100 Subject: [PATCH 1/2] Fixing DTrace issue in mysqld.cc Disabling ndb DTrace probes temporarily Hacking some DTrace Makefile magic to make it work All temporary solutions to make it work quickly --- sql/Makefile.am | 5 +---- sql/ha_ndbcluster.cc | 9 ++++++++- sql/mysqld.cc | 2 +- 3 files changed, 10 insertions(+), 6 deletions(-) diff --git a/sql/Makefile.am b/sql/Makefile.am index 95cfa649012..bb17e1b05bf 100644 --- a/sql/Makefile.am +++ b/sql/Makefile.am @@ -29,7 +29,6 @@ libexec_PROGRAMS = mysqld EXTRA_PROGRAMS = gen_lex_hash bin_PROGRAMS = mysql_tzinfo_to_sql DTRACEFILES = filesort.o \ - libndb_la-ha_ndbcluster.o \ handler.o \ mysqld.o \ net_serv.o \ @@ -207,8 +206,6 @@ install-exec-hook: test ! -f mysqld.sym.gz || $(INSTALL_DATA) mysqld.sym.gz $(DESTDIR)$(pkglibdir) if HAVE_DTRACE_DASH_G -libndb_la_LIBADD = probes_all.o -libndb_la_DEPENDENCIES = probes_all.o dtrace_files dtrace_providers mysqld_LDADD += probes_all.o mysqld_DEPENDENCIES += probes_all.o dtrace_files dtrace_providers CLEANFILES += dtrace_files dtrace_providers probes_all.o @@ -223,7 +220,7 @@ DTRACEDIRS = . ../mysys $(patsubst %,$(top_builddir)/storage/%,@mysql_se_dirs@) probes_all.o: probes_mysql.d $(DTRACEFILES) providers=`(for i in $(DTRACEDIRS); do cat $$i/dtrace_providers 2>/dev/null; done) | tr " " "\n" | sort | uniq | sed -e '/^$$/d' -e 's/^/-s /'`; \ - objects=`for i in $(DTRACEDIRS); do f=\`cat $$i/dtrace_files 2>/dev/null\`; for j in $$f; do test -f $$i/$$j && echo -n "$$i/$$j "; done; done`; \ + objects=`for i in $(DTRACEDIRS); do f=\`cat $$i/dtrace_files 2>/dev/null\`; for j in $$f; do test -f $$i/$$j && echo -n "$$i/$$j " | sed -e 's/echo -n//g'; done; done`; \ $(DTRACE) $(DTRACEFLAGS) -G $$providers $$objects -o $@ endif diff --git a/sql/ha_ndbcluster.cc b/sql/ha_ndbcluster.cc index be7ca278302..119de87ec95 100644 --- a/sql/ha_ndbcluster.cc +++ b/sql/ha_ndbcluster.cc @@ -41,7 +41,14 @@ #include "ha_ndbcluster_tables.h" #include -#include "probes_mysql.h" +/* + Temporarily disabling DTrace for ndb storage engine +*/ +#define MYSQL_INDEX_READ_ROW_START(arg0, arg1) +#define MYSQL_INDEX_READ_ROW_DONE(arg0) +#define MYSQL_READ_ROW_START(arg0, arg1, arg2) +#define MYSQL_READ_ROW_DONE(arg0) +/* #include "probes_mysql.h" */ #ifdef ndb_dynamite #undef assert diff --git a/sql/mysqld.cc b/sql/mysqld.cc index 8cde456f2ee..32a0518c6fd 100644 --- a/sql/mysqld.cc +++ b/sql/mysqld.cc @@ -1758,9 +1758,9 @@ void close_connection(THD *thd, uint errcode, bool lock) net_send_error(thd, errcode, ER(errcode)); /* purecov: inspected */ vio_close(vio); /* vio is freed in delete thd */ } + MYSQL_CONNECTION_DONE((int) errcode, thd->thread_id); if (lock) (void) pthread_mutex_unlock(&LOCK_thread_count); - MYSQL_CONNECTION_DONE((int) errcode, thd->thread_id); DBUG_VOID_RETURN; } #endif /* EMBEDDED_LIBRARY */ From b01f5ef118dd533f3bcc2a0229501bed3bb65661 Mon Sep 17 00:00:00 2001 From: Mikael Ronstrom Date: Tue, 23 Dec 2008 02:22:59 +0100 Subject: [PATCH 2/2] Fixed the magic since it seems also spurious -n's are generated by the magic script. --- sql/Makefile.am | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sql/Makefile.am b/sql/Makefile.am index bb17e1b05bf..e029a128f62 100644 --- a/sql/Makefile.am +++ b/sql/Makefile.am @@ -220,7 +220,7 @@ DTRACEDIRS = . ../mysys $(patsubst %,$(top_builddir)/storage/%,@mysql_se_dirs@) probes_all.o: probes_mysql.d $(DTRACEFILES) providers=`(for i in $(DTRACEDIRS); do cat $$i/dtrace_providers 2>/dev/null; done) | tr " " "\n" | sort | uniq | sed -e '/^$$/d' -e 's/^/-s /'`; \ - objects=`for i in $(DTRACEDIRS); do f=\`cat $$i/dtrace_files 2>/dev/null\`; for j in $$f; do test -f $$i/$$j && echo -n "$$i/$$j " | sed -e 's/echo -n//g'; done; done`; \ + objects=`for i in $(DTRACEDIRS); do f=\`cat $$i/dtrace_files 2>/dev/null\`; for j in $$f; do test -f $$i/$$j && echo -n "$$i/$$j " | sed -e 's/echo//g' -e 's/-n//g'; done; done`; \ $(DTRACE) $(DTRACEFLAGS) -G $$providers $$objects -o $@ endif