summaryrefslogtreecommitdiff
path: root/storage/blackhole
diff options
context:
space:
mode:
authorMikael Ronstrom <mikael@mysql.com>2008-12-20 11:01:41 +0100
committerMikael Ronstrom <mikael@mysql.com>2008-12-20 11:01:41 +0100
commitcc958a18dd9554870edd3b1c6119edf72b661879 (patch)
tree36aa1edfd94289934ffa3aa66af64b899e9a9e77 /storage/blackhole
parent602f612af09c3ccb6db19286291ae0bca403db5c (diff)
downloadmariadb-git-cc958a18dd9554870edd3b1c6119edf72b661879.tar.gz
Backport of DTrace patches from 6.0
Diffstat (limited to 'storage/blackhole')
-rw-r--r--storage/blackhole/Makefile.am17
-rw-r--r--storage/blackhole/ha_blackhole.cc52
2 files changed, 62 insertions, 7 deletions
diff --git a/storage/blackhole/Makefile.am b/storage/blackhole/Makefile.am
index db4f67cf847..71776b01639 100644
--- a/storage/blackhole/Makefile.am
+++ b/storage/blackhole/Makefile.am
@@ -48,5 +48,22 @@ libblackhole_a_SOURCES= ha_blackhole.cc
EXTRA_DIST = CMakeLists.txt plug.in
+
+if HAVE_DTRACE_DASH_G
+abs_top_srcdir = @abs_top_srcdir@
+libblackhole_a_LIBADD = probes_mysql.o
+libblackhole_a_DEPENDENCIES = probes_mysql.o dtrace_files dtrace_providers
+CLEANFILES = probes_mysql.o dtrace_files dtrace_providers
+DTRACEFILES = libblackhole_a-ha_blackhole.o
+DTRACEPROVIDER = $(abs_top_srcdir)/sql/probes_mysql.d
+
+dtrace_files:
+ echo $(DTRACEFILES) > $@
+dtrace_providers:
+ echo $(DTRACEPROVIDER) > $@
+probes_mysql.o: $(DTRACEPROVIDER) $(DTRACEFILES)
+ $(DTRACE) $(DTRACEFLAGS) -G -s $< $(DTRACEFILES) -o $@
+endif
+
# Don't update the files from bitkeeper
%::SCCS/s.%
diff --git a/storage/blackhole/ha_blackhole.cc b/storage/blackhole/ha_blackhole.cc
index 85b8117e501..6ca3b8d3ab0 100644
--- a/storage/blackhole/ha_blackhole.cc
+++ b/storage/blackhole/ha_blackhole.cc
@@ -19,6 +19,7 @@
#endif
#include "mysql_priv.h"
+#include "probes_mysql.h"
#include "ha_blackhole.h"
/* Static declarations for handlerton */
@@ -109,15 +110,23 @@ int ha_blackhole::rnd_init(bool scan)
int ha_blackhole::rnd_next(uchar *buf)
{
+ int rc;
DBUG_ENTER("ha_blackhole::rnd_next");
- DBUG_RETURN(HA_ERR_END_OF_FILE);
+ MYSQL_READ_ROW_START(table_share->db.str, table_share->table_name.str,
+ TRUE);
+ rc= HA_ERR_END_OF_FILE;
+ MYSQL_READ_ROW_DONE(rc);
+ DBUG_RETURN(rc);
}
int ha_blackhole::rnd_pos(uchar * buf, uchar *pos)
{
DBUG_ENTER("ha_blackhole::rnd_pos");
+ MYSQL_READ_ROW_START(table_share->db.str, table_share->table_name.str,
+ FALSE);
DBUG_ASSERT(0);
+ MYSQL_READ_ROW_DONE(0);
DBUG_RETURN(0);
}
@@ -188,8 +197,12 @@ int ha_blackhole::index_read_map(uchar * buf, const uchar * key,
key_part_map keypart_map,
enum ha_rkey_function find_flag)
{
+ int rc;
DBUG_ENTER("ha_blackhole::index_read");
- DBUG_RETURN(HA_ERR_END_OF_FILE);
+ MYSQL_INDEX_READ_ROW_START(table_share->db.str, table_share->table_name.str);
+ rc= HA_ERR_END_OF_FILE;
+ MYSQL_INDEX_READ_ROW_DONE(rc);
+ DBUG_RETURN(rc);
}
@@ -197,44 +210,69 @@ int ha_blackhole::index_read_idx_map(uchar * buf, uint idx, const uchar * key,
key_part_map keypart_map,
enum ha_rkey_function find_flag)
{
+ int rc;
DBUG_ENTER("ha_blackhole::index_read_idx");
- DBUG_RETURN(HA_ERR_END_OF_FILE);
+ MYSQL_INDEX_READ_ROW_START(table_share->db.str, table_share->table_name.str);
+ rc= HA_ERR_END_OF_FILE;
+ MYSQL_INDEX_READ_ROW_DONE(rc);
+ DBUG_RETURN(rc);
}
int ha_blackhole::index_read_last_map(uchar * buf, const uchar * key,
key_part_map keypart_map)
{
+ int rc;
DBUG_ENTER("ha_blackhole::index_read_last");
- DBUG_RETURN(HA_ERR_END_OF_FILE);
+ MYSQL_INDEX_READ_ROW_START(table_share->db.str, table_share->table_name.str);
+ rc= HA_ERR_END_OF_FILE;
+ MYSQL_INDEX_READ_ROW_DONE(rc);
+ DBUG_RETURN(rc);
}
int ha_blackhole::index_next(uchar * buf)
{
+ int rc;
DBUG_ENTER("ha_blackhole::index_next");
- DBUG_RETURN(HA_ERR_END_OF_FILE);
+ MYSQL_INDEX_READ_ROW_START(table_share->db.str, table_share->table_name.str);
+ rc= HA_ERR_END_OF_FILE;
+ MYSQL_INDEX_READ_ROW_DONE(rc);
+ DBUG_RETURN(rc);
}
int ha_blackhole::index_prev(uchar * buf)
{
+ int rc;
DBUG_ENTER("ha_blackhole::index_prev");
- DBUG_RETURN(HA_ERR_END_OF_FILE);
+ MYSQL_INDEX_READ_ROW_START(table_share->db.str, table_share->table_name.str);
+ rc= HA_ERR_END_OF_FILE;
+ MYSQL_INDEX_READ_ROW_DONE(rc);
+ DBUG_RETURN(rc);
}
int ha_blackhole::index_first(uchar * buf)
{
+ int rc;
DBUG_ENTER("ha_blackhole::index_first");
+ MYSQL_INDEX_READ_ROW_START(table_share->db.str, table_share->table_name.str);
+ rc= HA_ERR_END_OF_FILE;
+ MYSQL_INDEX_READ_ROW_DONE(rc);
+ DBUG_RETURN(rc);
DBUG_RETURN(HA_ERR_END_OF_FILE);
}
int ha_blackhole::index_last(uchar * buf)
{
+ int rc;
DBUG_ENTER("ha_blackhole::index_last");
- DBUG_RETURN(HA_ERR_END_OF_FILE);
+ MYSQL_INDEX_READ_ROW_START(table_share->db.str, table_share->table_name.str);
+ rc= HA_ERR_END_OF_FILE;
+ MYSQL_INDEX_READ_ROW_DONE(rc);
+ DBUG_RETURN(rc);
}