List:Commits« Previous MessageNext Message »
From:Christopher Powers Date:August 19 2010 10:24pm
Subject:bzr commit into mysql-5.5-bugfixing branch (chris.powers:3188) Bug#53874
View as plain text  
#At file:///home/cpowers/work/dev/dev-55-bugfixing/mysql/ based on revid:bar@stripped

 3188 Christopher Powers	2010-08-19
      Bug#53874, "SETUP_INSTRUMENTS.TIMED='NO' should not change TIMER_WAIT in aggregations"
      
      end_*_wait() functions now honor TIMER_STATE_UNTIMED
     @ storage/perfschema/pfs.cc
        Don't aggregate stats if TIMER_STATE_UNTIMED

    modified:
      storage/perfschema/pfs.cc
=== modified file 'storage/perfschema/pfs.cc'
--- a/storage/perfschema/pfs.cc	2010-08-12 09:51:58 +0000
+++ b/storage/perfschema/pfs.cc	2010-08-19 22:24:07 +0000
@@ -1625,7 +1625,7 @@ static void end_mutex_wait_v1(PSI_mutex_
   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_
 
     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_rwl
     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_rwl
     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_lo
     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_
   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.


Attachment: [text/bzr-bundle] bzr/chris.powers@oracle.com-20100819222407-1t6jj51b8d03e7u5.bundle
Thread
bzr commit into mysql-5.5-bugfixing branch (chris.powers:3188) Bug#53874Christopher Powers20 Aug