#At file:///Users/malff/BZR_TREE/mysql-next-mr-wl4895/ based on revid:marc.alff@stripped
3153 Marc Alff 2010-06-02
WL#4895 PERFORMANCE SCHEMA TABLE IO
Implemented code review comments.
In particular:
- cleaned up every "position" iterators to start at FIRST_VIEW and end at LAST_VIEW
- moved iterator specific constants from pfs_engine_table.h to table_helper.h
added:
storage/perfschema/table_helper.h
modified:
storage/perfschema/CMakeLists.txt
storage/perfschema/Makefile.am
storage/perfschema/pfs_engine_table.h
storage/perfschema/table_all_instr.h
storage/perfschema/table_events_waits_summary.h
storage/perfschema/table_setup_instruments.h
storage/perfschema/table_setup_objects.h
=== modified file 'storage/perfschema/CMakeLists.txt'
--- a/storage/perfschema/CMakeLists.txt 2010-04-19 12:26:29 +0000
+++ b/storage/perfschema/CMakeLists.txt 2010-06-02 08:31:27 +0000
@@ -41,6 +41,7 @@ SET(PERFSCHEMA_SOURCES ha_perfschema.h
table_events_waits_summary.h
table_file_instances.h
table_file_summary.h
+ table_helper.h
table_performance_timers.h
table_processlist.h
table_setup_consumers.h
=== modified file 'storage/perfschema/Makefile.am'
--- a/storage/perfschema/Makefile.am 2010-04-19 12:26:29 +0000
+++ b/storage/perfschema/Makefile.am 2010-06-02 08:31:27 +0000
@@ -37,7 +37,7 @@ noinst_HEADERS = ha_perfschema.h pfs_eng
pfs_global.h pfs_instr_class.h pfs_instr.h \
pfs_column_types.h pfs_column_values.h \
table_setup_instruments.h table_performance_timers.h \
- table_setup_timers.h \
+ table_setup_timers.h table_helper.h \
table_setup_consumers.h table_events_waits.h \
pfs_events_waits.h pfs_timer.h table_processlist.h \
table_sync_instances.h \
=== modified file 'storage/perfschema/pfs_engine_table.h'
--- a/storage/perfschema/pfs_engine_table.h 2010-04-26 09:27:44 +0000
+++ b/storage/perfschema/pfs_engine_table.h 2010-06-02 08:31:27 +0000
@@ -293,22 +293,6 @@ struct PFS_triple_index
}
};
-struct PFS_instrument_view_constants
-{
- static const uint VIEW_MUTEX= 1;
- static const uint VIEW_RWLOCK= 2;
- static const uint VIEW_COND= 3;
- static const uint VIEW_FILE= 4;
-};
-
-struct PFS_object_view_constants
-{
- static const uint VIEW_TABLE= 1;
- static const uint VIEW_EVENT= 2;
- static const uint VIEW_PROCEDURE= 3;
- static const uint VIEW_FUNCTION= 4;
-};
-
bool pfs_show_status(handlerton *hton, THD *thd,
stat_print_fn *print, enum ha_stat_type stat);
=== modified file 'storage/perfschema/table_all_instr.h'
--- a/storage/perfschema/table_all_instr.h 2010-04-26 09:27:44 +0000
+++ b/storage/perfschema/table_all_instr.h 2010-06-02 08:31:27 +0000
@@ -24,6 +24,7 @@
#include "pfs_instr_class.h"
#include "pfs_instr.h"
#include "pfs_engine_table.h"
+#include "table_helper.h"
/**
@addtogroup Performance_schema_tables
@@ -35,17 +36,17 @@ struct pos_all_instr_class : public PFS_
public PFS_instrument_view_constants
{
pos_all_instr_class()
- : PFS_double_index(VIEW_MUTEX, 1)
+ : PFS_double_index(FIRST_VIEW, 1)
{}
inline void reset(void)
{
- m_index_1= VIEW_MUTEX;
+ m_index_1= FIRST_VIEW;
m_index_2= 1;
}
inline bool has_more_view(void)
- { return (m_index_1 <= VIEW_FILE); }
+ { return (m_index_1 <= LAST_VIEW); }
inline void next_view(void)
{
@@ -95,17 +96,17 @@ struct pos_all_instr : public PFS_double
public PFS_instrument_view_constants
{
pos_all_instr()
- : PFS_double_index(VIEW_MUTEX, 0)
+ : PFS_double_index(FIRST_VIEW, 0)
{}
inline void reset(void)
{
- m_index_1= VIEW_MUTEX;
+ m_index_1= FIRST_VIEW;
m_index_2= 0;
}
inline bool has_more_view(void)
- { return (m_index_1 <= VIEW_FILE); }
+ { return (m_index_1 <= LAST_VIEW); }
inline void next_view(void)
{
=== modified file 'storage/perfschema/table_events_waits_summary.h'
--- a/storage/perfschema/table_events_waits_summary.h 2010-04-26 09:27:44 +0000
+++ b/storage/perfschema/table_events_waits_summary.h 2010-06-02 08:31:27 +0000
@@ -26,6 +26,7 @@
#include "pfs_instr_class.h"
#include "pfs_instr.h"
#include "table_all_instr.h"
+#include "table_helper.h"
/**
@addtogroup Performance_schema_tables
@@ -64,13 +65,13 @@ struct pos_events_waits_summary_by_threa
: public PFS_triple_index, public PFS_instrument_view_constants
{
pos_events_waits_summary_by_thread_by_event_name()
- : PFS_triple_index(0, VIEW_MUTEX, 1)
+ : PFS_triple_index(0, FIRST_VIEW, 1)
{}
inline void reset(void)
{
m_index_1= 0;
- m_index_2= VIEW_MUTEX;
+ m_index_2= FIRST_VIEW;
m_index_3= 1;
}
@@ -78,12 +79,12 @@ struct pos_events_waits_summary_by_threa
{ return (m_index_1 < thread_max); }
inline bool has_more_view(void)
- { return (m_index_2 <= VIEW_FILE); }
+ { return (m_index_2 <= LAST_VIEW); }
inline void next_thread(void)
{
m_index_1++;
- m_index_2= VIEW_MUTEX;
+ m_index_2= FIRST_VIEW;
m_index_3= 1;
}
=== added file 'storage/perfschema/table_helper.h'
--- a/storage/perfschema/table_helper.h 1970-01-01 00:00:00 +0000
+++ b/storage/perfschema/table_helper.h 2010-06-02 08:31:27 +0000
@@ -0,0 +1,55 @@
+/* Copyright (c) 2008, 2010, Oracle and/or its affiliates. All rights reserved.
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; version 2 of the License.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software
+ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
+
+#ifndef PFS_TABLE_HELPER_H
+#define PFS_TABLE_HELPER_H
+
+/**
+ @file storage/perfschema/table_helper.h
+ Performance schema table helpers (declarations).
+*/
+
+/**
+ @addtogroup Performance_schema_tables
+ @{
+*/
+
+struct PFS_instrument_view_constants
+{
+ static const uint FIRST_VIEW= 1;
+ static const uint VIEW_MUTEX= 1;
+ static const uint VIEW_RWLOCK= 2;
+ static const uint VIEW_COND= 3;
+ static const uint VIEW_FILE= 4;
+ static const uint VIEW_TABLE= 5;
+ static const uint LAST_VIEW= 5;
+};
+
+struct PFS_object_view_constants
+{
+ static const uint FIRST_VIEW= 1;
+ static const uint VIEW_TABLE= 1;
+ static const uint LAST_VIEW= 1;
+
+ /* Future use */
+ static const uint VIEW_EVENT= 2;
+ static const uint VIEW_PROCEDURE= 3;
+ static const uint VIEW_FUNCTION= 4;
+};
+
+/** @} */
+
+#endif
+
=== modified file 'storage/perfschema/table_setup_instruments.h'
--- a/storage/perfschema/table_setup_instruments.h 2010-05-05 08:16:47 +0000
+++ b/storage/perfschema/table_setup_instruments.h 2010-06-02 08:31:27 +0000
@@ -45,6 +45,7 @@ struct row_setup_instruments
/** Position of a cursor on PERFORMANCE_SCHEMA.SETUP_INSTRUMENTS. */
struct pos_setup_instruments : public PFS_double_index
{
+ static const uint FIRST_VIEW= 1;
static const uint VIEW_MUTEX= 1;
static const uint VIEW_RWLOCK= 2;
static const uint VIEW_COND= 3;
@@ -52,19 +53,20 @@ struct pos_setup_instruments : public PF
static const uint VIEW_THREAD= 4;
static const uint VIEW_FILE= 5;
static const uint VIEW_TABLE= 6;
+ static const uint LAST_VIEW= 6;
pos_setup_instruments()
- : PFS_double_index(VIEW_MUTEX, 1)
+ : PFS_double_index(FIRST_VIEW, 1)
{}
inline void reset(void)
{
- m_index_1= VIEW_MUTEX;
+ m_index_1= FIRST_VIEW;
m_index_2= 1;
}
inline bool has_more_view(void)
- { return (m_index_1 <= VIEW_TABLE); }
+ { return (m_index_1 <= LAST_VIEW); }
inline void next_view(void)
{
=== modified file 'storage/perfschema/table_setup_objects.h'
--- a/storage/perfschema/table_setup_objects.h 2010-04-19 12:26:29 +0000
+++ b/storage/perfschema/table_setup_objects.h 2010-06-02 08:31:27 +0000
@@ -23,6 +23,7 @@
#include "pfs_instr_class.h"
#include "pfs_engine_table.h"
+#include "table_helper.h"
/**
@addtogroup Performance_schema_tables
@@ -53,17 +54,17 @@ struct pos_setup_objects : public PFS_do
public PFS_object_view_constants
{
pos_setup_objects()
- : PFS_double_index(VIEW_TABLE, 0)
+ : PFS_double_index(FIRST_VIEW, 0)
{}
inline void reset(void)
{
- m_index_1= VIEW_TABLE;
+ m_index_1= FIRST_VIEW;
m_index_2= 0;
}
inline bool has_more_view(void)
- { return (m_index_1 <= VIEW_FUNCTION); }
+ { return (m_index_1 <= LAST_VIEW); }
inline void next_view(void)
{
Attachment: [text/bzr-bundle] bzr/marc.alff@oracle.com-20100602083127-zsqty7a8698m6oza.bundle
| Thread |
|---|
| • bzr commit into mysql-next-mr-wl4895 branch (marc.alff:3153) WL#4895 | Marc Alff | 2 Jun |