List:Commits« Previous MessageNext Message »
From:Guilhem Bichot Date:April 7 2009 8:02pm
Subject:Review of WL#2360 Performance Schema
View as plain text  
Hello,

+++ /m/bzrrepos/mysql-6.0-perf-clean/storage/archive/ha_archive.cc 
2009-03-05 10:14:32.000000000 +0100
@@ -21,6 +21,7 @@
  #include <myisam.h>

  #include "ha_archive.h"
+#include "azio.h"

GB no need, it's already included by ha_archive.h

@@ -165,6 +202,10 @@
    DBUG_ENTER("archive_db_init");
    handlerton *archive_hton;

+#ifdef HAVE_PSI_INTERFACE
+  init_archive_psi_keys();
+#endif

GB So if one would create a program which uses azio but not ha_archive,
mysql_mutex_lock() calls in azio.c would use uninitialized
keys. If PSI_server is NULL, no problem. If it's not NULL (assuming
there is a valid PSI server somewhere), keys would still be
automatically full of zeroes, so find_mutex_info(0) would return 0 and
so instrumentation code would be skipped. No crash. Phew.
I suggest you document the behaviour of instrumentation functions when
a zero key is used (that is, zero keys result in no instrumentation
but no crash). This could be useful to in-house and external
developers; for example when they have an engine which is used inside 
mysqld (via ha_*.cc, where they would init keys) and inside unit tests 
(where they wouldn't init keys). Like storage/heap/hp_test1.c (which 
uses all-zero keys), or storage/myisam/mi_test?.c (same).

+++ /m/bzrrepos/mysql-6.0-perf-clean/storage/heap/heapdef.h	2009-03-05 
10:15:53.000000000 +0100
@@ -103,9 +103,14 @@
  extern uint hp_rb_pack_key(HP_KEYDEF *keydef, uchar *key, const uchar 
*old,
                             key_part_map keypart_map);
  #ifdef THREAD
-extern pthread_mutex_t THR_LOCK_heap;
-#else
-#define pthread_mutex_lock(A)
-#define pthread_mutex_unlock(A)

GB why are those two #define removed? Were they useless?

+++ /m/bzrrepos/mysql-6.0-perf-clean/storage/example/ha_example.cc 
2009-03-19 14:23:02.000000000 +0100
@@ -125,13 +125,41 @@
    return (uchar*) share->table_name;
  }

+#ifdef HAVE_PSI_INTERFACE
+PSI_mutex_key key_example_mutex;
+PSI_mutex_key key_EXAMPLE_SHARE_mutex;

GB could you please make new objects used in only one file be
"static"? Always good to keep data private... Same for all other 
engines' files where possible (see below for another example).

+++ /m/bzrrepos/mysql-6.0-perf-clean/storage/federated/ha_federated.h 
2009-03-05 10:15:57.000000000 +0100
@@ -38,6 +38,10 @@
  #define FEDERATED_RECORDS_IN_RANGE 2
  #define FEDERATED_MAX_KEY_LENGTH 3500 // Same as innodb

+#ifdef HAVE_PSI_INTERFACE
+extern PSI_mutex_key key_FEDERATED_SHARE_mutex;

GB only ha_federated.cc uses this, so no need to export it here, and it 
can be static.

-- 
Mr. Guilhem Bichot <guilhem@stripped>
Sun Microsystems / MySQL, Lead Software Engineer
Bordeaux, France
www.sun.com / www.mysql.com
Thread
Review of WL#2360 Performance SchemaGuilhem Bichot7 Apr
Re: Review of WL#2360 Performance SchemaGuilhem Bichot12 Apr
  • Re: Review of WL#2360 Performance SchemaMarc Alff22 Jun
    • Re: Review of WL#2360 Performance SchemaPeter Gulutzan22 Jun
      • Re: Review of WL#2360 Performance SchemaGuilhem Bichot22 Jun
        • Re: Review of WL#2360 Performance SchemaPeter Gulutzan27 Jun
          • Re: Review of WL#2360 Performance SchemaGuilhem Bichot27 Jun