List:Commits« Previous MessageNext Message »
From:Christopher Powers Date:August 10 2011 11:35pm
Subject:bzr push into mysql-trunk branch (chris.powers:3358 to 3359) WL#4896
View as plain text  
 3359 Christopher Powers	2011-08-10
      WL#4896 "Performance Schema Net IO"
      
      - Fixed crashing bug: Test for m_idle in state object insteaed of socket object
      - Created MYSQL_SOCKET_SET_STATE macro
      - 

    modified:
      include/mysql/psi/mysql_socket.h
      include/mysql/psi/psi.h
      sql/net_serv.cc
      storage/perfschema/pfs.cc
 3358 Christopher Powers	2011-08-09
      WL#4896 "Performance Schema Net IO"
      
      Error formatting output changes for socket_summary_by_instance

    modified:
      mysql-test/suite/perfschema/include/socket_summary_check.inc
      mysql-test/suite/perfschema/t/socket_summary_by_instance_func.test
=== modified file 'include/mysql/psi/mysql_socket.h'
--- a/include/mysql/psi/mysql_socket.h	2011-07-26 00:39:25 +0000
+++ b/include/mysql/psi/mysql_socket.h	2011-08-10 23:35:12 +0000
@@ -92,6 +92,14 @@ mysql_socket_invalid()
   MYSQL_SOCKET mysql_socket= {INVALID_SOCKET, NULL};
   return mysql_socket;
 }
+
+#ifdef HAVE_PSI_SOCKET_INTERFACE
+  #define MYSQL_SOCKET_SET_STATE(SOCKET, STATE) \
+    inline_mysql_socket_set_state(SOCKET, STATE)
+#else
+  #define MYSQL_SOCKET_SET_STATE(SOCKET, STATE) \
+    do {} while (0)
+#endif
 
 /**
   Set the state (IDLE, ACTIVE) of an instrumented socket.
@@ -99,13 +107,15 @@ mysql_socket_invalid()
   @param state the new state
   @sa PSI_socket_state
 */
+#ifdef HAVE_PSI_SOCKET_INTERFACE
 static inline void
-mysql_socket_set_state(MYSQL_SOCKET socket, enum PSI_socket_state state)
+inline_mysql_socket_set_state(MYSQL_SOCKET socket, enum PSI_socket_state state)
 {
 #ifdef HAVE_PSI_SOCKET_INTERFACE
   PSI_CALL(set_socket_state)(socket.m_psi, state);
 #endif
 }
+#endif
 
 /**
   Set socket descriptor and address.

=== modified file 'include/mysql/psi/psi.h'
--- a/include/mysql/psi/psi.h	2011-08-09 19:09:51 +0000
+++ b/include/mysql/psi/psi.h	2011-08-10 23:35:12 +0000
@@ -953,6 +953,8 @@ struct PSI_socket_locker_state_v1
   int m_src_line;
   /** Internal data. */
   void *m_wait;
+  /** Idle state. */
+  my_bool m_idle;
 };
 
 /* Using typedef to make reuse between PSI_v1 and PSI_v2 easier later. */

=== modified file 'sql/net_serv.cc'
--- a/sql/net_serv.cc	2011-08-09 19:09:51 +0000
+++ b/sql/net_serv.cc	2011-08-10 23:35:12 +0000
@@ -45,6 +45,7 @@
 #include <errno.h>
 #include "probes_mysql.h"
 #include "mysql/psi/mysql_idle.h"
+#include "mysql/psi/mysql_socket.h"
 
 #ifdef EMBEDDED_LIBRARY
 #undef MYSQL_SERVER
@@ -723,22 +724,22 @@ static my_bool net_read_packet_header(NE
     - do not time the wait on the socket
     - time the wait as IDLE server time instead.
   */
-  #ifdef HAVE_PSI_INTERFACE
+#ifdef HAVE_PSI_SOCKET_INTERFACE
   if (net->mysql_socket_idle)
   {
-    mysql_socket_set_state(net->vio->mysql_socket, PSI_SOCKET_STATE_IDLE);
+    MYSQL_SOCKET_SET_STATE(net->vio->mysql_socket, PSI_SOCKET_STATE_IDLE);
     MYSQL_START_IDLE_WAIT(idle_locker, &idle_state);
 
     my_bool rc= net_read_raw_loop(net, count);
 
     MYSQL_END_IDLE_WAIT(idle_locker);
-    mysql_socket_set_state(net->vio->mysql_socket, PSI_SOCKET_STATE_ACTIVE);
+    MYSQL_SOCKET_SET_STATE(net->vio->mysql_socket, PSI_SOCKET_STATE_ACTIVE);
 
     if (rc)
       return TRUE;
   }
   else
-  #endif
+#endif
   {
     if (net_read_raw_loop(net, count))
        return TRUE;

=== modified file 'storage/perfschema/pfs.cc'
--- a/storage/perfschema/pfs.cc	2011-08-09 19:09:51 +0000
+++ b/storage/perfschema/pfs.cc	2011-08-10 23:35:12 +0000
@@ -2804,6 +2804,8 @@ get_thread_socket_locker_v1(PSI_socket_l
   if (!pfs_socket->m_enabled)
     return NULL;
 
+  state->m_idle= pfs_socket->m_idle;
+
   register uint flags;
 
   if (flag_thread_instrumentation)
@@ -4586,7 +4588,7 @@ static void start_socket_wait_v1(PSI_soc
   register uint flags= state->m_flags;
   ulonglong timer_start= 0;
 
-  if (flags & STATE_FLAG_TIMED && !socket->m_idle)
+  if (flags & STATE_FLAG_TIMED && !state->m_idle)
   {
     timer_start= get_timer_raw_value_and_function(wait_timer, &state->m_timer);
     state->m_timer_start= timer_start;
@@ -4662,7 +4664,7 @@ static void end_socket_wait_v1(PSI_socke
   /** Aggregation for EVENTS_WAITS_SUMMARY_BY_INSTANCE */
   if (flags & STATE_FLAG_TIMED)
   {
-    if (!socket->m_idle)
+    if (!state->m_idle)
 	  {
 	    timer_end= state->m_timer();
 	    wait_time= timer_end - state->m_timer_start;

No bundle (reason: useless for push emails).
Thread
bzr push into mysql-trunk branch (chris.powers:3358 to 3359) WL#4896Christopher Powers11 Aug