From: Marc Alff Date: June 2 2010 8:31am Subject: bzr commit into mysql-next-mr-wl4895 branch (marc.alff:3153) WL#4895 List-Archive: http://lists.mysql.com/commits/109876 Message-Id: <201006020833.o527nKZj004790@rcsinet15.oracle.com> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="===============0026524032263418145==" --===============0026524032263418145== MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Content-Disposition: inline #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) { --===============0026524032263418145== MIME-Version: 1.0 Content-Type: text/bzr-bundle; charset="us-ascii"; name="bzr/marc.alff@stripped" Content-Transfer-Encoding: 7bit Content-Disposition: inline # Bazaar merge directive format 2 (Bazaar 0.90) # revision_id: marc.alff@stripped # target_branch: file:///Users/malff/BZR_TREE/mysql-next-mr-wl4895/ # testament_sha1: 20d0533807f18b34954c5bd52c1bfa8531b3d5a8 # timestamp: 2010-06-02 02:31:36 -0600 # source_branch: file:///Users/malff/BZR_TREE/mysql-next-mr/ # base_revision_id: marc.alff@stripped\ # hi1ofg3ki1yhhm9c # # Begin bundle IyBCYXphYXIgcmV2aXNpb24gYnVuZGxlIHY0CiMKQlpoOTFBWSZTWcr8R/cAB3nfgEAUWHf//3/v 3+S////6YAv9fN2umtvqHYFtkAO873io82tdmu2tVba00EqEkk0m0JpNqaPE0aaU0eKAwmh6mQaD ahppppoJQgCNQn6qPaKNNNNpDQbSNAAAAGTQOMmTRiGmhgJoYmjTJiBkYTRpphBkwzVEQTR6jymm jIGQ0GQAAANABiBFIRpqZApvUEn6UbTEaanlNHqbU8kepkAD1GgCSICAExMiRlPVNsqYmRpkAA9q gADSLa7LOU5ndjTvy0K1oWDO1Kv9O6/P3yqUkQoQIBSURrdDNO12G/pMZJpqoeC4bjs6i3gjUWnv h4Ew5p2Sc9kXVHXup6fr3muvaqUI8b+PMfBnmknYEG00QZTrbT1CbS7HhAHjfOrznON1jTtejHY3 PNCCCF9DJbsVhNPPtP8qzfLVzIpVtdJebeY2MAAEAIGmb5OH1ERK4yaKN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1fRawxBlQcRImGThGvkIb5fLdMfoJIOIPZY8Xzl8l1C6iUEZ4pnBYFGAYYICD9mqqKJXD y02FxcONRWbME48gSjiZQ81ipyFDBVwIU4OUkSVaGtDQW1s/xA+2S9AOQLYT6x5GPpY94QQXKkqU qr0KBAJhyItYArLhBFQyCaK4Q+NI7FgEjlWodrWCEPqIiRsAHSJBfMvfv3YZSSXX4hHeOXRANSHo vRthDPploMkX2brODV2KaQCuYZzXsV7OTdd5bxhmQNlgcrbZI1OIElhRzYBWvsvn7xAraegTFOIq Pqd9STU0+OgNNhLp5MMnqrjHPLnAxYHSScHAscAcCLpEXf2wSSlBRa0jGXDNteSvUvxs0PRDAri9 AJxNKcYeIRBoU7vdMWmgQ8egYB19Ua3zCA0r3UyMRcafiLlCRBX2s9bpMiFZUhSKNxhFgE5qam6d ItPgzgFISlZuNJzCeHI0oECFwpIWL2SsScOZ5A20yuD61+U8IqrUQBaoMC+zV4iCXgz+13Yyt+tJ JgW9Eh3Eybo9VXPzdloU/c33USAi40kViwp6WTSwDCGkgoY05EfeA6vGkYtTsxtC6auapvchDh4t 5WslJmGR6p1L2mkIkvrU95xGEBK97jgN01Ca6umSGAOk5uOk+vJL8kpm5Wls01wgkQ9BOOQZ4GTb jaupwj2tOY1YkyLwZLrnBBSdcmTawil6QQOBhW50jKIH0CRgg8WdUxTb/AEYdlmknZSALmxSILA5 HB1jHNeW5NMy+AyDauzy0SUT44sUbQSKUiBEAazLEPHyZmIOw4OzMMx90dcQRje110OIl2DAHeDi GEhonshXaZZl1G98umcAxk2m/UwWpIYMI34zYo5XM0Y2rshNz3t3YCaTjgOx8/kyN9zV6sttpXhp AmzcJQYTnlHxc+Hkd+J29d0ytY7DCTK9QwTHvFI1Ren1vqFJKVYENu3IpwSZkwT1trvTzokGraoL 8gR4iRmeh9V4hnP/i7kinChIZX4j+4A= --===============0026524032263418145==--