From 7c58e97bf6f80a251046c5b3e7bce826fe058bd6 Mon Sep 17 00:00:00 2001 From: Sergei Golubchik Date: Wed, 29 Jan 2020 13:50:26 +0100 Subject: perfschema memory related instrumentation changes --- sql/hash_filo.h | 27 +++++++++++++-------------- 1 file changed, 13 insertions(+), 14 deletions(-) (limited to 'sql/hash_filo.h') diff --git a/sql/hash_filo.h b/sql/hash_filo.h index d815c428ac6..864e91594b2 100644 --- a/sql/hash_filo.h +++ b/sql/hash_filo.h @@ -48,6 +48,7 @@ private: class hash_filo { private: + PSI_memory_key m_psi_key; const uint key_offset, key_length; const my_hash_get_key get_key; /** Size of this hash table. */ @@ -61,15 +62,13 @@ public: mysql_mutex_t lock; HASH cache; - hash_filo(uint size_arg, uint key_offset_arg , uint key_length_arg, - my_hash_get_key get_key_arg, my_hash_free_key free_element_arg, - CHARSET_INFO *hash_charset_arg) - :key_offset(key_offset_arg), key_length(key_length_arg), - get_key(get_key_arg), m_size(size_arg), - free_element(free_element_arg),init(0), - hash_charset(hash_charset_arg), - first_link(NULL), - last_link(NULL) + hash_filo(PSI_memory_key psi_key, uint size_arg, uint key_offset_arg, + uint key_length_arg, my_hash_get_key get_key_arg, + my_hash_free_key free_element_arg, CHARSET_INFO *hash_charset_arg) + : m_psi_key(psi_key), key_offset(key_offset_arg), + key_length(key_length_arg), get_key(get_key_arg), m_size(size_arg), + free_element(free_element_arg),init(0), hash_charset(hash_charset_arg), + first_link(NULL), last_link(NULL) { bzero((char*) &cache,sizeof(cache)); } @@ -96,7 +95,7 @@ public: last_link= NULL; (void) my_hash_free(&cache); (void) my_hash_init(&cache,hash_charset,m_size,key_offset, - key_length, get_key, free_element,0); + key_length, get_key, free_element, 0, m_psi_key); if (!locked) mysql_mutex_unlock(&lock); } @@ -202,10 +201,10 @@ public: template class Hash_filo: public hash_filo { public: - Hash_filo(uint size_arg, uint key_offset_arg, uint key_length_arg, - my_hash_get_key get_key_arg, my_hash_free_key free_element_arg, - CHARSET_INFO *hash_charset_arg) : - hash_filo(size_arg, key_offset_arg, key_length_arg, + Hash_filo(PSI_memory_key psi_key, uint size_arg, uint key_offset_arg, uint + key_length_arg, my_hash_get_key get_key_arg, my_hash_free_key + free_element_arg, CHARSET_INFO *hash_charset_arg) : + hash_filo(psi_key, size_arg, key_offset_arg, key_length_arg, get_key_arg, free_element_arg, hash_charset_arg) {} T* first() { return (T*)hash_filo::first(); } T* last() { return (T*)hash_filo::last(); } -- cgit v1.2.1