mirror of
https://github.com/MariaDB/server.git
synced 2026-05-10 17:14:30 +02:00
perfschema memory related instrumentation changes
This commit is contained in:
parent
2ac3121af2
commit
7c58e97bf6
307 changed files with 2620 additions and 1741 deletions
|
|
@ -120,7 +120,7 @@ static handler *myisammrg_create_handler(handlerton *hton,
|
|||
ha_myisammrg::ha_myisammrg(handlerton *hton, TABLE_SHARE *table_arg)
|
||||
:handler(hton, table_arg), file(0), is_cloned(0)
|
||||
{
|
||||
init_sql_alloc(&children_mem_root, "ha_myisammrg",
|
||||
init_sql_alloc(rg_key_memory_children, &children_mem_root,
|
||||
FN_REFLEN + ALLOC_ROOT_MIN_BLOCK_SIZE, 0, MYF(0));
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -32,12 +32,13 @@ extern "C"
|
|||
#endif
|
||||
void myrg_print_wrong_table(const char *table_name);
|
||||
|
||||
#ifdef HAVE_PSI_INTERFACE
|
||||
/* Always defined */
|
||||
extern PSI_memory_key rg_key_memory_MYRG_INFO;
|
||||
|
||||
C_MODE_START
|
||||
extern PSI_mutex_key rg_key_mutex_MYRG_INFO_mutex;
|
||||
extern PSI_memory_key rg_key_memory_children;
|
||||
extern PSI_file_key rg_key_file_MRG;
|
||||
void init_myisammrg_psi_keys();
|
||||
C_MODE_END
|
||||
#endif /* HAVE_PSI_INTERFACE */
|
||||
|
||||
|
|
|
|||
|
|
@ -108,7 +108,8 @@ MYRG_INFO *myrg_open(const char *name, int mode, int handle_locking)
|
|||
if (!m_info) /* First file */
|
||||
{
|
||||
key_parts=isam->s->base.key_parts;
|
||||
if (!(m_info= (MYRG_INFO*) my_malloc(sizeof(MYRG_INFO) +
|
||||
if (!(m_info= (MYRG_INFO*) my_malloc(rg_key_memory_MYRG_INFO,
|
||||
sizeof(MYRG_INFO) +
|
||||
files*sizeof(MYRG_TABLE) +
|
||||
key_parts*sizeof(long),
|
||||
MYF(MY_WME|MY_ZEROFILL))))
|
||||
|
|
@ -149,7 +150,8 @@ MYRG_INFO *myrg_open(const char *name, int mode, int handle_locking)
|
|||
|
||||
if (bad_children)
|
||||
goto bad_children;
|
||||
if (!m_info && !(m_info= (MYRG_INFO*) my_malloc(sizeof(MYRG_INFO),
|
||||
if (!m_info && !(m_info= (MYRG_INFO*) my_malloc(rg_key_memory_MYRG_INFO,
|
||||
sizeof(MYRG_INFO),
|
||||
MYF(MY_WME | MY_ZEROFILL))))
|
||||
goto err;
|
||||
/* Don't mark table readonly, for ALTER TABLE ... UNION=(...) to work */
|
||||
|
|
@ -285,7 +287,8 @@ MYRG_INFO *myrg_parent_open(const char *parent_name,
|
|||
}
|
||||
|
||||
/* Allocate MERGE parent table structure. */
|
||||
if (!(m_info= (MYRG_INFO*) my_malloc(sizeof(MYRG_INFO) +
|
||||
if (!(m_info= (MYRG_INFO*) my_malloc(rg_key_memory_MYRG_INFO,
|
||||
sizeof(MYRG_INFO) +
|
||||
child_count * sizeof(MYRG_TABLE),
|
||||
MYF(MY_WME | MY_ZEROFILL))))
|
||||
goto err; /* purecov: inspected */
|
||||
|
|
@ -435,7 +438,8 @@ int myrg_attach_children(MYRG_INFO *m_info, int handle_locking,
|
|||
if (!m_info->rec_per_key_part)
|
||||
{
|
||||
if(!(m_info->rec_per_key_part= (ulong*)
|
||||
my_malloc(key_parts * sizeof(long), MYF(MY_WME))))
|
||||
my_malloc(rg_key_memory_MYRG_INFO,
|
||||
key_parts * sizeof(long), MYF(MY_WME))))
|
||||
goto err; /* purecov: inspected */
|
||||
errpos= 1;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -29,6 +29,9 @@ static const char *merge_insert_methods[] =
|
|||
TYPELIB merge_insert_method= { array_elements(merge_insert_methods)-1,"",
|
||||
merge_insert_methods, 0};
|
||||
|
||||
PSI_memory_key rg_key_memory_MYRG_INFO;
|
||||
PSI_memory_key rg_key_memory_children;
|
||||
|
||||
#ifdef HAVE_PSI_INTERFACE
|
||||
PSI_mutex_key rg_key_mutex_MYRG_INFO_mutex;
|
||||
|
||||
|
|
@ -44,6 +47,12 @@ static PSI_file_info all_myisammrg_files[]=
|
|||
{ &rg_key_file_MRG, "MRG", 0}
|
||||
};
|
||||
|
||||
static PSI_memory_info all_myisammrg_memory[]=
|
||||
{
|
||||
{ &rg_key_memory_MYRG_INFO, "MYRG_INFO", 0},
|
||||
{ &rg_key_memory_children, "children", 0}
|
||||
};
|
||||
|
||||
void init_myisammrg_psi_keys()
|
||||
{
|
||||
const char* category= "myisammrg";
|
||||
|
|
@ -54,6 +63,9 @@ void init_myisammrg_psi_keys()
|
|||
|
||||
count= array_elements(all_myisammrg_files);
|
||||
mysql_file_register(category, all_myisammrg_files, count);
|
||||
|
||||
count= array_elements(all_myisammrg_memory);
|
||||
mysql_memory_register(category, all_myisammrg_memory, count);
|
||||
}
|
||||
#endif /* HAVE_PSI_INTERFACE */
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue