mirror of
https://github.com/MariaDB/server.git
synced 2026-05-14 19:07:15 +02:00
Bug#55087 Performance schema: optimization of the instrumentation interface
This change is for performance optimization. Fixed the performance schema instrumentation interface as follows: - simplified mysql_unlock_mutex() - simplified mysql_unlock_rwlock() - simplified mysql_cond_signal() - simplified mysql_cond_broadcast() Changed the get_thread_XXX_locker apis to have one extra parameter, to provide memory to the instrumentation implementation. This API change allows to use memory provided by the caller, to avoid having to use thread local storage. Using this extra parameter will be done in a separate fix, this change is for the interface only. Adjusted all the code and unit tests accordingly.
This commit is contained in:
parent
a10ae35328
commit
6090cbe552
12 changed files with 544 additions and 183 deletions
|
|
@ -237,11 +237,12 @@ pfs_mutex_enter_func(
|
|||
ulint line) /*!< in: line where locked */
|
||||
{
|
||||
struct PSI_mutex_locker* locker = NULL;
|
||||
PSI_mutex_locker_state state;
|
||||
int result = 0;
|
||||
|
||||
if (UNIV_LIKELY(PSI_server && mutex->pfs_psi)) {
|
||||
locker = PSI_server->get_thread_mutex_locker(
|
||||
mutex->pfs_psi, PSI_MUTEX_LOCK);
|
||||
&state, mutex->pfs_psi, PSI_MUTEX_LOCK);
|
||||
if (locker) {
|
||||
PSI_server->start_mutex_wait(locker, file_name, line);
|
||||
}
|
||||
|
|
@ -270,11 +271,12 @@ pfs_mutex_enter_nowait_func(
|
|||
{
|
||||
ulint ret;
|
||||
struct PSI_mutex_locker* locker = NULL;
|
||||
PSI_mutex_locker_state state;
|
||||
int result = 0;
|
||||
|
||||
if (UNIV_LIKELY(PSI_server && mutex->pfs_psi)) {
|
||||
locker = PSI_server->get_thread_mutex_locker(
|
||||
mutex->pfs_psi, PSI_MUTEX_LOCK);
|
||||
&state, mutex->pfs_psi, PSI_MUTEX_LOCK);
|
||||
if (locker) {
|
||||
PSI_server->start_mutex_wait(locker, file_name, line);
|
||||
}
|
||||
|
|
@ -300,12 +302,7 @@ pfs_mutex_exit_func(
|
|||
mutex_t* mutex) /*!< in: pointer to mutex */
|
||||
{
|
||||
if (UNIV_LIKELY(PSI_server && mutex->pfs_psi)) {
|
||||
struct PSI_thread* thread;
|
||||
thread = PSI_server->get_thread();
|
||||
|
||||
if (thread) {
|
||||
PSI_server->unlock_mutex(thread, mutex->pfs_psi);
|
||||
}
|
||||
PSI_server->unlock_mutex(mutex->pfs_psi);
|
||||
}
|
||||
|
||||
mutex_exit_func(mutex);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue