diff options
author | Christopher Powers <chris.powers@oracle.com> | 2010-08-19 17:24:07 -0500 |
---|---|---|
committer | Christopher Powers <chris.powers@oracle.com> | 2010-08-19 17:24:07 -0500 |
commit | e2b352941374fba4b48f0cb4bdc9e4efe9d57bf2 (patch) | |
tree | c65855d9803ce0542041d7f5c211538134f6c5ab /storage/perfschema | |
parent | cdce6061214dfe375737c353c5ccdf74cb33d047 (diff) | |
download | mariadb-git-e2b352941374fba4b48f0cb4bdc9e4efe9d57bf2.tar.gz |
Bug#53874, "SETUP_INSTRUMENTS.TIMED='NO' should not change TIMER_WAIT in aggregations"
end_*_wait() functions now honor TIMER_STATE_UNTIMED
Diffstat (limited to 'storage/perfschema')
-rw-r--r-- | storage/perfschema/pfs.cc | 52 |
1 files changed, 30 insertions, 22 deletions
diff --git a/storage/perfschema/pfs.cc b/storage/perfschema/pfs.cc index 60ef2a3b194..245664bc2b6 100644 --- a/storage/perfschema/pfs.cc +++ b/storage/perfschema/pfs.cc @@ -1625,7 +1625,7 @@ static void end_mutex_wait_v1(PSI_mutex_locker* locker, int rc) if (flag_events_waits_history_long) insert_events_waits_history_long(wait); - if (rc == 0) + if (rc == 0 && wait->m_timer_state == TIMER_STATE_TIMED) { /* Thread safe: we are protected by the instrumented mutex */ PFS_single_stat_chain *stat; @@ -1635,9 +1635,8 @@ static void end_mutex_wait_v1(PSI_mutex_locker* locker, int rc) ulonglong wait_time= wait->m_timer_end - wait->m_timer_start; aggregate_single_stat_chain(&mutex->m_wait_stat, wait_time); - stat= find_per_thread_mutex_class_wait_stat(wait->m_thread, - mutex->m_class); - aggregate_single_stat_chain(stat, wait_time); + stat= find_per_thread_mutex_class_wait_stat(wait->m_thread, mutex->m_class); + aggregate_single_stat_chain(stat, wait_time); } wait->m_thread->m_wait_locker_count--; } @@ -1690,11 +1689,13 @@ static void end_rwlock_rdwait_v1(PSI_rwlock_locker* locker, int rc) rwlock->m_writer= NULL; rwlock->m_readers++; - ulonglong wait_time= wait->m_timer_end - wait->m_timer_start; - aggregate_single_stat_chain(&rwlock->m_wait_stat, wait_time); - stat= find_per_thread_rwlock_class_wait_stat(wait->m_thread, - rwlock->m_class); - aggregate_single_stat_chain(stat, wait_time); + if (wait->m_timer_state == TIMER_STATE_TIMED) + { + ulonglong wait_time= wait->m_timer_end - wait->m_timer_start; + aggregate_single_stat_chain(&rwlock->m_wait_stat, wait_time); + stat= find_per_thread_rwlock_class_wait_stat(wait->m_thread, rwlock->m_class); + aggregate_single_stat_chain(stat, wait_time); + } } wait->m_thread->m_wait_locker_count--; } @@ -1742,11 +1743,13 @@ static void end_rwlock_wrwait_v1(PSI_rwlock_locker* locker, int rc) rwlock->m_readers= 0; rwlock->m_last_read= 0; - ulonglong wait_time= wait->m_timer_end - wait->m_timer_start; - aggregate_single_stat_chain(&rwlock->m_wait_stat, wait_time); - stat= find_per_thread_rwlock_class_wait_stat(wait->m_thread, - rwlock->m_class); - aggregate_single_stat_chain(stat, wait_time); + if (wait->m_timer_state == TIMER_STATE_TIMED) + { + ulonglong wait_time= wait->m_timer_end - wait->m_timer_start; + aggregate_single_stat_chain(&rwlock->m_wait_stat, wait_time); + stat= find_per_thread_rwlock_class_wait_stat(wait->m_thread, rwlock->m_class); + aggregate_single_stat_chain(stat, wait_time); + } } wait->m_thread->m_wait_locker_count--; } @@ -1803,11 +1806,13 @@ static void end_cond_wait_v1(PSI_cond_locker* locker, int rc) PFS_single_stat_chain *stat; PFS_cond *cond= pfs_locker->m_target.m_cond; - ulonglong wait_time= wait->m_timer_end - wait->m_timer_start; - aggregate_single_stat_chain(&cond->m_wait_stat, wait_time); - stat= find_per_thread_cond_class_wait_stat(wait->m_thread, - cond->m_class); - aggregate_single_stat_chain(stat, wait_time); + if (wait->m_timer_state == TIMER_STATE_TIMED) + { + ulonglong wait_time= wait->m_timer_end - wait->m_timer_start; + aggregate_single_stat_chain(&cond->m_wait_stat, wait_time); + stat= find_per_thread_cond_class_wait_stat(wait->m_thread, cond->m_class); + aggregate_single_stat_chain(stat, wait_time); + } } wait->m_thread->m_wait_locker_count--; } @@ -1850,9 +1855,12 @@ static void end_table_wait_v1(PSI_table_locker* locker) if (flag_events_waits_history_long) insert_events_waits_history_long(wait); - PFS_table *table= pfs_locker->m_target.m_table; - ulonglong wait_time= wait->m_timer_end - wait->m_timer_start; - aggregate_single_stat_chain(&table->m_wait_stat, wait_time); + if (wait->m_timer_state == TIMER_STATE_TIMED) + { + PFS_table *table= pfs_locker->m_target.m_table; + ulonglong wait_time= wait->m_timer_end - wait->m_timer_start; + aggregate_single_stat_chain(&table->m_wait_stat, wait_time); + } /* There is currently no per table and per thread aggregation. |