Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
M
MariaDB
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
nexedi
MariaDB
Commits
22b6d848
Commit
22b6d848
authored
Feb 14, 2020
by
Sergei Golubchik
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
perfschema file instrumentation related changes
parent
7c58e97b
Changes
9
Hide whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
60 additions
and
23 deletions
+60
-23
include/my_sys.h
include/my_sys.h
+6
-0
mysys/mf_iocache.c
mysys/mf_iocache.c
+19
-8
sql/log.cc
sql/log.cc
+5
-4
sql/log.h
sql/log.h
+6
-2
sql/mysqld.cc
sql/mysqld.cc
+11
-2
sql/mysqld.h
sql/mysqld.h
+4
-2
sql/rpl_rli.cc
sql/rpl_rli.cc
+2
-0
storage/innobase/include/os0file.h
storage/innobase/include/os0file.h
+5
-3
storage/innobase/include/os0file.ic
storage/innobase/include/os0file.ic
+2
-2
No files found.
include/my_sys.h
View file @
22b6d848
...
...
@@ -508,6 +508,8 @@ typedef void (*my_error_reporter)(enum loglevel level, const char *format, ...)
extern
my_error_reporter
my_charset_error_reporter
;
extern
PSI_file_key
key_file_io_cache
;
/* inline functions for mf_iocache */
extern
int
my_b_flush_io_cache
(
IO_CACHE
*
info
,
int
need_append_buffer_lock
);
...
...
@@ -800,6 +802,10 @@ my_off_t my_get_ptr(uchar *ptr, size_t pack_length);
extern
int
init_io_cache
(
IO_CACHE
*
info
,
File
file
,
size_t
cachesize
,
enum
cache_type
type
,
my_off_t
seek_offset
,
my_bool
use_async_io
,
myf
cache_myflags
);
extern
int
init_io_cache_ext
(
IO_CACHE
*
info
,
File
file
,
size_t
cachesize
,
enum
cache_type
type
,
my_off_t
seek_offset
,
pbool
use_async_io
,
myf
cache_myflags
,
PSI_file_key
file_key
);
extern
my_bool
reinit_io_cache
(
IO_CACHE
*
info
,
enum
cache_type
type
,
my_off_t
seek_offset
,
my_bool
use_async_io
,
my_bool
clear_cache
);
...
...
mysys/mf_iocache.c
View file @
22b6d848
...
...
@@ -55,6 +55,9 @@
static
void
my_aiowait
(
my_aio_result
*
result
);
#endif
#include <errno.h>
#include "mysql/psi/mysql_file.h"
PSI_file_key
key_file_io_cache
;
#define lock_append_buffer(info) \
mysql_mutex_lock(&(info)->append_buffer_lock)
...
...
@@ -131,7 +134,7 @@ init_functions(IO_CACHE* info)
Initialize an IO_CACHE object
SYNOPSOS
init_io_cache()
init_io_cache
_ext
()
info cache handler to initialize
file File that should be associated to to the handler
If == -1 then real_open_cached_file()
...
...
@@ -144,20 +147,22 @@ init_functions(IO_CACHE* info)
cache_myflags Bitmap of different flags
MY_WME | MY_FAE | MY_NABP | MY_FNABP |
MY_DONT_CHECK_FILESIZE
file_key Instrumented file key for temporary cache file
RETURN
0 ok
# error
*/
int
init_io_cache
(
IO_CACHE
*
info
,
File
file
,
size_t
cachesize
,
enum
cache_type
type
,
my_off_t
seek_offset
,
my_bool
use_async_io
,
myf
cache_myflags
)
int
init_io_cache_ext
(
IO_CACHE
*
info
,
File
file
,
size_t
cachesize
,
enum
cache_type
type
,
my_off_t
seek_offset
,
pbool
use_async_io
,
myf
cache_myflags
,
PSI_file_key
file_key
)
{
size_t
min_cache
;
my_off_t
pos
;
my_off_t
end_of_file
=
~
(
my_off_t
)
0
;
DBUG_ENTER
(
"init_io_cache"
);
DBUG_ENTER
(
"init_io_cache
_ext
"
);
DBUG_PRINT
(
"enter"
,(
"cache:%p type: %d pos: %llu"
,
info
,
(
int
)
type
,
(
ulonglong
)
seek_offset
));
...
...
@@ -260,7 +265,7 @@ int init_io_cache(IO_CACHE *info, File file, size_t cachesize,
}
}
DBUG_PRINT
(
"info"
,(
"init_io_cache: cachesize = %lu"
,
(
ulong
)
cachesize
));
DBUG_PRINT
(
"info"
,(
"init_io_cache
_ext
: cachesize = %lu"
,
(
ulong
)
cachesize
));
info
->
read_length
=
info
->
buffer_length
=
cachesize
;
info
->
myflags
=
cache_myflags
&
~
(
MY_NABP
|
MY_FNABP
);
info
->
request_pos
=
info
->
read_pos
=
info
->
write_pos
=
info
->
buffer
;
...
...
@@ -301,9 +306,15 @@ int init_io_cache(IO_CACHE *info, File file, size_t cachesize,
info
->
inited
=
info
->
aio_result
.
pending
=
0
;
#endif
DBUG_RETURN
(
0
);
}
/* init_io_cache */
}
int
init_io_cache
(
IO_CACHE
*
info
,
File
file
,
size_t
cachesize
,
enum
cache_type
type
,
my_off_t
seek_offset
,
my_bool
use_async_io
,
myf
cache_myflags
)
{
return
init_io_cache_ext
(
info
,
file
,
cachesize
,
type
,
seek_offset
,
use_async_io
,
cache_myflags
,
key_file_io_cache
);
}
/*
Initialize the slave IO_CACHE to read the same file (and data)
...
...
sql/log.cc
View file @
22b6d848
...
...
@@ -2413,8 +2413,8 @@ File open_binlog(IO_CACHE *log, const char *log_file_name, const char **errmsg)
*
errmsg
=
"Could not open log file"
;
goto
err
;
}
if
(
init_io_cache
(
log
,
file
,
(
size_t
)
binlog_file_cache_size
,
READ_CACHE
,
0
,
0
,
MYF
(
MY_WME
|
MY_DONT_CHECK_FILESIZE
)
))
if
(
init_io_cache
_ext
(
log
,
file
,
(
size_t
)
binlog_file_cache_size
,
READ_CACHE
,
0
,
0
,
MYF
(
MY_WME
|
MY_DONT_CHECK_FILESIZE
),
key_file_binlog_cache
))
{
sql_print_error
(
"Failed to create a cache on log (file '%s')"
,
log_file_name
);
...
...
@@ -3393,10 +3393,11 @@ bool MYSQL_BIN_LOG::open_index_file(const char *index_file_name_arg,
O_RDWR
|
O_CREAT
|
O_BINARY
|
O_CLOEXEC
,
MYF
(
MY_WME
)))
<
0
||
mysql_file_sync
(
index_file_nr
,
MYF
(
MY_WME
))
||
init_io_cache
(
&
index_file
,
index_file_nr
,
init_io_cache
_ext
(
&
index_file
,
index_file_nr
,
IO_SIZE
,
WRITE_CACHE
,
mysql_file_seek
(
index_file_nr
,
0L
,
MY_SEEK_END
,
MYF
(
0
)),
0
,
MYF
(
MY_WME
|
MY_WAIT_IF_FULL
))
||
0
,
MYF
(
MY_WME
|
MY_WAIT_IF_FULL
),
m_key_file_log_index_cache
)
||
DBUG_EVALUATE_IF
(
"fault_injection_openning_index"
,
1
,
0
))
{
/*
...
...
sql/log.h
View file @
22b6d848
...
...
@@ -420,9 +420,9 @@ class MYSQL_BIN_LOG: public TC_LOG, private MYSQL_LOG
/** The instrumentation key to use for @ COND_bin_log_updated */
PSI_cond_key
m_key_bin_log_update
;
/** The instrumentation key to use for opening the log file. */
PSI_file_key
m_key_file_log
;
PSI_file_key
m_key_file_log
,
m_key_file_log_cache
;
/** The instrumentation key to use for opening the log index file. */
PSI_file_key
m_key_file_log_index
;
PSI_file_key
m_key_file_log_index
,
m_key_file_log_index_cache
;
PSI_cond_key
m_key_COND_queue_busy
;
/** The instrumentation key to use for LOCK_binlog_end_pos. */
...
...
@@ -674,7 +674,9 @@ class MYSQL_BIN_LOG: public TC_LOG, private MYSQL_LOG
PSI_cond_key
key_relay_log_update
,
PSI_cond_key
key_bin_log_update
,
PSI_file_key
key_file_log
,
PSI_file_key
key_file_log_cache
,
PSI_file_key
key_file_log_index
,
PSI_file_key
key_file_log_index_cache
,
PSI_cond_key
key_COND_queue_busy
,
PSI_mutex_key
key_LOCK_binlog_end_pos
)
{
...
...
@@ -682,7 +684,9 @@ class MYSQL_BIN_LOG: public TC_LOG, private MYSQL_LOG
m_key_relay_log_update
=
key_relay_log_update
;
m_key_bin_log_update
=
key_bin_log_update
;
m_key_file_log
=
key_file_log
;
m_key_file_log_cache
=
key_file_log_cache
;
m_key_file_log_index
=
key_file_log_index
;
m_key_file_log_index_cache
=
key_file_log_index_cache
;
m_key_COND_queue_busy
=
key_COND_queue_busy
;
m_key_LOCK_binlog_end_pos
=
key_LOCK_binlog_end_pos
;
}
...
...
sql/mysqld.cc
View file @
22b6d848
...
...
@@ -1105,7 +1105,8 @@ static PSI_thread_info all_server_threads[]=
PSI_file_key
key_file_map
;
#endif
/* HAVE_MMAP */
PSI_file_key
key_file_binlog
,
key_file_binlog_index
,
key_file_casetest
,
PSI_file_key
key_file_binlog
,
key_file_binlog_cache
,
key_file_binlog_index
,
key_file_binlog_index_cache
,
key_file_casetest
,
key_file_dbopt
,
key_file_des_key_file
,
key_file_ERRMSG
,
key_select_to_file
,
key_file_fileparser
,
key_file_frm
,
key_file_global_ddl_log
,
key_file_load
,
key_file_loadfile
,
key_file_log_event_data
,
key_file_log_event_info
,
...
...
@@ -1113,7 +1114,8 @@ PSI_file_key key_file_binlog, key_file_binlog_index, key_file_casetest,
key_file_pid
,
key_file_relay_log_info
,
key_file_send_file
,
key_file_tclog
,
key_file_trg
,
key_file_trn
,
key_file_init
;
PSI_file_key
key_file_query_log
,
key_file_slow_log
;
PSI_file_key
key_file_relaylog
,
key_file_relaylog_index
;
PSI_file_key
key_file_relaylog
,
key_file_relaylog_index
,
key_file_relaylog_cache
,
key_file_relaylog_index_cache
;
PSI_file_key
key_file_binlog_state
;
#endif
/* HAVE_PSI_INTERFACE */
...
...
@@ -3794,7 +3796,9 @@ static int init_common_variables()
key_BINLOG_COND_relay_log_updated
,
key_BINLOG_COND_bin_log_updated
,
key_file_binlog
,
key_file_binlog_cache
,
key_file_binlog_index
,
key_file_binlog_index_cache
,
key_BINLOG_COND_queue_busy
,
key_LOCK_binlog_end_pos
);
#endif
...
...
@@ -9112,9 +9116,14 @@ static PSI_file_info all_server_files[]=
{
&
key_file_map
,
"map"
,
0
},
#endif
/* HAVE_MMAP */
{
&
key_file_binlog
,
"binlog"
,
0
},
{
&
key_file_binlog_cache
,
"binlog_cache"
,
0
},
{
&
key_file_binlog_index
,
"binlog_index"
,
0
},
{
&
key_file_binlog_index_cache
,
"binlog_index_cache"
,
0
},
{
&
key_file_relaylog
,
"relaylog"
,
0
},
{
&
key_file_relaylog_cache
,
"relaylog_cache"
,
0
},
{
&
key_file_relaylog_index
,
"relaylog_index"
,
0
},
{
&
key_file_relaylog_index_cache
,
"relaylog_index_cache"
,
0
},
{
&
key_file_io_cache
,
"io_cache"
,
0
},
{
&
key_file_casetest
,
"casetest"
,
0
},
{
&
key_file_dbopt
,
"dbopt"
,
0
},
{
&
key_file_des_key_file
,
"des_key_file"
,
0
},
...
...
sql/mysqld.h
View file @
22b6d848
...
...
@@ -390,7 +390,8 @@ extern PSI_thread_key key_thread_delayed_insert,
key_thread_one_connection
,
key_thread_signal_hand
,
key_thread_slave_background
,
key_rpl_parallel_thread
;
extern
PSI_file_key
key_file_binlog
,
key_file_binlog_index
,
key_file_casetest
,
extern
PSI_file_key
key_file_binlog
,
key_file_binlog_cache
,
key_file_binlog_index
,
key_file_binlog_index_cache
,
key_file_casetest
,
key_file_dbopt
,
key_file_des_key_file
,
key_file_ERRMSG
,
key_select_to_file
,
key_file_fileparser
,
key_file_frm
,
key_file_global_ddl_log
,
key_file_load
,
key_file_loadfile
,
key_file_log_event_data
,
key_file_log_event_info
,
...
...
@@ -398,7 +399,8 @@ extern PSI_file_key key_file_binlog, key_file_binlog_index, key_file_casetest,
key_file_pid
,
key_file_relay_log_info
,
key_file_send_file
,
key_file_tclog
,
key_file_trg
,
key_file_trn
,
key_file_init
;
extern
PSI_file_key
key_file_query_log
,
key_file_slow_log
;
extern
PSI_file_key
key_file_relaylog
,
key_file_relaylog_index
;
extern
PSI_file_key
key_file_relaylog
,
key_file_relaylog_index
,
key_file_relaylog_cache
,
key_file_relaylog_index_cache
;
extern
PSI_socket_key
key_socket_tcpip
,
key_socket_unix
,
key_socket_client_connection
;
extern
PSI_file_key
key_file_binlog_state
;
...
...
sql/rpl_rli.cc
View file @
22b6d848
...
...
@@ -73,7 +73,9 @@ Relay_log_info::Relay_log_info(bool is_slave_recovery)
key_RELAYLOG_COND_relay_log_updated
,
key_RELAYLOG_COND_bin_log_updated
,
key_file_relaylog
,
key_file_relaylog_cache
,
key_file_relaylog_index
,
key_file_relaylog_index_cache
,
key_RELAYLOG_COND_queue_busy
,
key_LOCK_relaylog_end_pos
);
#endif
...
...
storage/innobase/include/os0file.h
View file @
22b6d848
...
...
@@ -644,10 +644,12 @@ do { \
register_pfs_file_open_begin(state, locker, key, op, name, \
src_file, src_line) \
# define register_pfs_file_rename_end(locker,
result)
\
# define register_pfs_file_rename_end(locker,
from, to, result)
\
do { \
if (locker != NULL) { \
PSI_FILE_CALL(end_file_open_wait)(locker, result); \
if (locker != NULL) { \
PSI_FILE_CALL( \
end_file_rename_wait)( \
locker, from, to, result); \
} \
} while (0)
...
...
storage/innobase/include/os0file.ic
View file @
22b6d848
...
...
@@ -433,13 +433,13 @@ pfs_os_file_rename_func(
PSI_file_locker_state state;
struct PSI_file_locker* locker = NULL;
register_pfs_file_
open
_begin(
register_pfs_file_
rename
_begin(
&state, locker, key, PSI_FILE_RENAME, newpath,
src_file, src_line);
bool result = os_file_rename_func(oldpath, newpath);
register_pfs_file_rename_end(locker,
0
);
register_pfs_file_rename_end(locker,
oldpath, newpath, !result
);
return(result);
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment