summaryrefslogtreecommitdiff
path: root/storage/rocksdb/ha_rocksdb.cc
diff options
context:
space:
mode:
authorSergei Golubchik <serg@mariadb.org>2020-01-29 13:50:26 +0100
committerSergei Golubchik <serg@mariadb.org>2020-03-10 19:24:22 +0100
commit7c58e97bf6f80a251046c5b3e7bce826fe058bd6 (patch)
tree7d32d26b320cf83296ee0ede2ea164ad116c4de8 /storage/rocksdb/ha_rocksdb.cc
parent2ac3121af2767186c489054db5d4871d04b8eef4 (diff)
downloadmariadb-git-7c58e97bf6f80a251046c5b3e7bce826fe058bd6.tar.gz
perfschema memory related instrumentation changes
Diffstat (limited to 'storage/rocksdb/ha_rocksdb.cc')
-rw-r--r--storage/rocksdb/ha_rocksdb.cc27
1 files changed, 14 insertions, 13 deletions
diff --git a/storage/rocksdb/ha_rocksdb.cc b/storage/rocksdb/ha_rocksdb.cc
index 8488f9ee963..625624d228e 100644
--- a/storage/rocksdb/ha_rocksdb.cc
+++ b/storage/rocksdb/ha_rocksdb.cc
@@ -5970,6 +5970,7 @@ Rdb_table_handler *Rdb_open_tables_map::get_table_handler(
// Since we did not find it in the hash map, attempt to create and add it
// to the hash map.
if (!(table_handler = reinterpret_cast<Rdb_table_handler *>(my_multi_malloc(
+ PSI_INSTRUMENT_ME,
MYF(MY_WME | MY_ZEROFILL), &table_handler, sizeof(*table_handler),
&tmp_name, table_name_str.length() + 1, NullS)))) {
// Allocating a new Rdb_table_handler and a new table name failed.
@@ -6550,11 +6551,11 @@ int ha_rocksdb::alloc_key_buffers(const TABLE *const table_arg,
// move this into get_table_handler() ??
m_pk_descr->setup(table_arg, tbl_def_arg);
- m_pk_tuple = reinterpret_cast<uchar *>(my_malloc(key_len, MYF(0)));
+ m_pk_tuple = reinterpret_cast<uchar *>(my_malloc(PSI_INSTRUMENT_ME, key_len, MYF(0)));
pack_key_len = m_pk_descr->max_storage_fmt_length();
m_pk_packed_tuple =
- reinterpret_cast<uchar *>(my_malloc(pack_key_len, MYF(0)));
+ reinterpret_cast<uchar *>(my_malloc(PSI_INSTRUMENT_ME, pack_key_len, MYF(0)));
/* Sometimes, we may use m_sk_packed_tuple for storing packed PK */
max_packed_sk_len = pack_key_len;
@@ -6572,20 +6573,20 @@ int ha_rocksdb::alloc_key_buffers(const TABLE *const table_arg,
}
m_sk_packed_tuple =
- reinterpret_cast<uchar *>(my_malloc(max_packed_sk_len, MYF(0)));
+ reinterpret_cast<uchar *>(my_malloc(PSI_INSTRUMENT_ME, max_packed_sk_len, MYF(0)));
m_sk_match_prefix_buf =
- reinterpret_cast<uchar *>(my_malloc(max_packed_sk_len, MYF(0)));
+ reinterpret_cast<uchar *>(my_malloc(PSI_INSTRUMENT_ME, max_packed_sk_len, MYF(0)));
m_sk_packed_tuple_old =
- reinterpret_cast<uchar *>(my_malloc(max_packed_sk_len, MYF(0)));
+ reinterpret_cast<uchar *>(my_malloc(PSI_INSTRUMENT_ME, max_packed_sk_len, MYF(0)));
m_end_key_packed_tuple =
- reinterpret_cast<uchar *>(my_malloc(max_packed_sk_len, MYF(0)));
+ reinterpret_cast<uchar *>(my_malloc(PSI_INSTRUMENT_ME, max_packed_sk_len, MYF(0)));
m_pack_buffer =
- reinterpret_cast<uchar *>(my_malloc(max_packed_sk_len, MYF(0)));
+ reinterpret_cast<uchar *>(my_malloc(PSI_INSTRUMENT_ME, max_packed_sk_len, MYF(0)));
m_scan_it_lower_bound =
- reinterpret_cast<uchar *>(my_malloc(max_packed_sk_len, MYF(0)));
+ reinterpret_cast<uchar *>(my_malloc(PSI_INSTRUMENT_ME, max_packed_sk_len, MYF(0)));
m_scan_it_upper_bound =
- reinterpret_cast<uchar *>(my_malloc(max_packed_sk_len, MYF(0)));
+ reinterpret_cast<uchar *>(my_malloc(PSI_INSTRUMENT_ME, max_packed_sk_len, MYF(0)));
/*
If inplace alter is happening, allocate special buffers for unique
@@ -6593,9 +6594,9 @@ int ha_rocksdb::alloc_key_buffers(const TABLE *const table_arg,
*/
if (alloc_alter_buffers) {
m_dup_sk_packed_tuple =
- reinterpret_cast<uchar *>(my_malloc(max_packed_sk_len, MYF(0)));
+ reinterpret_cast<uchar *>(my_malloc(PSI_INSTRUMENT_ME, max_packed_sk_len, MYF(0)));
m_dup_sk_packed_tuple_old =
- reinterpret_cast<uchar *>(my_malloc(max_packed_sk_len, MYF(0)));
+ reinterpret_cast<uchar *>(my_malloc(PSI_INSTRUMENT_ME, max_packed_sk_len, MYF(0)));
}
if (m_pk_tuple == nullptr || m_pk_packed_tuple == nullptr ||
@@ -14131,7 +14132,7 @@ void rocksdb_set_collation_exception_list(THD *const thd,
rdb_set_collation_exception_list(val == nullptr ? "" : val);
//psergey-todo: what is the purpose of the below??
- const char *val_copy= val? my_strdup(val, MYF(0)): nullptr;
+ const char *val_copy= val? my_strdup(PSI_INSTRUMENT_ME, val, MYF(0)): nullptr;
my_free(*static_cast<char**>(var_ptr));
*static_cast<const char**>(var_ptr) = val_copy;
}
@@ -14344,7 +14345,7 @@ static int rocksdb_validate_update_cf_options(
// This can cause invalid memory access after validation is finished.
// To avoid this kind case, let's alway duplicate the str if str is not
// nullptr
- *(const char **)save = (str == nullptr) ? nullptr : my_strdup(str, MYF(0));
+ *(const char **)save = (str == nullptr) ? nullptr : my_strdup(PSI_INSTRUMENT_ME, str, MYF(0));
if (str == nullptr) {
return HA_EXIT_SUCCESS;