List:Commits« Previous MessageNext Message »
From:Christopher Powers Date:September 2 2011 8:06pm
Subject:bzr push into mysql-trunk-wl5908 branch (chris.powers:3419 to 3420) WL#5908
View as plain text  
 3420 Christopher Powers	2011-09-02
      WL#5908 "File IO Summary Table Extensions"
      
      Full worklog implementation to track file timer and IO per operation:
      - Split file_summary_by_instance and _by_event_name into separate files
      - Removed file_summary.cc
      - Updated file visitor methods
      - Updated test cases

    removed:
      storage/perfschema/table_file_summary.cc
      storage/perfschema/table_file_summary.h
    added:
      storage/perfschema/table_file_summary_by_event_name.cc
      storage/perfschema/table_file_summary_by_event_name.h
      storage/perfschema/table_file_summary_by_instance.cc
      storage/perfschema/table_file_summary_by_instance.h
    modified:
      mysql-test/suite/perfschema/r/pfs_upgrade.result
      mysql-test/suite/perfschema/r/relaylog.result
      mysql-test/suite/perfschema/r/schema.result
      mysql-test/suite/perfschema/r/start_server_nothing.result
      mysql-test/suite/perfschema/r/table_schema.result
      scripts/mysql_system_tables.sql
      storage/perfschema/CMakeLists.txt
      storage/perfschema/pfs.cc
      storage/perfschema/pfs_engine_table.cc
      storage/perfschema/pfs_instr.cc
      storage/perfschema/pfs_instr.h
      storage/perfschema/pfs_stat.h
      storage/perfschema/pfs_visitor.cc
      storage/perfschema/pfs_visitor.h
      storage/perfschema/table_helper.h
      storage/perfschema/table_socket_summary_by_instance.cc
 3419 Marc Alff	2011-08-29
      New branch

    modified:
      .bzr-mysql/default.conf
=== modified file 'mysql-test/suite/perfschema/r/pfs_upgrade.result'
--- a/mysql-test/suite/perfschema/r/pfs_upgrade.result	2011-08-20 00:25:14 +0000
+++ b/mysql-test/suite/perfschema/r/pfs_upgrade.result	2011-09-02 20:03:36 +0000
@@ -19,44 +19,44 @@ ERROR 1050 (42S01) at line 222: Table 'e
 ERROR 1050 (42S01) at line 235: Table 'events_waits_summary_by_thread_by_event_name' already exists
 ERROR 1050 (42S01) at line 247: Table 'events_waits_summary_global_by_event_name' already exists
 ERROR 1050 (42S01) at line 256: Table 'file_instances' already exists
-ERROR 1050 (42S01) at line 267: Table 'file_summary_by_event_name' already exists
-ERROR 1050 (42S01) at line 279: Table 'file_summary_by_instance' already exists
-ERROR 1050 (42S01) at line 292: Table 'socket_instances' already exists
-ERROR 1050 (42S01) at line 322: Table 'socket_summary_by_instance' already exists
-ERROR 1050 (42S01) at line 351: Table 'socket_summary_by_event_name' already exists
-ERROR 1050 (42S01) at line 360: Table 'mutex_instances' already exists
-ERROR 1050 (42S01) at line 374: Table 'objects_summary_global_by_type' already exists
-ERROR 1050 (42S01) at line 384: Table 'performance_timers' already exists
-ERROR 1050 (42S01) at line 394: Table 'rwlock_instances' already exists
-ERROR 1050 (42S01) at line 403: Table 'setup_actors' already exists
-ERROR 1050 (42S01) at line 411: Table 'setup_consumers' already exists
-ERROR 1050 (42S01) at line 420: Table 'setup_instruments' already exists
-ERROR 1050 (42S01) at line 431: Table 'setup_objects' already exists
-ERROR 1050 (42S01) at line 439: Table 'setup_timers' already exists
-ERROR 1050 (42S01) at line 484: Table 'table_io_waits_summary_by_index_usage' already exists
-ERROR 1050 (42S01) at line 528: Table 'table_io_waits_summary_by_table' already exists
-ERROR 1050 (42S01) at line 607: Table 'table_lock_waits_summary_by_table' already exists
-ERROR 1050 (42S01) at line 627: Table 'threads' already exists
-ERROR 1050 (42S01) at line 642: Table 'events_stages_current' already exists
-ERROR 1050 (42S01) at line 657: Table 'events_stages_history' already exists
-ERROR 1050 (42S01) at line 672: Table 'events_stages_history_long' already exists
-ERROR 1050 (42S01) at line 685: Table 'events_stages_summary_by_thread_by_event_name' already exists
-ERROR 1050 (42S01) at line 698: Table 'events_stages_summary_by_host_by_event_name' already exists
-ERROR 1050 (42S01) at line 711: Table 'events_stages_summary_by_user_by_event_name' already exists
-ERROR 1050 (42S01) at line 725: Table 'events_stages_summary_by_account_by_event_name' already exists
-ERROR 1050 (42S01) at line 737: Table 'events_stages_summary_global_by_event_name' already exists
-ERROR 1050 (42S01) at line 780: Table 'events_statements_current' already exists
-ERROR 1050 (42S01) at line 823: Table 'events_statements_history' already exists
-ERROR 1050 (42S01) at line 866: Table 'events_statements_history_long' already exists
-ERROR 1050 (42S01) at line 898: Table 'events_statements_summary_by_thread_by_event_name' already exists
-ERROR 1050 (42S01) at line 930: Table 'events_statements_summary_by_host_by_event_name' already exists
-ERROR 1050 (42S01) at line 962: Table 'events_statements_summary_by_user_by_event_name' already exists
-ERROR 1050 (42S01) at line 995: Table 'events_statements_summary_by_account_by_event_name' already exists
-ERROR 1050 (42S01) at line 1026: Table 'events_statements_summary_global_by_event_name' already exists
-ERROR 1050 (42S01) at line 1035: Table 'hosts' already exists
-ERROR 1050 (42S01) at line 1044: Table 'users' already exists
-ERROR 1050 (42S01) at line 1054: Table 'accounts' already exists
-ERROR 1644 (HY000) at line 1474: Unexpected content found in the performance_schema database.
+ERROR 1050 (42S01) at line 285: Table 'file_summary_by_event_name' already exists
+ERROR 1050 (42S01) at line 316: Table 'file_summary_by_instance' already exists
+ERROR 1050 (42S01) at line 329: Table 'socket_instances' already exists
+ERROR 1050 (42S01) at line 359: Table 'socket_summary_by_instance' already exists
+ERROR 1050 (42S01) at line 388: Table 'socket_summary_by_event_name' already exists
+ERROR 1050 (42S01) at line 397: Table 'mutex_instances' already exists
+ERROR 1050 (42S01) at line 411: Table 'objects_summary_global_by_type' already exists
+ERROR 1050 (42S01) at line 421: Table 'performance_timers' already exists
+ERROR 1050 (42S01) at line 431: Table 'rwlock_instances' already exists
+ERROR 1050 (42S01) at line 440: Table 'setup_actors' already exists
+ERROR 1050 (42S01) at line 448: Table 'setup_consumers' already exists
+ERROR 1050 (42S01) at line 457: Table 'setup_instruments' already exists
+ERROR 1050 (42S01) at line 468: Table 'setup_objects' already exists
+ERROR 1050 (42S01) at line 476: Table 'setup_timers' already exists
+ERROR 1050 (42S01) at line 521: Table 'table_io_waits_summary_by_index_usage' already exists
+ERROR 1050 (42S01) at line 565: Table 'table_io_waits_summary_by_table' already exists
+ERROR 1050 (42S01) at line 644: Table 'table_lock_waits_summary_by_table' already exists
+ERROR 1050 (42S01) at line 664: Table 'threads' already exists
+ERROR 1050 (42S01) at line 679: Table 'events_stages_current' already exists
+ERROR 1050 (42S01) at line 694: Table 'events_stages_history' already exists
+ERROR 1050 (42S01) at line 709: Table 'events_stages_history_long' already exists
+ERROR 1050 (42S01) at line 722: Table 'events_stages_summary_by_thread_by_event_name' already exists
+ERROR 1050 (42S01) at line 735: Table 'events_stages_summary_by_host_by_event_name' already exists
+ERROR 1050 (42S01) at line 748: Table 'events_stages_summary_by_user_by_event_name' already exists
+ERROR 1050 (42S01) at line 762: Table 'events_stages_summary_by_account_by_event_name' already exists
+ERROR 1050 (42S01) at line 774: Table 'events_stages_summary_global_by_event_name' already exists
+ERROR 1050 (42S01) at line 817: Table 'events_statements_current' already exists
+ERROR 1050 (42S01) at line 860: Table 'events_statements_history' already exists
+ERROR 1050 (42S01) at line 903: Table 'events_statements_history_long' already exists
+ERROR 1050 (42S01) at line 935: Table 'events_statements_summary_by_thread_by_event_name' already exists
+ERROR 1050 (42S01) at line 967: Table 'events_statements_summary_by_host_by_event_name' already exists
+ERROR 1050 (42S01) at line 999: Table 'events_statements_summary_by_user_by_event_name' already exists
+ERROR 1050 (42S01) at line 1032: Table 'events_statements_summary_by_account_by_event_name' already exists
+ERROR 1050 (42S01) at line 1063: Table 'events_statements_summary_global_by_event_name' already exists
+ERROR 1050 (42S01) at line 1072: Table 'hosts' already exists
+ERROR 1050 (42S01) at line 1081: Table 'users' already exists
+ERROR 1050 (42S01) at line 1091: Table 'accounts' already exists
+ERROR 1644 (HY000) at line 1511: Unexpected content found in the performance_schema database.
 FATAL ERROR: Upgrade failed
 show tables like "user_table";
 Tables_in_performance_schema (user_table)
@@ -80,44 +80,44 @@ ERROR 1050 (42S01) at line 222: Table 'e
 ERROR 1050 (42S01) at line 235: Table 'events_waits_summary_by_thread_by_event_name' already exists
 ERROR 1050 (42S01) at line 247: Table 'events_waits_summary_global_by_event_name' already exists
 ERROR 1050 (42S01) at line 256: Table 'file_instances' already exists
-ERROR 1050 (42S01) at line 267: Table 'file_summary_by_event_name' already exists
-ERROR 1050 (42S01) at line 279: Table 'file_summary_by_instance' already exists
-ERROR 1050 (42S01) at line 292: Table 'socket_instances' already exists
-ERROR 1050 (42S01) at line 322: Table 'socket_summary_by_instance' already exists
-ERROR 1050 (42S01) at line 351: Table 'socket_summary_by_event_name' already exists
-ERROR 1050 (42S01) at line 360: Table 'mutex_instances' already exists
-ERROR 1050 (42S01) at line 374: Table 'objects_summary_global_by_type' already exists
-ERROR 1050 (42S01) at line 384: Table 'performance_timers' already exists
-ERROR 1050 (42S01) at line 394: Table 'rwlock_instances' already exists
-ERROR 1050 (42S01) at line 403: Table 'setup_actors' already exists
-ERROR 1050 (42S01) at line 411: Table 'setup_consumers' already exists
-ERROR 1050 (42S01) at line 420: Table 'setup_instruments' already exists
-ERROR 1050 (42S01) at line 431: Table 'setup_objects' already exists
-ERROR 1050 (42S01) at line 439: Table 'setup_timers' already exists
-ERROR 1050 (42S01) at line 484: Table 'table_io_waits_summary_by_index_usage' already exists
-ERROR 1050 (42S01) at line 528: Table 'table_io_waits_summary_by_table' already exists
-ERROR 1050 (42S01) at line 607: Table 'table_lock_waits_summary_by_table' already exists
-ERROR 1050 (42S01) at line 627: Table 'threads' already exists
-ERROR 1050 (42S01) at line 642: Table 'events_stages_current' already exists
-ERROR 1050 (42S01) at line 657: Table 'events_stages_history' already exists
-ERROR 1050 (42S01) at line 672: Table 'events_stages_history_long' already exists
-ERROR 1050 (42S01) at line 685: Table 'events_stages_summary_by_thread_by_event_name' already exists
-ERROR 1050 (42S01) at line 698: Table 'events_stages_summary_by_host_by_event_name' already exists
-ERROR 1050 (42S01) at line 711: Table 'events_stages_summary_by_user_by_event_name' already exists
-ERROR 1050 (42S01) at line 725: Table 'events_stages_summary_by_account_by_event_name' already exists
-ERROR 1050 (42S01) at line 737: Table 'events_stages_summary_global_by_event_name' already exists
-ERROR 1050 (42S01) at line 780: Table 'events_statements_current' already exists
-ERROR 1050 (42S01) at line 823: Table 'events_statements_history' already exists
-ERROR 1050 (42S01) at line 866: Table 'events_statements_history_long' already exists
-ERROR 1050 (42S01) at line 898: Table 'events_statements_summary_by_thread_by_event_name' already exists
-ERROR 1050 (42S01) at line 930: Table 'events_statements_summary_by_host_by_event_name' already exists
-ERROR 1050 (42S01) at line 962: Table 'events_statements_summary_by_user_by_event_name' already exists
-ERROR 1050 (42S01) at line 995: Table 'events_statements_summary_by_account_by_event_name' already exists
-ERROR 1050 (42S01) at line 1026: Table 'events_statements_summary_global_by_event_name' already exists
-ERROR 1050 (42S01) at line 1035: Table 'hosts' already exists
-ERROR 1050 (42S01) at line 1044: Table 'users' already exists
-ERROR 1050 (42S01) at line 1054: Table 'accounts' already exists
-ERROR 1644 (HY000) at line 1474: Unexpected content found in the performance_schema database.
+ERROR 1050 (42S01) at line 285: Table 'file_summary_by_event_name' already exists
+ERROR 1050 (42S01) at line 316: Table 'file_summary_by_instance' already exists
+ERROR 1050 (42S01) at line 329: Table 'socket_instances' already exists
+ERROR 1050 (42S01) at line 359: Table 'socket_summary_by_instance' already exists
+ERROR 1050 (42S01) at line 388: Table 'socket_summary_by_event_name' already exists
+ERROR 1050 (42S01) at line 397: Table 'mutex_instances' already exists
+ERROR 1050 (42S01) at line 411: Table 'objects_summary_global_by_type' already exists
+ERROR 1050 (42S01) at line 421: Table 'performance_timers' already exists
+ERROR 1050 (42S01) at line 431: Table 'rwlock_instances' already exists
+ERROR 1050 (42S01) at line 440: Table 'setup_actors' already exists
+ERROR 1050 (42S01) at line 448: Table 'setup_consumers' already exists
+ERROR 1050 (42S01) at line 457: Table 'setup_instruments' already exists
+ERROR 1050 (42S01) at line 468: Table 'setup_objects' already exists
+ERROR 1050 (42S01) at line 476: Table 'setup_timers' already exists
+ERROR 1050 (42S01) at line 521: Table 'table_io_waits_summary_by_index_usage' already exists
+ERROR 1050 (42S01) at line 565: Table 'table_io_waits_summary_by_table' already exists
+ERROR 1050 (42S01) at line 644: Table 'table_lock_waits_summary_by_table' already exists
+ERROR 1050 (42S01) at line 664: Table 'threads' already exists
+ERROR 1050 (42S01) at line 679: Table 'events_stages_current' already exists
+ERROR 1050 (42S01) at line 694: Table 'events_stages_history' already exists
+ERROR 1050 (42S01) at line 709: Table 'events_stages_history_long' already exists
+ERROR 1050 (42S01) at line 722: Table 'events_stages_summary_by_thread_by_event_name' already exists
+ERROR 1050 (42S01) at line 735: Table 'events_stages_summary_by_host_by_event_name' already exists
+ERROR 1050 (42S01) at line 748: Table 'events_stages_summary_by_user_by_event_name' already exists
+ERROR 1050 (42S01) at line 762: Table 'events_stages_summary_by_account_by_event_name' already exists
+ERROR 1050 (42S01) at line 774: Table 'events_stages_summary_global_by_event_name' already exists
+ERROR 1050 (42S01) at line 817: Table 'events_statements_current' already exists
+ERROR 1050 (42S01) at line 860: Table 'events_statements_history' already exists
+ERROR 1050 (42S01) at line 903: Table 'events_statements_history_long' already exists
+ERROR 1050 (42S01) at line 935: Table 'events_statements_summary_by_thread_by_event_name' already exists
+ERROR 1050 (42S01) at line 967: Table 'events_statements_summary_by_host_by_event_name' already exists
+ERROR 1050 (42S01) at line 999: Table 'events_statements_summary_by_user_by_event_name' already exists
+ERROR 1050 (42S01) at line 1032: Table 'events_statements_summary_by_account_by_event_name' already exists
+ERROR 1050 (42S01) at line 1063: Table 'events_statements_summary_global_by_event_name' already exists
+ERROR 1050 (42S01) at line 1072: Table 'hosts' already exists
+ERROR 1050 (42S01) at line 1081: Table 'users' already exists
+ERROR 1050 (42S01) at line 1091: Table 'accounts' already exists
+ERROR 1644 (HY000) at line 1511: Unexpected content found in the performance_schema database.
 FATAL ERROR: Upgrade failed
 show tables like "user_view";
 Tables_in_performance_schema (user_view)
@@ -139,44 +139,44 @@ ERROR 1050 (42S01) at line 222: Table 'e
 ERROR 1050 (42S01) at line 235: Table 'events_waits_summary_by_thread_by_event_name' already exists
 ERROR 1050 (42S01) at line 247: Table 'events_waits_summary_global_by_event_name' already exists
 ERROR 1050 (42S01) at line 256: Table 'file_instances' already exists
-ERROR 1050 (42S01) at line 267: Table 'file_summary_by_event_name' already exists
-ERROR 1050 (42S01) at line 279: Table 'file_summary_by_instance' already exists
-ERROR 1050 (42S01) at line 292: Table 'socket_instances' already exists
-ERROR 1050 (42S01) at line 322: Table 'socket_summary_by_instance' already exists
-ERROR 1050 (42S01) at line 351: Table 'socket_summary_by_event_name' already exists
-ERROR 1050 (42S01) at line 360: Table 'mutex_instances' already exists
-ERROR 1050 (42S01) at line 374: Table 'objects_summary_global_by_type' already exists
-ERROR 1050 (42S01) at line 384: Table 'performance_timers' already exists
-ERROR 1050 (42S01) at line 394: Table 'rwlock_instances' already exists
-ERROR 1050 (42S01) at line 403: Table 'setup_actors' already exists
-ERROR 1050 (42S01) at line 411: Table 'setup_consumers' already exists
-ERROR 1050 (42S01) at line 420: Table 'setup_instruments' already exists
-ERROR 1050 (42S01) at line 431: Table 'setup_objects' already exists
-ERROR 1050 (42S01) at line 439: Table 'setup_timers' already exists
-ERROR 1050 (42S01) at line 484: Table 'table_io_waits_summary_by_index_usage' already exists
-ERROR 1050 (42S01) at line 528: Table 'table_io_waits_summary_by_table' already exists
-ERROR 1050 (42S01) at line 607: Table 'table_lock_waits_summary_by_table' already exists
-ERROR 1050 (42S01) at line 627: Table 'threads' already exists
-ERROR 1050 (42S01) at line 642: Table 'events_stages_current' already exists
-ERROR 1050 (42S01) at line 657: Table 'events_stages_history' already exists
-ERROR 1050 (42S01) at line 672: Table 'events_stages_history_long' already exists
-ERROR 1050 (42S01) at line 685: Table 'events_stages_summary_by_thread_by_event_name' already exists
-ERROR 1050 (42S01) at line 698: Table 'events_stages_summary_by_host_by_event_name' already exists
-ERROR 1050 (42S01) at line 711: Table 'events_stages_summary_by_user_by_event_name' already exists
-ERROR 1050 (42S01) at line 725: Table 'events_stages_summary_by_account_by_event_name' already exists
-ERROR 1050 (42S01) at line 737: Table 'events_stages_summary_global_by_event_name' already exists
-ERROR 1050 (42S01) at line 780: Table 'events_statements_current' already exists
-ERROR 1050 (42S01) at line 823: Table 'events_statements_history' already exists
-ERROR 1050 (42S01) at line 866: Table 'events_statements_history_long' already exists
-ERROR 1050 (42S01) at line 898: Table 'events_statements_summary_by_thread_by_event_name' already exists
-ERROR 1050 (42S01) at line 930: Table 'events_statements_summary_by_host_by_event_name' already exists
-ERROR 1050 (42S01) at line 962: Table 'events_statements_summary_by_user_by_event_name' already exists
-ERROR 1050 (42S01) at line 995: Table 'events_statements_summary_by_account_by_event_name' already exists
-ERROR 1050 (42S01) at line 1026: Table 'events_statements_summary_global_by_event_name' already exists
-ERROR 1050 (42S01) at line 1035: Table 'hosts' already exists
-ERROR 1050 (42S01) at line 1044: Table 'users' already exists
-ERROR 1050 (42S01) at line 1054: Table 'accounts' already exists
-ERROR 1644 (HY000) at line 1474: Unexpected content found in the performance_schema database.
+ERROR 1050 (42S01) at line 285: Table 'file_summary_by_event_name' already exists
+ERROR 1050 (42S01) at line 316: Table 'file_summary_by_instance' already exists
+ERROR 1050 (42S01) at line 329: Table 'socket_instances' already exists
+ERROR 1050 (42S01) at line 359: Table 'socket_summary_by_instance' already exists
+ERROR 1050 (42S01) at line 388: Table 'socket_summary_by_event_name' already exists
+ERROR 1050 (42S01) at line 397: Table 'mutex_instances' already exists
+ERROR 1050 (42S01) at line 411: Table 'objects_summary_global_by_type' already exists
+ERROR 1050 (42S01) at line 421: Table 'performance_timers' already exists
+ERROR 1050 (42S01) at line 431: Table 'rwlock_instances' already exists
+ERROR 1050 (42S01) at line 440: Table 'setup_actors' already exists
+ERROR 1050 (42S01) at line 448: Table 'setup_consumers' already exists
+ERROR 1050 (42S01) at line 457: Table 'setup_instruments' already exists
+ERROR 1050 (42S01) at line 468: Table 'setup_objects' already exists
+ERROR 1050 (42S01) at line 476: Table 'setup_timers' already exists
+ERROR 1050 (42S01) at line 521: Table 'table_io_waits_summary_by_index_usage' already exists
+ERROR 1050 (42S01) at line 565: Table 'table_io_waits_summary_by_table' already exists
+ERROR 1050 (42S01) at line 644: Table 'table_lock_waits_summary_by_table' already exists
+ERROR 1050 (42S01) at line 664: Table 'threads' already exists
+ERROR 1050 (42S01) at line 679: Table 'events_stages_current' already exists
+ERROR 1050 (42S01) at line 694: Table 'events_stages_history' already exists
+ERROR 1050 (42S01) at line 709: Table 'events_stages_history_long' already exists
+ERROR 1050 (42S01) at line 722: Table 'events_stages_summary_by_thread_by_event_name' already exists
+ERROR 1050 (42S01) at line 735: Table 'events_stages_summary_by_host_by_event_name' already exists
+ERROR 1050 (42S01) at line 748: Table 'events_stages_summary_by_user_by_event_name' already exists
+ERROR 1050 (42S01) at line 762: Table 'events_stages_summary_by_account_by_event_name' already exists
+ERROR 1050 (42S01) at line 774: Table 'events_stages_summary_global_by_event_name' already exists
+ERROR 1050 (42S01) at line 817: Table 'events_statements_current' already exists
+ERROR 1050 (42S01) at line 860: Table 'events_statements_history' already exists
+ERROR 1050 (42S01) at line 903: Table 'events_statements_history_long' already exists
+ERROR 1050 (42S01) at line 935: Table 'events_statements_summary_by_thread_by_event_name' already exists
+ERROR 1050 (42S01) at line 967: Table 'events_statements_summary_by_host_by_event_name' already exists
+ERROR 1050 (42S01) at line 999: Table 'events_statements_summary_by_user_by_event_name' already exists
+ERROR 1050 (42S01) at line 1032: Table 'events_statements_summary_by_account_by_event_name' already exists
+ERROR 1050 (42S01) at line 1063: Table 'events_statements_summary_global_by_event_name' already exists
+ERROR 1050 (42S01) at line 1072: Table 'hosts' already exists
+ERROR 1050 (42S01) at line 1081: Table 'users' already exists
+ERROR 1050 (42S01) at line 1091: Table 'accounts' already exists
+ERROR 1644 (HY000) at line 1511: Unexpected content found in the performance_schema database.
 FATAL ERROR: Upgrade failed
 select name from mysql.proc where db='performance_schema';
 name
@@ -198,44 +198,44 @@ ERROR 1050 (42S01) at line 222: Table 'e
 ERROR 1050 (42S01) at line 235: Table 'events_waits_summary_by_thread_by_event_name' already exists
 ERROR 1050 (42S01) at line 247: Table 'events_waits_summary_global_by_event_name' already exists
 ERROR 1050 (42S01) at line 256: Table 'file_instances' already exists
-ERROR 1050 (42S01) at line 267: Table 'file_summary_by_event_name' already exists
-ERROR 1050 (42S01) at line 279: Table 'file_summary_by_instance' already exists
-ERROR 1050 (42S01) at line 292: Table 'socket_instances' already exists
-ERROR 1050 (42S01) at line 322: Table 'socket_summary_by_instance' already exists
-ERROR 1050 (42S01) at line 351: Table 'socket_summary_by_event_name' already exists
-ERROR 1050 (42S01) at line 360: Table 'mutex_instances' already exists
-ERROR 1050 (42S01) at line 374: Table 'objects_summary_global_by_type' already exists
-ERROR 1050 (42S01) at line 384: Table 'performance_timers' already exists
-ERROR 1050 (42S01) at line 394: Table 'rwlock_instances' already exists
-ERROR 1050 (42S01) at line 403: Table 'setup_actors' already exists
-ERROR 1050 (42S01) at line 411: Table 'setup_consumers' already exists
-ERROR 1050 (42S01) at line 420: Table 'setup_instruments' already exists
-ERROR 1050 (42S01) at line 431: Table 'setup_objects' already exists
-ERROR 1050 (42S01) at line 439: Table 'setup_timers' already exists
-ERROR 1050 (42S01) at line 484: Table 'table_io_waits_summary_by_index_usage' already exists
-ERROR 1050 (42S01) at line 528: Table 'table_io_waits_summary_by_table' already exists
-ERROR 1050 (42S01) at line 607: Table 'table_lock_waits_summary_by_table' already exists
-ERROR 1050 (42S01) at line 627: Table 'threads' already exists
-ERROR 1050 (42S01) at line 642: Table 'events_stages_current' already exists
-ERROR 1050 (42S01) at line 657: Table 'events_stages_history' already exists
-ERROR 1050 (42S01) at line 672: Table 'events_stages_history_long' already exists
-ERROR 1050 (42S01) at line 685: Table 'events_stages_summary_by_thread_by_event_name' already exists
-ERROR 1050 (42S01) at line 698: Table 'events_stages_summary_by_host_by_event_name' already exists
-ERROR 1050 (42S01) at line 711: Table 'events_stages_summary_by_user_by_event_name' already exists
-ERROR 1050 (42S01) at line 725: Table 'events_stages_summary_by_account_by_event_name' already exists
-ERROR 1050 (42S01) at line 737: Table 'events_stages_summary_global_by_event_name' already exists
-ERROR 1050 (42S01) at line 780: Table 'events_statements_current' already exists
-ERROR 1050 (42S01) at line 823: Table 'events_statements_history' already exists
-ERROR 1050 (42S01) at line 866: Table 'events_statements_history_long' already exists
-ERROR 1050 (42S01) at line 898: Table 'events_statements_summary_by_thread_by_event_name' already exists
-ERROR 1050 (42S01) at line 930: Table 'events_statements_summary_by_host_by_event_name' already exists
-ERROR 1050 (42S01) at line 962: Table 'events_statements_summary_by_user_by_event_name' already exists
-ERROR 1050 (42S01) at line 995: Table 'events_statements_summary_by_account_by_event_name' already exists
-ERROR 1050 (42S01) at line 1026: Table 'events_statements_summary_global_by_event_name' already exists
-ERROR 1050 (42S01) at line 1035: Table 'hosts' already exists
-ERROR 1050 (42S01) at line 1044: Table 'users' already exists
-ERROR 1050 (42S01) at line 1054: Table 'accounts' already exists
-ERROR 1644 (HY000) at line 1474: Unexpected content found in the performance_schema database.
+ERROR 1050 (42S01) at line 285: Table 'file_summary_by_event_name' already exists
+ERROR 1050 (42S01) at line 316: Table 'file_summary_by_instance' already exists
+ERROR 1050 (42S01) at line 329: Table 'socket_instances' already exists
+ERROR 1050 (42S01) at line 359: Table 'socket_summary_by_instance' already exists
+ERROR 1050 (42S01) at line 388: Table 'socket_summary_by_event_name' already exists
+ERROR 1050 (42S01) at line 397: Table 'mutex_instances' already exists
+ERROR 1050 (42S01) at line 411: Table 'objects_summary_global_by_type' already exists
+ERROR 1050 (42S01) at line 421: Table 'performance_timers' already exists
+ERROR 1050 (42S01) at line 431: Table 'rwlock_instances' already exists
+ERROR 1050 (42S01) at line 440: Table 'setup_actors' already exists
+ERROR 1050 (42S01) at line 448: Table 'setup_consumers' already exists
+ERROR 1050 (42S01) at line 457: Table 'setup_instruments' already exists
+ERROR 1050 (42S01) at line 468: Table 'setup_objects' already exists
+ERROR 1050 (42S01) at line 476: Table 'setup_timers' already exists
+ERROR 1050 (42S01) at line 521: Table 'table_io_waits_summary_by_index_usage' already exists
+ERROR 1050 (42S01) at line 565: Table 'table_io_waits_summary_by_table' already exists
+ERROR 1050 (42S01) at line 644: Table 'table_lock_waits_summary_by_table' already exists
+ERROR 1050 (42S01) at line 664: Table 'threads' already exists
+ERROR 1050 (42S01) at line 679: Table 'events_stages_current' already exists
+ERROR 1050 (42S01) at line 694: Table 'events_stages_history' already exists
+ERROR 1050 (42S01) at line 709: Table 'events_stages_history_long' already exists
+ERROR 1050 (42S01) at line 722: Table 'events_stages_summary_by_thread_by_event_name' already exists
+ERROR 1050 (42S01) at line 735: Table 'events_stages_summary_by_host_by_event_name' already exists
+ERROR 1050 (42S01) at line 748: Table 'events_stages_summary_by_user_by_event_name' already exists
+ERROR 1050 (42S01) at line 762: Table 'events_stages_summary_by_account_by_event_name' already exists
+ERROR 1050 (42S01) at line 774: Table 'events_stages_summary_global_by_event_name' already exists
+ERROR 1050 (42S01) at line 817: Table 'events_statements_current' already exists
+ERROR 1050 (42S01) at line 860: Table 'events_statements_history' already exists
+ERROR 1050 (42S01) at line 903: Table 'events_statements_history_long' already exists
+ERROR 1050 (42S01) at line 935: Table 'events_statements_summary_by_thread_by_event_name' already exists
+ERROR 1050 (42S01) at line 967: Table 'events_statements_summary_by_host_by_event_name' already exists
+ERROR 1050 (42S01) at line 999: Table 'events_statements_summary_by_user_by_event_name' already exists
+ERROR 1050 (42S01) at line 1032: Table 'events_statements_summary_by_account_by_event_name' already exists
+ERROR 1050 (42S01) at line 1063: Table 'events_statements_summary_global_by_event_name' already exists
+ERROR 1050 (42S01) at line 1072: Table 'hosts' already exists
+ERROR 1050 (42S01) at line 1081: Table 'users' already exists
+ERROR 1050 (42S01) at line 1091: Table 'accounts' already exists
+ERROR 1644 (HY000) at line 1511: Unexpected content found in the performance_schema database.
 FATAL ERROR: Upgrade failed
 select name from mysql.proc where db='performance_schema';
 name
@@ -257,44 +257,44 @@ ERROR 1050 (42S01) at line 222: Table 'e
 ERROR 1050 (42S01) at line 235: Table 'events_waits_summary_by_thread_by_event_name' already exists
 ERROR 1050 (42S01) at line 247: Table 'events_waits_summary_global_by_event_name' already exists
 ERROR 1050 (42S01) at line 256: Table 'file_instances' already exists
-ERROR 1050 (42S01) at line 267: Table 'file_summary_by_event_name' already exists
-ERROR 1050 (42S01) at line 279: Table 'file_summary_by_instance' already exists
-ERROR 1050 (42S01) at line 292: Table 'socket_instances' already exists
-ERROR 1050 (42S01) at line 322: Table 'socket_summary_by_instance' already exists
-ERROR 1050 (42S01) at line 351: Table 'socket_summary_by_event_name' already exists
-ERROR 1050 (42S01) at line 360: Table 'mutex_instances' already exists
-ERROR 1050 (42S01) at line 374: Table 'objects_summary_global_by_type' already exists
-ERROR 1050 (42S01) at line 384: Table 'performance_timers' already exists
-ERROR 1050 (42S01) at line 394: Table 'rwlock_instances' already exists
-ERROR 1050 (42S01) at line 403: Table 'setup_actors' already exists
-ERROR 1050 (42S01) at line 411: Table 'setup_consumers' already exists
-ERROR 1050 (42S01) at line 420: Table 'setup_instruments' already exists
-ERROR 1050 (42S01) at line 431: Table 'setup_objects' already exists
-ERROR 1050 (42S01) at line 439: Table 'setup_timers' already exists
-ERROR 1050 (42S01) at line 484: Table 'table_io_waits_summary_by_index_usage' already exists
-ERROR 1050 (42S01) at line 528: Table 'table_io_waits_summary_by_table' already exists
-ERROR 1050 (42S01) at line 607: Table 'table_lock_waits_summary_by_table' already exists
-ERROR 1050 (42S01) at line 627: Table 'threads' already exists
-ERROR 1050 (42S01) at line 642: Table 'events_stages_current' already exists
-ERROR 1050 (42S01) at line 657: Table 'events_stages_history' already exists
-ERROR 1050 (42S01) at line 672: Table 'events_stages_history_long' already exists
-ERROR 1050 (42S01) at line 685: Table 'events_stages_summary_by_thread_by_event_name' already exists
-ERROR 1050 (42S01) at line 698: Table 'events_stages_summary_by_host_by_event_name' already exists
-ERROR 1050 (42S01) at line 711: Table 'events_stages_summary_by_user_by_event_name' already exists
-ERROR 1050 (42S01) at line 725: Table 'events_stages_summary_by_account_by_event_name' already exists
-ERROR 1050 (42S01) at line 737: Table 'events_stages_summary_global_by_event_name' already exists
-ERROR 1050 (42S01) at line 780: Table 'events_statements_current' already exists
-ERROR 1050 (42S01) at line 823: Table 'events_statements_history' already exists
-ERROR 1050 (42S01) at line 866: Table 'events_statements_history_long' already exists
-ERROR 1050 (42S01) at line 898: Table 'events_statements_summary_by_thread_by_event_name' already exists
-ERROR 1050 (42S01) at line 930: Table 'events_statements_summary_by_host_by_event_name' already exists
-ERROR 1050 (42S01) at line 962: Table 'events_statements_summary_by_user_by_event_name' already exists
-ERROR 1050 (42S01) at line 995: Table 'events_statements_summary_by_account_by_event_name' already exists
-ERROR 1050 (42S01) at line 1026: Table 'events_statements_summary_global_by_event_name' already exists
-ERROR 1050 (42S01) at line 1035: Table 'hosts' already exists
-ERROR 1050 (42S01) at line 1044: Table 'users' already exists
-ERROR 1050 (42S01) at line 1054: Table 'accounts' already exists
-ERROR 1644 (HY000) at line 1474: Unexpected content found in the performance_schema database.
+ERROR 1050 (42S01) at line 285: Table 'file_summary_by_event_name' already exists
+ERROR 1050 (42S01) at line 316: Table 'file_summary_by_instance' already exists
+ERROR 1050 (42S01) at line 329: Table 'socket_instances' already exists
+ERROR 1050 (42S01) at line 359: Table 'socket_summary_by_instance' already exists
+ERROR 1050 (42S01) at line 388: Table 'socket_summary_by_event_name' already exists
+ERROR 1050 (42S01) at line 397: Table 'mutex_instances' already exists
+ERROR 1050 (42S01) at line 411: Table 'objects_summary_global_by_type' already exists
+ERROR 1050 (42S01) at line 421: Table 'performance_timers' already exists
+ERROR 1050 (42S01) at line 431: Table 'rwlock_instances' already exists
+ERROR 1050 (42S01) at line 440: Table 'setup_actors' already exists
+ERROR 1050 (42S01) at line 448: Table 'setup_consumers' already exists
+ERROR 1050 (42S01) at line 457: Table 'setup_instruments' already exists
+ERROR 1050 (42S01) at line 468: Table 'setup_objects' already exists
+ERROR 1050 (42S01) at line 476: Table 'setup_timers' already exists
+ERROR 1050 (42S01) at line 521: Table 'table_io_waits_summary_by_index_usage' already exists
+ERROR 1050 (42S01) at line 565: Table 'table_io_waits_summary_by_table' already exists
+ERROR 1050 (42S01) at line 644: Table 'table_lock_waits_summary_by_table' already exists
+ERROR 1050 (42S01) at line 664: Table 'threads' already exists
+ERROR 1050 (42S01) at line 679: Table 'events_stages_current' already exists
+ERROR 1050 (42S01) at line 694: Table 'events_stages_history' already exists
+ERROR 1050 (42S01) at line 709: Table 'events_stages_history_long' already exists
+ERROR 1050 (42S01) at line 722: Table 'events_stages_summary_by_thread_by_event_name' already exists
+ERROR 1050 (42S01) at line 735: Table 'events_stages_summary_by_host_by_event_name' already exists
+ERROR 1050 (42S01) at line 748: Table 'events_stages_summary_by_user_by_event_name' already exists
+ERROR 1050 (42S01) at line 762: Table 'events_stages_summary_by_account_by_event_name' already exists
+ERROR 1050 (42S01) at line 774: Table 'events_stages_summary_global_by_event_name' already exists
+ERROR 1050 (42S01) at line 817: Table 'events_statements_current' already exists
+ERROR 1050 (42S01) at line 860: Table 'events_statements_history' already exists
+ERROR 1050 (42S01) at line 903: Table 'events_statements_history_long' already exists
+ERROR 1050 (42S01) at line 935: Table 'events_statements_summary_by_thread_by_event_name' already exists
+ERROR 1050 (42S01) at line 967: Table 'events_statements_summary_by_host_by_event_name' already exists
+ERROR 1050 (42S01) at line 999: Table 'events_statements_summary_by_user_by_event_name' already exists
+ERROR 1050 (42S01) at line 1032: Table 'events_statements_summary_by_account_by_event_name' already exists
+ERROR 1050 (42S01) at line 1063: Table 'events_statements_summary_global_by_event_name' already exists
+ERROR 1050 (42S01) at line 1072: Table 'hosts' already exists
+ERROR 1050 (42S01) at line 1081: Table 'users' already exists
+ERROR 1050 (42S01) at line 1091: Table 'accounts' already exists
+ERROR 1644 (HY000) at line 1511: Unexpected content found in the performance_schema database.
 FATAL ERROR: Upgrade failed
 select name from mysql.event where db='performance_schema';
 name

=== modified file 'mysql-test/suite/perfschema/r/relaylog.result'
--- a/mysql-test/suite/perfschema/r/relaylog.result	2011-06-29 20:25:37 +0000
+++ b/mysql-test/suite/perfschema/r/relaylog.result	2011-09-02 20:03:36 +0000
@@ -23,7 +23,7 @@ master-bin.000001	wait/io/file/sql/binlo
 master-bin.index	wait/io/file/sql/binlog_index	NONE	NONE	NONE	NONE
 select * from performance_schema.file_summary_by_instance
 where file_name like "%slave-%" order by file_name;
-FILE_NAME	EVENT_NAME	COUNT_READ	COUNT_WRITE	SUM_NUMBER_OF_BYTES_READ	SUM_NUMBER_OF_BYTES_WRITE
+FILE_NAME	EVENT_NAME	OBJECT_INSTANCE_BEGIN	COUNT_STAR	SUM_TIMER_WAIT	MIN_TIMER_WAIT	AVG_TIMER_WAIT	MAX_TIMER_WAIT	COUNT_READ	SUM_TIMER_READ	MIN_TIMER_READ	AVG_TIMER_READ	MAX_TIMER_READ	SUM_NUMBER_OF_BYTES_READ	COUNT_WRITE	SUM_TIMER_WRITE	MIN_TIMER_WRITE	AVG_TIMER_WRITE	MAX_TIMER_WRITE	SUM_NUMBER_OF_BYTES_WRITE	COUNT_MISC	SUM_TIMER_MISC	MIN_TIMER_MISC	AVG_TIMER_MISC	MAX_TIMER_MISC
 "Expect a master binlog + binlog_index"
 select
 substring(file_name, locate("master-", file_name)) as FILE_NAME,
@@ -62,12 +62,12 @@ wait/synch/mutex/sql/MYSQL_BIN_LOG::LOCK
 "Expect no slave relay log"
 select * from performance_schema.file_summary_by_instance
 where event_name like "%relaylog%" order by file_name;
-FILE_NAME	EVENT_NAME	COUNT_READ	COUNT_WRITE	SUM_NUMBER_OF_BYTES_READ	SUM_NUMBER_OF_BYTES_WRITE
+FILE_NAME	EVENT_NAME	OBJECT_INSTANCE_BEGIN	COUNT_STAR	SUM_TIMER_WAIT	MIN_TIMER_WAIT	AVG_TIMER_WAIT	MAX_TIMER_WAIT	COUNT_READ	SUM_TIMER_READ	MIN_TIMER_READ	AVG_TIMER_READ	MAX_TIMER_READ	SUM_NUMBER_OF_BYTES_READ	COUNT_WRITE	SUM_TIMER_WRITE	MIN_TIMER_WRITE	AVG_TIMER_WRITE	MAX_TIMER_WRITE	SUM_NUMBER_OF_BYTES_WRITE	COUNT_MISC	SUM_TIMER_MISC	MIN_TIMER_MISC	AVG_TIMER_MISC	MAX_TIMER_MISC
 select * from performance_schema.file_summary_by_event_name
 where event_name like "%relaylog%" order by event_name;
-EVENT_NAME	COUNT_READ	COUNT_WRITE	SUM_NUMBER_OF_BYTES_READ	SUM_NUMBER_OF_BYTES_WRITE
-wait/io/file/sql/relaylog	0	0	0	0
-wait/io/file/sql/relaylog_index	0	0	0	0
+EVENT_NAME	COUNT_STAR	SUM_TIMER_WAIT	MIN_TIMER_WAIT	AVG_TIMER_WAIT	MAX_TIMER_WAIT	COUNT_READ	SUM_TIMER_READ	MIN_TIMER_READ	AVG_TIMER_READ	MAX_TIMER_READ	SUM_NUMBER_OF_BYTES_READ	COUNT_WRITE	SUM_TIMER_WRITE	MIN_TIMER_WRITE	AVG_TIMER_WRITE	MAX_TIMER_WRITE	SUM_NUMBER_OF_BYTES_WRITE	COUNT_MISC	SUM_TIMER_MISC	MIN_TIMER_MISC	AVG_TIMER_MISC	MAX_TIMER_MISC
+wait/io/file/sql/relaylog	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0
+wait/io/file/sql/relaylog_index	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0
 select * from performance_schema.events_waits_summary_global_by_event_name
 where event_name like "%MYSQL_RELAY_LOG%"
   and event_name not like "%MYSQL_RELAY_LOG::update_cond"
@@ -77,7 +77,7 @@ wait/synch/mutex/sql/MYSQL_RELAY_LOG::LO
 "============ Performance schema on slave ============"
 select * from performance_schema.file_summary_by_instance
 where file_name like "%master-%" order by file_name;
-FILE_NAME	EVENT_NAME	COUNT_READ	COUNT_WRITE	SUM_NUMBER_OF_BYTES_READ	SUM_NUMBER_OF_BYTES_WRITE
+FILE_NAME	EVENT_NAME	OBJECT_INSTANCE_BEGIN	COUNT_STAR	SUM_TIMER_WAIT	MIN_TIMER_WAIT	AVG_TIMER_WAIT	MAX_TIMER_WAIT	COUNT_READ	SUM_TIMER_READ	MIN_TIMER_READ	AVG_TIMER_READ	MAX_TIMER_READ	SUM_NUMBER_OF_BYTES_READ	COUNT_WRITE	SUM_TIMER_WRITE	MIN_TIMER_WRITE	AVG_TIMER_WRITE	MAX_TIMER_WRITE	SUM_NUMBER_OF_BYTES_WRITE	COUNT_MISC	SUM_TIMER_MISC	MIN_TIMER_MISC	AVG_TIMER_MISC	MAX_TIMER_MISC
 select
 substring(file_name, locate("slave-", file_name)) as FILE_NAME,
 EVENT_NAME,

=== modified file 'mysql-test/suite/perfschema/r/schema.result'
--- a/mysql-test/suite/perfschema/r/schema.result	2011-08-11 03:11:58 +0000
+++ b/mysql-test/suite/perfschema/r/schema.result	2011-09-02 20:03:36 +0000
@@ -579,20 +579,57 @@ show create table file_summary_by_event_
 Table	Create Table
 file_summary_by_event_name	CREATE TABLE `file_summary_by_event_name` (
   `EVENT_NAME` varchar(128) NOT NULL,
+  `COUNT_STAR` bigint(20) unsigned NOT NULL,
+  `SUM_TIMER_WAIT` bigint(20) unsigned NOT NULL,
+  `MIN_TIMER_WAIT` bigint(20) unsigned NOT NULL,
+  `AVG_TIMER_WAIT` bigint(20) unsigned NOT NULL,
+  `MAX_TIMER_WAIT` bigint(20) unsigned NOT NULL,
   `COUNT_READ` bigint(20) unsigned NOT NULL,
+  `SUM_TIMER_READ` bigint(20) unsigned NOT NULL,
+  `MIN_TIMER_READ` bigint(20) unsigned NOT NULL,
+  `AVG_TIMER_READ` bigint(20) unsigned NOT NULL,
+  `MAX_TIMER_READ` bigint(20) unsigned NOT NULL,
+  `SUM_NUMBER_OF_BYTES_READ` bigint(20) unsigned NOT NULL,
   `COUNT_WRITE` bigint(20) unsigned NOT NULL,
-  `SUM_NUMBER_OF_BYTES_READ` bigint(20) NOT NULL,
-  `SUM_NUMBER_OF_BYTES_WRITE` bigint(20) NOT NULL
+  `SUM_TIMER_WRITE` bigint(20) unsigned NOT NULL,
+  `MIN_TIMER_WRITE` bigint(20) unsigned NOT NULL,
+  `AVG_TIMER_WRITE` bigint(20) unsigned NOT NULL,
+  `MAX_TIMER_WRITE` bigint(20) unsigned NOT NULL,
+  `SUM_NUMBER_OF_BYTES_WRITE` bigint(20) unsigned NOT NULL,
+  `COUNT_MISC` bigint(20) unsigned NOT NULL,
+  `SUM_TIMER_MISC` bigint(20) unsigned NOT NULL,
+  `MIN_TIMER_MISC` bigint(20) unsigned NOT NULL,
+  `AVG_TIMER_MISC` bigint(20) unsigned NOT NULL,
+  `MAX_TIMER_MISC` bigint(20) unsigned NOT NULL
 ) ENGINE=PERFORMANCE_SCHEMA DEFAULT CHARSET=utf8
 show create table file_summary_by_instance;
 Table	Create Table
 file_summary_by_instance	CREATE TABLE `file_summary_by_instance` (
   `FILE_NAME` varchar(512) NOT NULL,
   `EVENT_NAME` varchar(128) NOT NULL,
+  `OBJECT_INSTANCE_BEGIN` bigint(20) unsigned NOT NULL,
+  `COUNT_STAR` bigint(20) unsigned NOT NULL,
+  `SUM_TIMER_WAIT` bigint(20) unsigned NOT NULL,
+  `MIN_TIMER_WAIT` bigint(20) unsigned NOT NULL,
+  `AVG_TIMER_WAIT` bigint(20) unsigned NOT NULL,
+  `MAX_TIMER_WAIT` bigint(20) unsigned NOT NULL,
   `COUNT_READ` bigint(20) unsigned NOT NULL,
+  `SUM_TIMER_READ` bigint(20) unsigned NOT NULL,
+  `MIN_TIMER_READ` bigint(20) unsigned NOT NULL,
+  `AVG_TIMER_READ` bigint(20) unsigned NOT NULL,
+  `MAX_TIMER_READ` bigint(20) unsigned NOT NULL,
+  `SUM_NUMBER_OF_BYTES_READ` bigint(20) unsigned NOT NULL,
   `COUNT_WRITE` bigint(20) unsigned NOT NULL,
-  `SUM_NUMBER_OF_BYTES_READ` bigint(20) NOT NULL,
-  `SUM_NUMBER_OF_BYTES_WRITE` bigint(20) NOT NULL
+  `SUM_TIMER_WRITE` bigint(20) unsigned NOT NULL,
+  `MIN_TIMER_WRITE` bigint(20) unsigned NOT NULL,
+  `AVG_TIMER_WRITE` bigint(20) unsigned NOT NULL,
+  `MAX_TIMER_WRITE` bigint(20) unsigned NOT NULL,
+  `SUM_NUMBER_OF_BYTES_WRITE` bigint(20) unsigned NOT NULL,
+  `COUNT_MISC` bigint(20) unsigned NOT NULL,
+  `SUM_TIMER_MISC` bigint(20) unsigned NOT NULL,
+  `MIN_TIMER_MISC` bigint(20) unsigned NOT NULL,
+  `AVG_TIMER_MISC` bigint(20) unsigned NOT NULL,
+  `MAX_TIMER_MISC` bigint(20) unsigned NOT NULL
 ) ENGINE=PERFORMANCE_SCHEMA DEFAULT CHARSET=utf8
 show create table hosts;
 Table	Create Table

=== modified file 'mysql-test/suite/perfschema/r/start_server_nothing.result'
--- a/mysql-test/suite/perfschema/r/start_server_nothing.result	2011-08-11 03:11:58 +0000
+++ b/mysql-test/suite/perfschema/r/start_server_nothing.result	2011-09-02 20:03:36 +0000
@@ -220,9 +220,9 @@ idle	0	0	0	0	0
 select * from performance_schema.file_instances;
 FILE_NAME	EVENT_NAME	OPEN_COUNT
 select * from performance_schema.file_summary_by_event_name;
-EVENT_NAME	COUNT_READ	COUNT_WRITE	SUM_NUMBER_OF_BYTES_READ	SUM_NUMBER_OF_BYTES_WRITE
+EVENT_NAME	COUNT_STAR	SUM_TIMER_WAIT	MIN_TIMER_WAIT	AVG_TIMER_WAIT	MAX_TIMER_WAIT	COUNT_READ	SUM_TIMER_READ	MIN_TIMER_READ	AVG_TIMER_READ	MAX_TIMER_READ	SUM_NUMBER_OF_BYTES_READ	COUNT_WRITE	SUM_TIMER_WRITE	MIN_TIMER_WRITE	AVG_TIMER_WRITE	MAX_TIMER_WRITE	SUM_NUMBER_OF_BYTES_WRITE	COUNT_MISC	SUM_TIMER_MISC	MIN_TIMER_MISC	AVG_TIMER_MISC	MAX_TIMER_MISC
 select * from performance_schema.file_summary_by_instance;
-FILE_NAME	EVENT_NAME	COUNT_READ	COUNT_WRITE	SUM_NUMBER_OF_BYTES_READ	SUM_NUMBER_OF_BYTES_WRITE
+FILE_NAME	EVENT_NAME	OBJECT_INSTANCE_BEGIN	COUNT_STAR	SUM_TIMER_WAIT	MIN_TIMER_WAIT	AVG_TIMER_WAIT	MAX_TIMER_WAIT	COUNT_READ	SUM_TIMER_READ	MIN_TIMER_READ	AVG_TIMER_READ	MAX_TIMER_READ	SUM_NUMBER_OF_BYTES_READ	COUNT_WRITE	SUM_TIMER_WRITE	MIN_TIMER_WRITE	AVG_TIMER_WRITE	MAX_TIMER_WRITE	SUM_NUMBER_OF_BYTES_WRITE	COUNT_MISC	SUM_TIMER_MISC	MIN_TIMER_MISC	AVG_TIMER_MISC	MAX_TIMER_MISC
 select * from performance_schema.socket_instances;
 EVENT_NAME	OBJECT_INSTANCE_BEGIN	THREAD_ID	SOCKET_ID	IP	PORT	STATE
 select * from performance_schema.socket_summary_by_instance;

=== modified file 'mysql-test/suite/perfschema/r/table_schema.result'
--- a/mysql-test/suite/perfschema/r/table_schema.result	2011-08-11 03:11:58 +0000
+++ b/mysql-test/suite/perfschema/r/table_schema.result	2011-09-02 20:03:36 +0000
@@ -410,16 +410,53 @@ def	performance_schema	file_instances	FI
 def	performance_schema	file_instances	EVENT_NAME	2	NULL	NO	varchar	128	384	NULL	NULL	utf8	utf8_general_ci	varchar(128)			select,insert,update,references	
 def	performance_schema	file_instances	OPEN_COUNT	3	NULL	NO	int	NULL	NULL	10	0	NULL	NULL	int(10) unsigned			select,insert,update,references	
 def	performance_schema	file_summary_by_event_name	EVENT_NAME	1	NULL	NO	varchar	128	384	NULL	NULL	utf8	utf8_general_ci	varchar(128)			select,insert,update,references	
-def	performance_schema	file_summary_by_event_name	COUNT_READ	2	NULL	NO	bigint	NULL	NULL	20	0	NULL	NULL	bigint(20) unsigned			select,insert,update,references	
-def	performance_schema	file_summary_by_event_name	COUNT_WRITE	3	NULL	NO	bigint	NULL	NULL	20	0	NULL	NULL	bigint(20) unsigned			select,insert,update,references	
-def	performance_schema	file_summary_by_event_name	SUM_NUMBER_OF_BYTES_READ	4	NULL	NO	bigint	NULL	NULL	19	0	NULL	NULL	bigint(20)			select,insert,update,references	
-def	performance_schema	file_summary_by_event_name	SUM_NUMBER_OF_BYTES_WRITE	5	NULL	NO	bigint	NULL	NULL	19	0	NULL	NULL	bigint(20)			select,insert,update,references	
+def	performance_schema	file_summary_by_event_name	COUNT_STAR	2	NULL	NO	bigint	NULL	NULL	20	0	NULL	NULL	bigint(20) unsigned			select,insert,update,references	
+def	performance_schema	file_summary_by_event_name	SUM_TIMER_WAIT	3	NULL	NO	bigint	NULL	NULL	20	0	NULL	NULL	bigint(20) unsigned			select,insert,update,references	
+def	performance_schema	file_summary_by_event_name	MIN_TIMER_WAIT	4	NULL	NO	bigint	NULL	NULL	20	0	NULL	NULL	bigint(20) unsigned			select,insert,update,references	
+def	performance_schema	file_summary_by_event_name	AVG_TIMER_WAIT	5	NULL	NO	bigint	NULL	NULL	20	0	NULL	NULL	bigint(20) unsigned			select,insert,update,references	
+def	performance_schema	file_summary_by_event_name	MAX_TIMER_WAIT	6	NULL	NO	bigint	NULL	NULL	20	0	NULL	NULL	bigint(20) unsigned			select,insert,update,references	
+def	performance_schema	file_summary_by_event_name	COUNT_READ	7	NULL	NO	bigint	NULL	NULL	20	0	NULL	NULL	bigint(20) unsigned			select,insert,update,references	
+def	performance_schema	file_summary_by_event_name	SUM_TIMER_READ	8	NULL	NO	bigint	NULL	NULL	20	0	NULL	NULL	bigint(20) unsigned			select,insert,update,references	
+def	performance_schema	file_summary_by_event_name	MIN_TIMER_READ	9	NULL	NO	bigint	NULL	NULL	20	0	NULL	NULL	bigint(20) unsigned			select,insert,update,references	
+def	performance_schema	file_summary_by_event_name	AVG_TIMER_READ	10	NULL	NO	bigint	NULL	NULL	20	0	NULL	NULL	bigint(20) unsigned			select,insert,update,references	
+def	performance_schema	file_summary_by_event_name	MAX_TIMER_READ	11	NULL	NO	bigint	NULL	NULL	20	0	NULL	NULL	bigint(20) unsigned			select,insert,update,references	
+def	performance_schema	file_summary_by_event_name	SUM_NUMBER_OF_BYTES_READ	12	NULL	NO	bigint	NULL	NULL	20	0	NULL	NULL	bigint(20) unsigned			select,insert,update,references	
+def	performance_schema	file_summary_by_event_name	COUNT_WRITE	13	NULL	NO	bigint	NULL	NULL	20	0	NULL	NULL	bigint(20) unsigned			select,insert,update,references	
+def	performance_schema	file_summary_by_event_name	SUM_TIMER_WRITE	14	NULL	NO	bigint	NULL	NULL	20	0	NULL	NULL	bigint(20) unsigned			select,insert,update,references	
+def	performance_schema	file_summary_by_event_name	MIN_TIMER_WRITE	15	NULL	NO	bigint	NULL	NULL	20	0	NULL	NULL	bigint(20) unsigned			select,insert,update,references	
+def	performance_schema	file_summary_by_event_name	AVG_TIMER_WRITE	16	NULL	NO	bigint	NULL	NULL	20	0	NULL	NULL	bigint(20) unsigned			select,insert,update,references	
+def	performance_schema	file_summary_by_event_name	MAX_TIMER_WRITE	17	NULL	NO	bigint	NULL	NULL	20	0	NULL	NULL	bigint(20) unsigned			select,insert,update,references	
+def	performance_schema	file_summary_by_event_name	SUM_NUMBER_OF_BYTES_WRITE	18	NULL	NO	bigint	NULL	NULL	20	0	NULL	NULL	bigint(20) unsigned			select,insert,update,references	
+def	performance_schema	file_summary_by_event_name	COUNT_MISC	19	NULL	NO	bigint	NULL	NULL	20	0	NULL	NULL	bigint(20) unsigned			select,insert,update,references	
+def	performance_schema	file_summary_by_event_name	SUM_TIMER_MISC	20	NULL	NO	bigint	NULL	NULL	20	0	NULL	NULL	bigint(20) unsigned			select,insert,update,references	
+def	performance_schema	file_summary_by_event_name	MIN_TIMER_MISC	21	NULL	NO	bigint	NULL	NULL	20	0	NULL	NULL	bigint(20) unsigned			select,insert,update,references	
+def	performance_schema	file_summary_by_event_name	AVG_TIMER_MISC	22	NULL	NO	bigint	NULL	NULL	20	0	NULL	NULL	bigint(20) unsigned			select,insert,update,references	
+def	performance_schema	file_summary_by_event_name	MAX_TIMER_MISC	23	NULL	NO	bigint	NULL	NULL	20	0	NULL	NULL	bigint(20) unsigned			select,insert,update,references	
 def	performance_schema	file_summary_by_instance	FILE_NAME	1	NULL	NO	varchar	512	1536	NULL	NULL	utf8	utf8_general_ci	varchar(512)			select,insert,update,references	
 def	performance_schema	file_summary_by_instance	EVENT_NAME	2	NULL	NO	varchar	128	384	NULL	NULL	utf8	utf8_general_ci	varchar(128)			select,insert,update,references	
-def	performance_schema	file_summary_by_instance	COUNT_READ	3	NULL	NO	bigint	NULL	NULL	20	0	NULL	NULL	bigint(20) unsigned			select,insert,update,references	
-def	performance_schema	file_summary_by_instance	COUNT_WRITE	4	NULL	NO	bigint	NULL	NULL	20	0	NULL	NULL	bigint(20) unsigned			select,insert,update,references	
-def	performance_schema	file_summary_by_instance	SUM_NUMBER_OF_BYTES_READ	5	NULL	NO	bigint	NULL	NULL	19	0	NULL	NULL	bigint(20)			select,insert,update,references	
-def	performance_schema	file_summary_by_instance	SUM_NUMBER_OF_BYTES_WRITE	6	NULL	NO	bigint	NULL	NULL	19	0	NULL	NULL	bigint(20)			select,insert,update,references	
+def	performance_schema	file_summary_by_instance	OBJECT_INSTANCE_BEGIN	3	NULL	NO	bigint	NULL	NULL	20	0	NULL	NULL	bigint(20) unsigned			select,insert,update,references	
+def	performance_schema	file_summary_by_instance	COUNT_STAR	4	NULL	NO	bigint	NULL	NULL	20	0	NULL	NULL	bigint(20) unsigned			select,insert,update,references	
+def	performance_schema	file_summary_by_instance	SUM_TIMER_WAIT	5	NULL	NO	bigint	NULL	NULL	20	0	NULL	NULL	bigint(20) unsigned			select,insert,update,references	
+def	performance_schema	file_summary_by_instance	MIN_TIMER_WAIT	6	NULL	NO	bigint	NULL	NULL	20	0	NULL	NULL	bigint(20) unsigned			select,insert,update,references	
+def	performance_schema	file_summary_by_instance	AVG_TIMER_WAIT	7	NULL	NO	bigint	NULL	NULL	20	0	NULL	NULL	bigint(20) unsigned			select,insert,update,references	
+def	performance_schema	file_summary_by_instance	MAX_TIMER_WAIT	8	NULL	NO	bigint	NULL	NULL	20	0	NULL	NULL	bigint(20) unsigned			select,insert,update,references	
+def	performance_schema	file_summary_by_instance	COUNT_READ	9	NULL	NO	bigint	NULL	NULL	20	0	NULL	NULL	bigint(20) unsigned			select,insert,update,references	
+def	performance_schema	file_summary_by_instance	SUM_TIMER_READ	10	NULL	NO	bigint	NULL	NULL	20	0	NULL	NULL	bigint(20) unsigned			select,insert,update,references	
+def	performance_schema	file_summary_by_instance	MIN_TIMER_READ	11	NULL	NO	bigint	NULL	NULL	20	0	NULL	NULL	bigint(20) unsigned			select,insert,update,references	
+def	performance_schema	file_summary_by_instance	AVG_TIMER_READ	12	NULL	NO	bigint	NULL	NULL	20	0	NULL	NULL	bigint(20) unsigned			select,insert,update,references	
+def	performance_schema	file_summary_by_instance	MAX_TIMER_READ	13	NULL	NO	bigint	NULL	NULL	20	0	NULL	NULL	bigint(20) unsigned			select,insert,update,references	
+def	performance_schema	file_summary_by_instance	SUM_NUMBER_OF_BYTES_READ	14	NULL	NO	bigint	NULL	NULL	20	0	NULL	NULL	bigint(20) unsigned			select,insert,update,references	
+def	performance_schema	file_summary_by_instance	COUNT_WRITE	15	NULL	NO	bigint	NULL	NULL	20	0	NULL	NULL	bigint(20) unsigned			select,insert,update,references	
+def	performance_schema	file_summary_by_instance	SUM_TIMER_WRITE	16	NULL	NO	bigint	NULL	NULL	20	0	NULL	NULL	bigint(20) unsigned			select,insert,update,references	
+def	performance_schema	file_summary_by_instance	MIN_TIMER_WRITE	17	NULL	NO	bigint	NULL	NULL	20	0	NULL	NULL	bigint(20) unsigned			select,insert,update,references	
+def	performance_schema	file_summary_by_instance	AVG_TIMER_WRITE	18	NULL	NO	bigint	NULL	NULL	20	0	NULL	NULL	bigint(20) unsigned			select,insert,update,references	
+def	performance_schema	file_summary_by_instance	MAX_TIMER_WRITE	19	NULL	NO	bigint	NULL	NULL	20	0	NULL	NULL	bigint(20) unsigned			select,insert,update,references	
+def	performance_schema	file_summary_by_instance	SUM_NUMBER_OF_BYTES_WRITE	20	NULL	NO	bigint	NULL	NULL	20	0	NULL	NULL	bigint(20) unsigned			select,insert,update,references	
+def	performance_schema	file_summary_by_instance	COUNT_MISC	21	NULL	NO	bigint	NULL	NULL	20	0	NULL	NULL	bigint(20) unsigned			select,insert,update,references	
+def	performance_schema	file_summary_by_instance	SUM_TIMER_MISC	22	NULL	NO	bigint	NULL	NULL	20	0	NULL	NULL	bigint(20) unsigned			select,insert,update,references	
+def	performance_schema	file_summary_by_instance	MIN_TIMER_MISC	23	NULL	NO	bigint	NULL	NULL	20	0	NULL	NULL	bigint(20) unsigned			select,insert,update,references	
+def	performance_schema	file_summary_by_instance	AVG_TIMER_MISC	24	NULL	NO	bigint	NULL	NULL	20	0	NULL	NULL	bigint(20) unsigned			select,insert,update,references	
+def	performance_schema	file_summary_by_instance	MAX_TIMER_MISC	25	NULL	NO	bigint	NULL	NULL	20	0	NULL	NULL	bigint(20) unsigned			select,insert,update,references	
 def	performance_schema	hosts	HOST	1	NULL	YES	char	60	180	NULL	NULL	utf8	utf8_bin	char(60)			select,insert,update,references	
 def	performance_schema	hosts	CURRENT_CONNECTIONS	2	NULL	NO	bigint	NULL	NULL	19	0	NULL	NULL	bigint(20)			select,insert,update,references	
 def	performance_schema	hosts	TOTAL_CONNECTIONS	3	NULL	NO	bigint	NULL	NULL	19	0	NULL	NULL	bigint(20)			select,insert,update,references	

=== modified file 'scripts/mysql_system_tables.sql'
--- a/scripts/mysql_system_tables.sql	2011-08-20 00:25:14 +0000
+++ b/scripts/mysql_system_tables.sql	2011-09-02 20:03:36 +0000
@@ -107,31 +107,31 @@ CREATE TABLE IF NOT EXISTS slave_master_
 CREATE TABLE IF NOT EXISTS slave_worker_info (Master_id INTEGER UNSIGNED NOT NULL, Worker_id INTEGER UNSIGNED NOT NULL, Relay_log_name TEXT CHARACTER SET utf8 COLLATE utf8_bin NOT NULL, Relay_log_pos BIGINT UNSIGNED NOT NULL, Master_log_name TEXT CHARACTER SET utf8 COLLATE utf8_bin NOT NULL, Master_log_pos BIGINT UNSIGNED NOT NULL, Checkpoint_relay_log_name TEXT CHARACTER SET utf8 COLLATE utf8_bin NOT NULL, Checkpoint_relay_log_pos BIGINT UNSIGNED NOT NULL, Checkpoint_master_log_name TEXT CHARACTER SET utf8 COLLATE utf8_bin NOT NULL, Checkpoint_master_log_pos BIGINT UNSIGNED NOT NULL, Checkpoint_seqno INT UNSIGNED NOT NULL, Checkpoint_group_size INTEGER UNSIGNED NOT NULL, Checkpoint_group_bitmap BLOB NOT NULL, PRIMARY KEY(Master_id, Worker_id)) ENGINE=MYISAM DEFAULT CHARSET=utf8 COMMENT 'Worker Information';
 
 CREATE TABLE IF NOT EXISTS innodb_table_stats (
-	database_name			VARCHAR(64) NOT NULL,
-	table_name			VARCHAR(64) NOT NULL,
-	stats_timestamp			TIMESTAMP NOT NULL,
-	n_rows				BIGINT UNSIGNED NOT NULL,
-	clustered_index_size		BIGINT UNSIGNED NOT NULL,
-	sum_of_other_index_sizes	BIGINT UNSIGNED NOT NULL,
-	PRIMARY KEY (database_name, table_name)
+   database_name        VARCHAR(64) NOT NULL,
+   table_name        VARCHAR(64) NOT NULL,
+   stats_timestamp         TIMESTAMP NOT NULL,
+   n_rows            BIGINT UNSIGNED NOT NULL,
+   clustered_index_size    BIGINT UNSIGNED NOT NULL,
+   sum_of_other_index_sizes   BIGINT UNSIGNED NOT NULL,
+   PRIMARY KEY (database_name, table_name)
 ) ENGINE=INNODB DEFAULT CHARSET=utf8;
 
 CREATE TABLE IF NOT EXISTS innodb_index_stats (
-	database_name			VARCHAR(64) NOT NULL,
-	table_name			VARCHAR(64) NOT NULL,
-	index_name			VARCHAR(64) NOT NULL,
-	stat_timestamp			TIMESTAMP NOT NULL,
-	/* there are at least:
-	stat_name='size'
-	stat_name='n_leaf_pages'
-	stat_name='n_diff_pfx%' */
-	stat_name			VARCHAR(64) NOT NULL,
-	stat_value			BIGINT UNSIGNED NOT NULL,
-	sample_size			BIGINT UNSIGNED,
-	stat_description		VARCHAR(1024) NOT NULL,
-	PRIMARY KEY (database_name, table_name, index_name, stat_name),
-	FOREIGN KEY (database_name, table_name)
-	  REFERENCES innodb_table_stats (database_name, table_name)
+   database_name        VARCHAR(64) NOT NULL,
+   table_name        VARCHAR(64) NOT NULL,
+   index_name        VARCHAR(64) NOT NULL,
+   stat_timestamp       TIMESTAMP NOT NULL,
+   /* there are at least:
+   stat_name='size'
+   stat_name='n_leaf_pages'
+   stat_name='n_diff_pfx%' */
+   stat_name         VARCHAR(64) NOT NULL,
+   stat_value        BIGINT UNSIGNED NOT NULL,
+   sample_size       BIGINT UNSIGNED,
+   stat_description     VARCHAR(1024) NOT NULL,
+   PRIMARY KEY (database_name, table_name, index_name, stat_name),
+   FOREIGN KEY (database_name, table_name)
+     REFERENCES innodb_table_stats (database_name, table_name)
 ) ENGINE=INNODB DEFAULT CHARSET=utf8;
 
 --
@@ -438,10 +438,28 @@ DROP PREPARE stmt;
 
 SET @cmd="CREATE TABLE performance_schema.file_summary_by_event_name("
   "EVENT_NAME VARCHAR(128) not null,"
+  "COUNT_STAR BIGINT unsigned not null,"
+  "SUM_TIMER_WAIT BIGINT unsigned not null,"
+  "MIN_TIMER_WAIT BIGINT unsigned not null,"
+  "AVG_TIMER_WAIT BIGINT unsigned not null,"
+  "MAX_TIMER_WAIT BIGINT unsigned not null,"
   "COUNT_READ BIGINT unsigned not null,"
+  "SUM_TIMER_READ BIGINT unsigned not null,"
+  "MIN_TIMER_READ BIGINT unsigned not null,"
+  "AVG_TIMER_READ BIGINT unsigned not null,"
+  "MAX_TIMER_READ BIGINT unsigned not null,"
+  "SUM_NUMBER_OF_BYTES_READ BIGINT unsigned not null,"
   "COUNT_WRITE BIGINT unsigned not null,"
-  "SUM_NUMBER_OF_BYTES_READ BIGINT not null,"
-  "SUM_NUMBER_OF_BYTES_WRITE BIGINT not null"
+  "SUM_TIMER_WRITE BIGINT unsigned not null,"
+  "MIN_TIMER_WRITE BIGINT unsigned not null,"
+  "AVG_TIMER_WRITE BIGINT unsigned not null,"
+  "MAX_TIMER_WRITE BIGINT unsigned not null,"
+  "SUM_NUMBER_OF_BYTES_WRITE BIGINT unsigned not null,"
+  "COUNT_MISC BIGINT unsigned not null,"
+  "SUM_TIMER_MISC BIGINT unsigned not null,"
+  "MIN_TIMER_MISC BIGINT unsigned not null,"
+  "AVG_TIMER_MISC BIGINT unsigned not null,"
+  "MAX_TIMER_MISC BIGINT unsigned not null"
   ")ENGINE=PERFORMANCE_SCHEMA;";
 
 SET @str = IF(@have_pfs = 1, @cmd, 'SET @dummy = 0');
@@ -456,10 +474,29 @@ DROP PREPARE stmt;
 SET @cmd="CREATE TABLE performance_schema.file_summary_by_instance("
   "FILE_NAME VARCHAR(512) not null,"
   "EVENT_NAME VARCHAR(128) not null,"
+  "OBJECT_INSTANCE_BEGIN BIGINT unsigned not null,"
+  "COUNT_STAR BIGINT unsigned not null,"
+  "SUM_TIMER_WAIT BIGINT unsigned not null,"
+  "MIN_TIMER_WAIT BIGINT unsigned not null,"
+  "AVG_TIMER_WAIT BIGINT unsigned not null,"
+  "MAX_TIMER_WAIT BIGINT unsigned not null,"
   "COUNT_READ BIGINT unsigned not null,"
+  "SUM_TIMER_READ BIGINT unsigned not null,"
+  "MIN_TIMER_READ BIGINT unsigned not null,"
+  "AVG_TIMER_READ BIGINT unsigned not null,"
+  "MAX_TIMER_READ BIGINT unsigned not null,"
+  "SUM_NUMBER_OF_BYTES_READ BIGINT unsigned not null,"
   "COUNT_WRITE BIGINT unsigned not null,"
-  "SUM_NUMBER_OF_BYTES_READ BIGINT not null,"
-  "SUM_NUMBER_OF_BYTES_WRITE BIGINT not null"
+  "SUM_TIMER_WRITE BIGINT unsigned not null,"
+  "MIN_TIMER_WRITE BIGINT unsigned not null,"
+  "AVG_TIMER_WRITE BIGINT unsigned not null,"
+  "MAX_TIMER_WRITE BIGINT unsigned not null,"
+  "SUM_NUMBER_OF_BYTES_WRITE BIGINT unsigned not null,"
+  "COUNT_MISC BIGINT unsigned not null,"
+  "SUM_TIMER_MISC BIGINT unsigned not null,"
+  "MIN_TIMER_MISC BIGINT unsigned not null,"
+  "AVG_TIMER_MISC BIGINT unsigned not null,"
+  "MAX_TIMER_MISC BIGINT unsigned not null"
   ")ENGINE=PERFORMANCE_SCHEMA;";
 
 SET @str = IF(@have_pfs = 1, @cmd, 'SET @dummy = 0');
@@ -467,6 +504,7 @@ PREPARE stmt FROM @str;
 EXECUTE stmt;
 DROP PREPARE stmt;
 
+
 --
 -- TABLE SOCKET_INSTANCES
 --

=== modified file 'storage/perfschema/CMakeLists.txt'
--- a/storage/perfschema/CMakeLists.txt	2011-08-17 21:08:59 +0000
+++ b/storage/perfschema/CMakeLists.txt	2011-09-02 20:03:36 +0000
@@ -76,7 +76,8 @@ table_ews_by_thread_by_event_name.h
 table_ews_by_user_by_event_name.h
 table_ews_global_by_event_name.h
 table_file_instances.h
-table_file_summary.h
+table_file_summary_by_instance.h
+table_file_summary_by_event_name.h
 table_socket_instances.h
 table_socket_summary_by_instance.h
 table_socket_summary_by_event_name.h
@@ -143,7 +144,8 @@ table_ews_by_thread_by_event_name.cc
 table_ews_by_user_by_event_name.cc
 table_ews_global_by_event_name.cc
 table_file_instances.cc
-table_file_summary.cc
+table_file_summary_by_instance.cc
+table_file_summary_by_event_name.cc
 table_socket_instances.cc
 table_socket_summary_by_instance.cc
 table_socket_summary_by_event_name.cc

=== modified file 'storage/perfschema/pfs.cc'
--- a/storage/perfschema/pfs.cc	2011-08-25 07:53:21 +0000
+++ b/storage/perfschema/pfs.cc	2011-09-02 20:03:36 +0000
@@ -3889,30 +3889,68 @@ static void start_file_wait_v1(PSI_file_
   @sa PSI_v1::end_file_wait.
 */
 static void end_file_wait_v1(PSI_file_locker *locker,
-                             size_t count)
+                             size_t byte_count)
 {
   PSI_file_locker_state *state= reinterpret_cast<PSI_file_locker_state*> (locker);
   DBUG_ASSERT(state != NULL);
-  ulonglong timer_end= 0;
-  ulonglong wait_time= 0;
-
   PFS_file *file= reinterpret_cast<PFS_file *> (state->m_file);
   DBUG_ASSERT(file != NULL);
   PFS_thread *thread= reinterpret_cast<PFS_thread *> (state->m_thread);
 
+  ulonglong timer_end= 0;
+  ulonglong wait_time= 0;
+  PFS_byte_stat *byte_stat;
   register uint flags= state->m_flags;
+  size_t bytes= ((int)byte_count > -1 ? byte_count : 0);
+
+  switch (state->m_operation)
+  {
+    /* Group read operations */
+    case PSI_FILE_READ:
+      byte_stat= &file->m_file_stat.m_io_stat.m_read;
+      break;
+    /* Group write operations */
+    case PSI_FILE_WRITE:
+      byte_stat= &file->m_file_stat.m_io_stat.m_write;
+      break;
+    /* Group remaining operations as miscellaneous */
+    case PSI_FILE_CREATE:
+    case PSI_FILE_CREATE_TMP:
+    case PSI_FILE_OPEN:
+    case PSI_FILE_STREAM_OPEN:
+    case PSI_FILE_STREAM_CLOSE:
+    case PSI_FILE_SEEK:
+    case PSI_FILE_TELL:
+    case PSI_FILE_FLUSH:
+    case PSI_FILE_FSTAT:
+    case PSI_FILE_CHSIZE:
+    case PSI_FILE_DELETE:
+    case PSI_FILE_RENAME:
+    case PSI_FILE_SYNC:
+    case PSI_FILE_STAT:
+      byte_stat= &file->m_file_stat.m_io_stat.m_misc;
+      break;
+    case PSI_FILE_CLOSE:
+      byte_stat= &file->m_file_stat.m_io_stat.m_misc;
+      break;
+    default:
+      DBUG_ASSERT(false);
+      byte_stat= NULL;
+      break;
+  }
 
+  /* Aggregation for EVENTS_WAITS_SUMMARY_BY_INSTANCE */
   if (flags & STATE_FLAG_TIMED)
   {
     timer_end= state->m_timer();
     wait_time= timer_end - state->m_timer_start;
     /* Aggregate to EVENTS_WAITS_SUMMARY_BY_INSTANCE (timed) */
-    file->m_wait_stat.aggregate_value(wait_time);
+    byte_stat->aggregate(wait_time, bytes);
   }
   else
   {
     /* Aggregate to EVENTS_WAITS_SUMMARY_BY_INSTANCE (counted) */
-    file->m_wait_stat.aggregate_counted();
+    byte_stat->aggregate_counted(bytes);
   }
 
   if (flags & STATE_FLAG_THREAD)
@@ -3940,7 +3978,7 @@ static void end_file_wait_v1(PSI_file_lo
       DBUG_ASSERT(wait != NULL);
 
       wait->m_timer_end= timer_end;
-      wait->m_number_of_bytes= count;
+      wait->m_number_of_bytes= bytes;
       if (flag_events_waits_history)
         insert_events_waits_history(thread, wait);
       if (flag_events_waits_history_long)
@@ -3949,15 +3987,9 @@ static void end_file_wait_v1(PSI_file_lo
     }
   }
 
-  /* FIXME: Have file aggregates for every operation */
+  /* Release or destroy the file if necessary */
   switch(state->m_operation)
   {
-  case PSI_FILE_READ:
-    file->m_file_stat.m_io_stat.aggregate_read(count);
-    break;
-  case PSI_FILE_WRITE:
-    file->m_file_stat.m_io_stat.aggregate_write(count);
-    break;
   case PSI_FILE_CLOSE:
   case PSI_FILE_STREAM_CLOSE:
   case PSI_FILE_STAT:

=== modified file 'storage/perfschema/pfs_engine_table.cc'
--- a/storage/perfschema/pfs_engine_table.cc	2011-08-11 03:11:58 +0000
+++ b/storage/perfschema/pfs_engine_table.cc	2011-09-02 20:03:36 +0000
@@ -35,7 +35,8 @@
 #include "table_os_global_by_type.h"
 #include "table_sync_instances.h"
 #include "table_file_instances.h"
-#include "table_file_summary.h"
+#include "table_file_summary_by_instance.h"
+#include "table_file_summary_by_event_name.h"
 #include "table_threads.h"
 
 #include "table_ews_by_host_by_event_name.h"

=== modified file 'storage/perfschema/pfs_instr.cc'
--- a/storage/perfschema/pfs_instr.cc	2011-08-25 07:53:21 +0000
+++ b/storage/perfschema/pfs_instr.cc	2011-09-02 20:03:36 +0000
@@ -1188,6 +1188,7 @@ search:
         pfs->m_wait_stat.reset();
         pfs->m_file_stat.m_open_count= 1;
         pfs->m_file_stat.m_io_stat.reset();
+        pfs->m_identity= (const void *)pfs;
 
         int res;
         res= lf_hash_insert(&filename_hash, thread->m_filename_hash_pins,
@@ -1552,7 +1553,7 @@ static void reset_file_waits_by_instance
   PFS_file *pfs_last= file_array + file_max;
 
   for ( ; pfs < pfs_last; pfs++)
-    pfs->m_wait_stat.reset();
+    pfs->m_file_stat.reset();
 }
 
 static void reset_socket_waits_by_instance(void)

=== modified file 'storage/perfschema/pfs_instr.h'
--- a/storage/perfschema/pfs_instr.h	2011-08-18 12:27:21 +0000
+++ b/storage/perfschema/pfs_instr.h	2011-09-02 20:03:36 +0000
@@ -144,6 +144,8 @@ struct PFS_file : public PFS_instr
   uint32 get_version()
   { return m_lock.get_version(); }
 
+  /** File identity */
+  const void *m_identity;
   /** File name. */
   char m_filename[FN_REFLEN];
   /** File name length in bytes. */

=== modified file 'storage/perfschema/pfs_stat.h'
--- a/storage/perfschema/pfs_stat.h	2011-08-11 03:11:58 +0000
+++ b/storage/perfschema/pfs_stat.h	2011-09-02 20:03:36 +0000
@@ -147,45 +147,44 @@ struct PFS_cond_stat
   ulonglong m_broadcast_count;
 };
 
-/** Statistics for FILE IO usage. */
+/** Statistics for FILE IO. Used for both waits and byte counts. */
 struct PFS_file_io_stat
 {
-  /** Count of READ operations. */
-  ulonglong m_count_read;
-  /** Count of WRITE operations. */
-  ulonglong m_count_write;
-  /** Number of bytes read. */
-  ulonglong m_read_bytes;
-  /** Number of bytes written. */
-  ulonglong m_write_bytes;
+  /** READ statistics */
+  PFS_byte_stat m_read;
+  /** WRITE statistics */
+  PFS_byte_stat m_write;
+  /** Miscelleanous statistics */
+  PFS_byte_stat m_misc;
 
-  /** Reset file statistic. */
   inline void reset(void)
   {
-    m_count_read= 0;
-    m_count_write= 0;
-    m_read_bytes= 0;
-    m_write_bytes= 0;
+    m_read.reset();
+    m_write.reset();
+    m_misc.reset();
   }
 
   inline void aggregate(const PFS_file_io_stat *stat)
   {
-    m_count_read+= stat->m_count_read;
-    m_count_write+= stat->m_count_write;
-    m_read_bytes+= stat->m_read_bytes;
-    m_write_bytes+= stat->m_write_bytes;
+    m_read.aggregate(&stat->m_read);
+    m_write.aggregate(&stat->m_write);
+    m_misc.aggregate(&stat->m_misc);
   }
 
-  inline void aggregate_read(ulonglong bytes)
+  /* Sum waits and byte counts */
+  inline void sum(PFS_byte_stat *stat)
   {
-    m_count_read++;
-    m_read_bytes+= bytes;
+    stat->aggregate(&m_read);
+    stat->aggregate(&m_write);
+    stat->aggregate(&m_misc);
   }
 
-  inline void aggregate_write(ulonglong bytes)
+  /* Sum waits only */
+  inline void sum_waits(PFS_single_stat *stat)
   {
-    m_count_write++;
-    m_write_bytes+= bytes;
+    stat->aggregate(&m_read);
+    stat->aggregate(&m_write);
+    stat->aggregate(&m_misc);
   }
 };
 
@@ -196,6 +195,12 @@ struct PFS_file_stat
   ulong m_open_count;
   /** File IO statistics. */
   PFS_file_io_stat m_io_stat;
+
+  /** Reset file statistics. */
+  inline void reset(void)
+  {
+    m_io_stat.reset();
+  }
 };
 
 /** Statistics for stage usage. */

=== modified file 'storage/perfschema/pfs_visitor.cc'
--- a/storage/perfschema/pfs_visitor.cc	2011-08-11 03:11:58 +0000
+++ b/storage/perfschema/pfs_visitor.cc	2011-09-02 20:03:36 +0000
@@ -935,7 +935,10 @@ void PFS_instance_wait_visitor::visit_co
 
 void PFS_instance_wait_visitor::visit_file(PFS_file *pfs) 
 {
-  m_stat.aggregate(& pfs->m_wait_stat);
+  /* Combine per-operation file wait stats before aggregating */
+  PFS_single_stat stat;
+  pfs->m_file_stat.m_io_stat.sum_waits(&stat);
+  m_stat.aggregate(&stat);
 }
 
 void PFS_instance_wait_visitor::visit_socket(PFS_socket *pfs) 
@@ -1137,4 +1140,22 @@ void PFS_instance_socket_io_stat_visitor
   m_socket_io_stat.aggregate(&pfs->m_socket_stat.m_io_stat);
 }
 
+
+PFS_instance_file_io_stat_visitor::PFS_instance_file_io_stat_visitor()
+{}
+
+PFS_instance_file_io_stat_visitor::~PFS_instance_file_io_stat_visitor()
+{}
+
+void PFS_instance_file_io_stat_visitor::visit_file_class(PFS_file_class *pfs) 
+{
+  /* Aggregate wait times, event counts and byte counts */
+  m_file_io_stat.aggregate(&pfs->m_file_stat.m_io_stat);
+}
+
+void PFS_instance_file_io_stat_visitor::visit_file(PFS_file *pfs) 
+{
+  /* Aggregate wait times, event counts and byte counts */
+  m_file_io_stat.aggregate(&pfs->m_file_stat.m_io_stat);
+}
 /** @} */

=== modified file 'storage/perfschema/pfs_visitor.h'
--- a/storage/perfschema/pfs_visitor.h	2011-08-11 03:11:58 +0000
+++ b/storage/perfschema/pfs_visitor.h	2011-09-02 20:03:36 +0000
@@ -546,6 +546,23 @@ public:
   /** Wait and byte count statistics collected. */
   PFS_socket_io_stat m_socket_io_stat;
 };
+
+/**
+  A concrete instance visitor that aggregates
+  file wait and byte count statistics.
+*/
+class PFS_instance_file_io_stat_visitor : public PFS_instance_visitor
+{
+public:
+  PFS_instance_file_io_stat_visitor();
+  virtual ~PFS_instance_file_io_stat_visitor();
+  virtual void visit_file_class(PFS_file_class *pfs);
+  virtual void visit_file(PFS_file *pfs);
+
+  /** Wait and byte count statistics collected. */
+  PFS_file_io_stat m_file_io_stat;
+};
+
 /** @} */
 #endif
 

=== removed file 'storage/perfschema/table_file_summary.cc'
--- a/storage/perfschema/table_file_summary.cc	2010-11-15 07:40:07 +0000
+++ b/storage/perfschema/table_file_summary.cc	1970-01-01 00:00:00 +0000
@@ -1,390 +0,0 @@
-/* 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,
-  51 Franklin Street, Suite 500, Boston, MA 02110-1335 USA */
-
-/**
-  @file storage/perfschema/table_file_summary.cc
-  Table FILE_SUMMARY_BY_xxx (implementation).
-*/
-
-#include "my_global.h"
-#include "my_pthread.h"
-#include "pfs_instr_class.h"
-#include "pfs_column_types.h"
-#include "pfs_column_values.h"
-#include "table_file_summary.h"
-#include "pfs_global.h"
-
-THR_LOCK table_file_summary_by_event_name::m_table_lock;
-
-static const TABLE_FIELD_TYPE fs_by_event_name_field_types[]=
-{
-  {
-    { C_STRING_WITH_LEN("EVENT_NAME") },
-    { C_STRING_WITH_LEN("varchar(128)") },
-    { NULL, 0}
-  },
-  {
-    { C_STRING_WITH_LEN("COUNT_READ") },
-    { C_STRING_WITH_LEN("bigint(20)") },
-    { NULL, 0}
-  },
-  {
-    { C_STRING_WITH_LEN("COUNT_WRITE") },
-    { C_STRING_WITH_LEN("bigint(20)") },
-    { NULL, 0}
-  },
-  {
-    { C_STRING_WITH_LEN("SUM_NUMBER_OF_BYTES_READ") },
-    { C_STRING_WITH_LEN("bigint(20)") },
-    { NULL, 0}
-  },
-  {
-    { C_STRING_WITH_LEN("SUM_NUMBER_OF_BYTES_WRITE") },
-    { C_STRING_WITH_LEN("bigint(20)") },
-    { NULL, 0}
-  }
-};
-
-TABLE_FIELD_DEF
-table_file_summary_by_event_name::m_field_def=
-{ 5, fs_by_event_name_field_types };
-
-PFS_engine_table_share
-table_file_summary_by_event_name::m_share=
-{
-  { C_STRING_WITH_LEN("file_summary_by_event_name") },
-  &pfs_truncatable_acl,
-  &table_file_summary_by_event_name::create,
-  NULL, /* write_row */
-  table_file_summary_by_event_name::delete_all_rows,
-  NULL, /* get_row_count */
-  1000, /* records */
-  sizeof(PFS_simple_index),
-  &m_table_lock,
-  &m_field_def,
-  false /* checked */
-};
-
-PFS_engine_table* table_file_summary_by_event_name::create(void)
-{
-  return new table_file_summary_by_event_name();
-}
-
-int table_file_summary_by_event_name::delete_all_rows(void)
-{
-  reset_file_instance_io();
-  reset_file_class_io();
-  return 0;
-}
-
-table_file_summary_by_event_name::table_file_summary_by_event_name()
-  : PFS_engine_table(&m_share, &m_pos),
-  m_pos(1), m_next_pos(1)
-{}
-
-void table_file_summary_by_event_name::reset_position(void)
-{
-  m_pos.m_index= 1;
-  m_next_pos.m_index= 1;
-}
-
-int table_file_summary_by_event_name::rnd_next(void)
-{
-  PFS_file_class *file_class;
-
-  m_pos.set_at(&m_next_pos);
-
-  file_class= find_file_class(m_pos.m_index);
-  if (file_class)
-  {
-    make_row(file_class);
-    m_next_pos.set_after(&m_pos);
-    return 0;
-  }
-
-  return HA_ERR_END_OF_FILE;
-}
-
-int table_file_summary_by_event_name::rnd_pos(const void *pos)
-{
-  PFS_file_class *file_class;
-
-  set_position(pos);
-
-  file_class= find_file_class(m_pos.m_index);
-  if (file_class)
-  {
-    make_row(file_class);
-    return 0;
-  }
-
-  return HA_ERR_RECORD_DELETED;
-}
-
-/**
-  Build a row.
-  @param klass            the file class the cursor is reading
-*/
-void table_file_summary_by_event_name::make_row(PFS_file_class *klass)
-{
-  m_row.m_name= &klass->m_name[0];
-  m_row.m_name_length= klass->m_name_length;
-  m_row.m_file_io_stat= klass->m_file_stat.m_io_stat;
-
-  /* For all file instances ... */
-  PFS_file *pfs= file_array;
-  PFS_file *pfs_last= file_array + file_max;
-  for ( ; pfs < pfs_last; pfs++)
-  {
-    if ((pfs->m_class == klass) && pfs->m_lock.is_populated())
-    {
-      /*
-        If the instance belongs to this class,
-        aggregate the instance statistics.
-      */
-      m_row.m_file_io_stat.aggregate(& pfs->m_file_stat.m_io_stat);
-    }
-  }
-}
-
-int table_file_summary_by_event_name::read_row_values(TABLE *table,
-                                                      unsigned char *,
-                                                      Field **fields,
-                                                      bool read_all)
-{
-  Field *f;
-
-  /* Set the null bits */
-  DBUG_ASSERT(table->s->null_bytes == 0);
-
-  /* The row always exists for classes */
-
-  for (; (f= *fields) ; fields++)
-  {
-    if (read_all || bitmap_is_set(table->read_set, f->field_index))
-    {
-      switch(f->field_index)
-      {
-      case 0: /* NAME */
-        set_field_varchar_utf8(f, m_row.m_name, m_row.m_name_length);
-        break;
-      case 1: /* COUNT_READ */
-        set_field_ulonglong(f, m_row.m_file_io_stat.m_count_read);
-        break;
-      case 2: /* COUNT_WRITE */
-        set_field_ulonglong(f, m_row.m_file_io_stat.m_count_write);
-        break;
-      case 3: /* READ_BYTES */
-        set_field_ulonglong(f, m_row.m_file_io_stat.m_read_bytes);
-        break;
-      case 4: /* WRITE_BYTES */
-        set_field_ulonglong(f, m_row.m_file_io_stat.m_write_bytes);
-        break;
-      default:
-        DBUG_ASSERT(false);
-      }
-    }
-  }
-
-  return 0;
-}
-
-THR_LOCK table_file_summary_by_instance::m_table_lock;
-
-static const TABLE_FIELD_TYPE fs_by_instance_field_types[]=
-{
-  {
-    { C_STRING_WITH_LEN("FILE_NAME") },
-    { C_STRING_WITH_LEN("varchar(512)") },
-    { NULL, 0}
-  },
-  {
-    { C_STRING_WITH_LEN("EVENT_NAME") },
-    { C_STRING_WITH_LEN("varchar(128)") },
-    { NULL, 0}
-  },
-  {
-    { C_STRING_WITH_LEN("COUNT_READ") },
-    { C_STRING_WITH_LEN("bigint(20)") },
-    { NULL, 0}
-  },
-  {
-    { C_STRING_WITH_LEN("COUNT_WRITE") },
-    { C_STRING_WITH_LEN("bigint(20)") },
-    { NULL, 0}
-  },
-  {
-    { C_STRING_WITH_LEN("SUM_NUMBER_OF_BYTES_READ") },
-    { C_STRING_WITH_LEN("bigint(20)") },
-    { NULL, 0}
-  },
-  {
-    { C_STRING_WITH_LEN("SUM_NUMBER_OF_BYTES_WRITE") },
-    { C_STRING_WITH_LEN("bigint(20)") },
-    { NULL, 0}
-  }
-};
-
-TABLE_FIELD_DEF
-table_file_summary_by_instance::m_field_def=
-{ 6, fs_by_instance_field_types };
-
-PFS_engine_table_share
-table_file_summary_by_instance::m_share=
-{
-  { C_STRING_WITH_LEN("file_summary_by_instance") },
-  &pfs_truncatable_acl,
-  &table_file_summary_by_instance::create,
-  NULL, /* write_row */
-  table_file_summary_by_instance::delete_all_rows,
-  NULL, /* get_row_count */
-  1000, /* records */
-  sizeof(PFS_simple_index),
-  &m_table_lock,
-  &m_field_def,
-  false /* checked */
-};
-
-PFS_engine_table* table_file_summary_by_instance::create(void)
-{
-  return new table_file_summary_by_instance();
-}
-
-int table_file_summary_by_instance::delete_all_rows(void)
-{
-  reset_file_instance_io();
-  return 0;
-}
-
-table_file_summary_by_instance::table_file_summary_by_instance()
-  : PFS_engine_table(&m_share, &m_pos),
-  m_row_exists(false), m_pos(0), m_next_pos(0)
-{}
-
-void table_file_summary_by_instance::reset_position(void)
-{
-  m_pos.m_index= 0;
-  m_next_pos.m_index= 0;
-}
-
-int table_file_summary_by_instance::rnd_next(void)
-{
-  PFS_file *pfs;
-
-  for (m_pos.set_at(&m_next_pos);
-       m_pos.m_index < file_max;
-       m_pos.next())
-  {
-    pfs= &file_array[m_pos.m_index];
-    if (pfs->m_lock.is_populated())
-    {
-      make_row(pfs);
-      m_next_pos.set_after(&m_pos);
-      return 0;
-    }
-  }
-
-  return HA_ERR_END_OF_FILE;
-}
-
-int table_file_summary_by_instance::rnd_pos(const void *pos)
-{
-  PFS_file *pfs;
-
-  set_position(pos);
-  DBUG_ASSERT(m_pos.m_index < file_max);
-  pfs= &file_array[m_pos.m_index];
-
-  if (! pfs->m_lock.is_populated())
-    return HA_ERR_RECORD_DELETED;
-
-  make_row(pfs);
-  return 0;
-}
-
-/**
-  Build a row.
-  @param pfs              the file the cursor is reading
-*/
-void table_file_summary_by_instance::make_row(PFS_file *pfs)
-{
-  pfs_lock lock;
-  PFS_file_class *safe_class;
-
-  m_row_exists= false;
-
-  /* Protect this reader against a file delete */
-  pfs->m_lock.begin_optimistic_lock(&lock);
-
-  safe_class= sanitize_file_class(pfs->m_class);
-  if (unlikely(safe_class == NULL))
-    return;
-
-  m_row.m_filename= pfs->m_filename;
-  m_row.m_filename_length= pfs->m_filename_length;
-  m_row.m_name= safe_class->m_name;
-  m_row.m_name_length= safe_class->m_name_length;
-  m_row.m_file_io_stat= pfs->m_file_stat.m_io_stat;
-
-  if (pfs->m_lock.end_optimistic_lock(&lock))
-    m_row_exists= true;
-}
-
-int table_file_summary_by_instance::read_row_values(TABLE *table,
-                                                          unsigned char *,
-                                                          Field **fields,
-                                                          bool read_all)
-{
-  Field *f;
-
-  if (unlikely(! m_row_exists))
-    return HA_ERR_RECORD_DELETED;
-
-  /* Set the null bits */
-  DBUG_ASSERT(table->s->null_bytes == 0);
-
-  for (; (f= *fields) ; fields++)
-  {
-    if (read_all || bitmap_is_set(table->read_set, f->field_index))
-    {
-      switch(f->field_index)
-      {
-      case 0: /* FILENAME */
-        set_field_varchar_utf8(f, m_row.m_filename, m_row.m_filename_length);
-        break;
-      case 1: /* NAME */
-        set_field_varchar_utf8(f, m_row.m_name, m_row.m_name_length);
-        break;
-      case 2: /* COUNT_READ */
-        set_field_ulonglong(f, m_row.m_file_io_stat.m_count_read);
-        break;
-      case 3: /* COUNT_WRITE */
-        set_field_ulonglong(f, m_row.m_file_io_stat.m_count_write);
-        break;
-      case 4: /* READ_BYTES */
-        set_field_ulonglong(f, m_row.m_file_io_stat.m_read_bytes);
-        break;
-      case 5: /* WRITE_BYTES */
-        set_field_ulonglong(f, m_row.m_file_io_stat.m_write_bytes);
-        break;
-      default:
-        DBUG_ASSERT(false);
-      }
-    }
-  }
-
-  return 0;
-}
-

=== removed file 'storage/perfschema/table_file_summary.h'
--- a/storage/perfschema/table_file_summary.h	2010-09-23 16:08:54 +0000
+++ b/storage/perfschema/table_file_summary.h	1970-01-01 00:00:00 +0000
@@ -1,151 +0,0 @@
-/* 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,
-  51 Franklin Street, Suite 500, Boston, MA 02110-1335 USA */
-
-#ifndef TABLE_FILE_SUMMARY_H
-#define TABLE_FILE_SUMMARY_H
-
-/**
-  @file storage/perfschema/table_file_summary.h
-  Table FILE_SUMMARY_BY_xxx (declarations).
-*/
-
-#include "pfs_column_types.h"
-#include "pfs_engine_table.h"
-#include "pfs_instr_class.h"
-#include "pfs_instr.h"
-
-/**
-  @addtogroup Performance_schema_tables
-  @{
-*/
-
-/** A row of PERFORMANCE_SCHEMA.FILE_SUMMARY_BY_EVENT_NAME. */
-struct row_file_summary_by_event_name
-{
-  /** Column EVENT_NAME. */
-  const char *m_name;
-  /** Length in bytes of @c m_name. */
-  uint m_name_length;
-  /**
-    Columns COUNT_READ, COUNT_WRITE,
-    SUM_NUMBER_OF_BYTES_READ, SUM_NUMBER_OF_BYTES_WRITE.
-  */
-  PFS_file_io_stat m_file_io_stat;
-};
-
-/** Table PERFORMANCE_SCHEMA.FILE_SUMMARY_BY_EVENT_NAME. */
-class table_file_summary_by_event_name : public PFS_engine_table
-{
-public:
-  /** Table share */
-  static PFS_engine_table_share m_share;
-  static PFS_engine_table* create();
-  static int delete_all_rows();
-
-  virtual int rnd_next();
-  virtual int rnd_pos(const void *pos);
-  virtual void reset_position(void);
-
-protected:
-  void make_row(PFS_file_class *klass);
-
-  virtual int read_row_values(TABLE *table,
-                              unsigned char *buf,
-                              Field **fields,
-                              bool read_all);
-
-  table_file_summary_by_event_name();
-
-public:
-  ~table_file_summary_by_event_name()
-  {}
-
-private:
-  /** Table share lock. */
-  static THR_LOCK m_table_lock;
-  /** Fields definition. */
-  static TABLE_FIELD_DEF m_field_def;
-
-  /** Current row. */
-  row_file_summary_by_event_name m_row;
-  /** Current position. */
-  PFS_simple_index m_pos;
-  /** Next position. */
-  PFS_simple_index m_next_pos;
-};
-
-/** A row of PERFORMANCE_SCHEMA.FILE_SUMMARY_BY_INSTANCE. */
-struct row_file_summary_by_instance
-{
-  /** Column FILE_NAME. */
-  const char *m_filename;
-  /** Length in bytes of @c m_filename. */
-  uint m_filename_length;
-  /** Column EVENT_NAME. */
-  const char *m_name;
-  /** Length in bytes of @c m_name. */
-  uint m_name_length;
-  /**
-    Columns COUNT_READ, COUNT_WRITE,
-    SUM_NUMBER_OF_BYTES_READ, SUM_NUMBER_OF_BYTES_WRITE.
-  */
-  PFS_file_io_stat m_file_io_stat;
-};
-
-/** Table PERFORMANCE_SCHEMA.FILE_UMMARY_BY_INSTANCE. */
-class table_file_summary_by_instance : public PFS_engine_table
-{
-public:
-  /** Table share */
-  static PFS_engine_table_share m_share;
-  static PFS_engine_table* create();
-  static int delete_all_rows();
-
-  virtual int rnd_next();
-  virtual int rnd_pos(const void *pos);
-  virtual void reset_position(void);
-
-protected:
-  void make_row(PFS_file *pfs);
-
-  virtual int read_row_values(TABLE *table,
-                              unsigned char *buf,
-                              Field **fields,
-                              bool read_all);
-
-  table_file_summary_by_instance();
-
-public:
-  ~table_file_summary_by_instance()
-  {}
-
-private:
-  /** Table share lock. */
-  static THR_LOCK m_table_lock;
-  /** Fields definition. */
-  static TABLE_FIELD_DEF m_field_def;
-
-  /** Current row. */
-  row_file_summary_by_instance m_row;
-  /** True if the current row exists. */
-  bool m_row_exists;
-  /** Current position. */
-  PFS_simple_index m_pos;
-  /** Next position. */
-  PFS_simple_index m_next_pos;
-};
-
-/** @} */
-#endif

=== added file 'storage/perfschema/table_file_summary_by_event_name.cc'
--- a/storage/perfschema/table_file_summary_by_event_name.cc	1970-01-01 00:00:00 +0000
+++ b/storage/perfschema/table_file_summary_by_event_name.cc	2011-09-02 20:03:36 +0000
@@ -0,0 +1,352 @@
+/* Copyright (c) 2011, 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,
+  51 Franklin Street, Suite 500, Boston, MA 02110-1335 USA */
+
+/**
+  @file storage/perfschema/table_file_summary.cc
+  Table FILE_SUMMARY_BY_EVENT_NAME(implementation).
+*/
+
+#include "my_global.h"
+#include "my_pthread.h"
+#include "pfs_instr_class.h"
+#include "pfs_column_types.h"
+#include "pfs_column_values.h"
+#include "table_file_summary_by_event_name.h"
+#include "pfs_global.h"
+#include "pfs_visitor.h"
+
+THR_LOCK table_file_summary_by_event_name::m_table_lock;
+
+static const TABLE_FIELD_TYPE field_types[]=
+{
+  {
+    { C_STRING_WITH_LEN("EVENT_NAME") },
+    { C_STRING_WITH_LEN("varchar(128)") },
+    { NULL, 0}
+  },
+  {
+    { C_STRING_WITH_LEN("COUNT_STAR") },
+    { C_STRING_WITH_LEN("bigint(20)") },
+    { NULL, 0}
+  },
+  {
+    { C_STRING_WITH_LEN("SUM_TIMER_WAIT") },
+    { C_STRING_WITH_LEN("bigint(20)") },
+    { NULL, 0}
+  },
+  {
+    { C_STRING_WITH_LEN("MIN_TIMER_WAIT") },
+    { C_STRING_WITH_LEN("bigint(20)") },
+    { NULL, 0}
+  },
+  {
+    { C_STRING_WITH_LEN("AVG_TIMER_WAIT") },
+    { C_STRING_WITH_LEN("bigint(20)") },
+    { NULL, 0}
+  },
+  {
+    { C_STRING_WITH_LEN("MAX_TIMER_WAIT") },
+    { C_STRING_WITH_LEN("bigint(20)") },
+    { NULL, 0}
+  },
+
+  /** Read */
+  {
+    { C_STRING_WITH_LEN("COUNT_READ") },
+    { C_STRING_WITH_LEN("bigint(20)") },
+    { NULL, 0}
+  },
+  {
+    { C_STRING_WITH_LEN("SUM_TIMER_READ") },
+    { C_STRING_WITH_LEN("bigint(20)") },
+    { NULL, 0}
+  },
+  {
+    { C_STRING_WITH_LEN("MIN_TIMER_READ") },
+    { C_STRING_WITH_LEN("bigint(20)") },
+    { NULL, 0}
+  },
+  {
+    { C_STRING_WITH_LEN("AVG_TIMER_READ") },
+    { C_STRING_WITH_LEN("bigint(20)") },
+    { NULL, 0}
+  },
+  {
+    { C_STRING_WITH_LEN("MAX_TIMER_READ") },
+    { C_STRING_WITH_LEN("bigint(20)") },
+    { NULL, 0}
+  },
+  {
+    { C_STRING_WITH_LEN("SUM_NUMBER_OF_BYTES_READ") },
+    { C_STRING_WITH_LEN("bigint(20)") },
+    { NULL, 0}
+  },
+
+  /** Write */
+  {
+    { C_STRING_WITH_LEN("COUNT_WRITE") },
+    { C_STRING_WITH_LEN("bigint(20)") },
+    { NULL, 0}
+  },
+  {
+    { C_STRING_WITH_LEN("SUM_TIMER_WRITE") },
+    { C_STRING_WITH_LEN("bigint(20)") },
+    { NULL, 0}
+  },
+  {
+    { C_STRING_WITH_LEN("MIN_TIMER_WRITE") },
+    { C_STRING_WITH_LEN("bigint(20)") },
+    { NULL, 0}
+  },
+  {
+    { C_STRING_WITH_LEN("AVG_TIMER_WRITE") },
+    { C_STRING_WITH_LEN("bigint(20)") },
+    { NULL, 0}
+  },
+  {
+    { C_STRING_WITH_LEN("MAX_TIMER_WRITE") },
+    { C_STRING_WITH_LEN("bigint(20)") },
+    { NULL, 0}
+  },
+  {
+    { C_STRING_WITH_LEN("SUM_NUMBER_OF_BYTES_WRITE") },
+    { C_STRING_WITH_LEN("bigint(20)") },
+    { NULL, 0}
+  },
+
+  /** Misc */
+  {
+    { C_STRING_WITH_LEN("COUNT_MISC") },
+    { C_STRING_WITH_LEN("bigint(20)") },
+    { NULL, 0}
+  },
+  {
+    { C_STRING_WITH_LEN("SUM_TIMER_MISC") },
+    { C_STRING_WITH_LEN("bigint(20)") },
+    { NULL, 0}
+  },
+  {
+    { C_STRING_WITH_LEN("MIN_TIMER_MISC") },
+    { C_STRING_WITH_LEN("bigint(20)") },
+    { NULL, 0}
+  },
+  {
+    { C_STRING_WITH_LEN("AVG_TIMER_MISC") },
+    { C_STRING_WITH_LEN("bigint(20)") },
+    { NULL, 0}
+  },
+  {
+    { C_STRING_WITH_LEN("MAX_TIMER_MISC") },
+    { C_STRING_WITH_LEN("bigint(20)") },
+    { NULL, 0}
+  }
+};
+
+TABLE_FIELD_DEF
+table_file_summary_by_event_name::m_field_def=
+{ 23, field_types };
+
+PFS_engine_table_share
+table_file_summary_by_event_name::m_share=
+{
+  { C_STRING_WITH_LEN("file_summary_by_event_name") },
+  &pfs_truncatable_acl,
+  &table_file_summary_by_event_name::create,
+  NULL, /* write_row */
+  table_file_summary_by_event_name::delete_all_rows,
+  NULL, /* get_row_count */
+  1000, /* records */
+  sizeof(PFS_simple_index),
+  &m_table_lock,
+  &m_field_def,
+  false /* checked */
+};
+
+PFS_engine_table* table_file_summary_by_event_name::create(void)
+{
+  return new table_file_summary_by_event_name();
+}
+
+int table_file_summary_by_event_name::delete_all_rows(void)
+{
+  reset_file_instance_io();
+  reset_file_class_io();
+  return 0;
+}
+
+table_file_summary_by_event_name::table_file_summary_by_event_name()
+  : PFS_engine_table(&m_share, &m_pos),
+  m_pos(1), m_next_pos(1)
+{}
+
+void table_file_summary_by_event_name::reset_position(void)
+{
+  m_pos.m_index= 1;
+  m_next_pos.m_index= 1;
+}
+
+int table_file_summary_by_event_name::rnd_next(void)
+{
+  PFS_file_class *file_class;
+
+  m_pos.set_at(&m_next_pos);
+
+  file_class= find_file_class(m_pos.m_index);
+  if (file_class)
+  {
+    make_row(file_class);
+    m_next_pos.set_after(&m_pos);
+    return 0;
+  }
+
+  return HA_ERR_END_OF_FILE;
+}
+
+int table_file_summary_by_event_name::rnd_pos(const void *pos)
+{
+  PFS_file_class *file_class;
+
+  set_position(pos);
+
+  file_class= find_file_class(m_pos.m_index);
+  if (file_class)
+  {
+    make_row(file_class);
+    return 0;
+  }
+
+  return HA_ERR_RECORD_DELETED;
+}
+
+/**
+  Build a row.
+  @param klass            the file class the cursor is reading
+*/
+void table_file_summary_by_event_name::make_row(PFS_file_class *file_class)
+{
+  m_row.m_event_name.make_row(file_class);
+
+  PFS_instance_file_io_stat_visitor visitor;
+  PFS_instance_iterator::visit_file_instances(file_class, &visitor);
+
+  time_normalizer *normalizer= time_normalizer::get(wait_timer);
+  
+  /* Collect timer and byte count stats */
+  m_row.m_io_stat.set(normalizer, &visitor.m_file_io_stat);
+  m_row_exists= true;
+
+}
+
+int table_file_summary_by_event_name::read_row_values(TABLE *table,
+                                                      unsigned char *,
+                                                      Field **fields,
+                                                      bool read_all)
+{
+  Field *f;
+
+  if (unlikely(!m_row_exists))
+    return HA_ERR_RECORD_DELETED;
+
+  /* Set the null bits */
+  DBUG_ASSERT(table->s->null_bytes == 0);
+
+  for (; (f= *fields) ; fields++)
+  {
+    if (read_all || bitmap_is_set(table->read_set, f->field_index))
+    {
+      switch(f->field_index)
+      {
+      case  0: /* EVENT_NAME */
+        m_row.m_event_name.set_field(f);
+        break;
+      case  1: /* COUNT_STAR */
+        set_field_ulonglong(f, m_row.m_io_stat.m_all.m_waits.m_count);
+        break;
+      case  2: /* SUM_TIMER_WAIT */
+        set_field_ulonglong(f, m_row.m_io_stat.m_all.m_waits.m_sum);
+        break;
+      case  3: /* MIN_TIMER_WAIT */
+        set_field_ulonglong(f, m_row.m_io_stat.m_all.m_waits.m_min);
+        break;
+      case  4: /* AVG_TIMER_WAIT */
+        set_field_ulonglong(f, m_row.m_io_stat.m_all.m_waits.m_avg);
+        break;
+      case  5: /* MAX_TIMER_WAIT */
+        set_field_ulonglong(f, m_row.m_io_stat.m_all.m_waits.m_max);
+        break;
+
+      case  6: /* COUNT_READ */
+        set_field_ulonglong(f, m_row.m_io_stat.m_read.m_waits.m_count);
+        break;
+      case  7: /* SUM_TIMER_READ */
+        set_field_ulonglong(f, m_row.m_io_stat.m_read.m_waits.m_sum);
+        break;
+      case  8: /* MIN_TIMER_READ */
+        set_field_ulonglong(f, m_row.m_io_stat.m_read.m_waits.m_min);
+        break;
+      case  9: /* AVG_TIMER_READ */
+        set_field_ulonglong(f, m_row.m_io_stat.m_read.m_waits.m_avg);
+        break;
+      case 10: /* MAX_TIMER_READ */
+        set_field_ulonglong(f, m_row.m_io_stat.m_read.m_waits.m_max);
+        break;
+      case 11: /* SUM_NUMBER_OF_BYTES_READ */
+        set_field_ulonglong(f, m_row.m_io_stat.m_read.m_bytes);
+        break;
+
+      case 12: /* COUNT_WRITE */
+        set_field_ulonglong(f, m_row.m_io_stat.m_write.m_waits.m_count);
+        break;
+      case 13: /* SUM_TIMER_WRITE */
+        set_field_ulonglong(f, m_row.m_io_stat.m_write.m_waits.m_sum);
+        break;
+      case 14: /* MIN_TIMER_WRITE */
+        set_field_ulonglong(f, m_row.m_io_stat.m_write.m_waits.m_min);
+        break;
+      case 15: /* AVG_TIMER_WRITE */
+        set_field_ulonglong(f, m_row.m_io_stat.m_write.m_waits.m_avg);
+        break;
+      case 16: /* MAX_TIMER_WRITE */
+        set_field_ulonglong(f, m_row.m_io_stat.m_write.m_waits.m_max);
+        break;
+      case 17: /* SUM_NUMBER_OF_BYTES_WRITE */
+        set_field_ulonglong(f, m_row.m_io_stat.m_write.m_bytes);
+        break;
+
+      case 18: /* COUNT_MISC */
+        set_field_ulonglong(f, m_row.m_io_stat.m_misc.m_waits.m_count);
+        break;
+      case 19: /* SUM_TIMER_MISC */
+        set_field_ulonglong(f, m_row.m_io_stat.m_misc.m_waits.m_sum);
+        break;
+      case 20: /* MIN_TIMER_MISC */
+        set_field_ulonglong(f, m_row.m_io_stat.m_misc.m_waits.m_min);
+        break;
+      case 21: /* AVG_TIMER_MISC */
+        set_field_ulonglong(f, m_row.m_io_stat.m_misc.m_waits.m_avg);
+        break;
+      case 22: /* MAX_TIMER_MISC */
+        set_field_ulonglong(f, m_row.m_io_stat.m_misc.m_waits.m_max);
+        break;
+
+      default:
+        DBUG_ASSERT(false);
+        break;
+      }
+    } // if
+  } // for
+
+  return 0;
+}

=== added file 'storage/perfschema/table_file_summary_by_event_name.h'
--- a/storage/perfschema/table_file_summary_by_event_name.h	1970-01-01 00:00:00 +0000
+++ b/storage/perfschema/table_file_summary_by_event_name.h	2011-09-02 20:03:36 +0000
@@ -0,0 +1,91 @@
+/* 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,
+  51 Franklin Street, Suite 500, Boston, MA 02110-1335 USA */
+
+#ifndef TABLE_FILE_SUMMARY_H
+#define TABLE_FILE_SUMMARY_H
+
+/**
+  @file storage/perfschema/table_file_summary_by_event_name.h
+  Table FILE_SUMMARY_BY_EVENT_NAME (declarations).
+*/
+
+#include "pfs_column_types.h"
+#include "pfs_engine_table.h"
+#include "pfs_instr_class.h"
+#include "pfs_instr.h"
+#include "table_helper.h"
+
+/**
+  @addtogroup Performance_schema_tables
+  @{
+*/
+
+/** A row of PERFORMANCE_SCHEMA.FILE_SUMMARY_BY_EVENT_NAME. */
+struct row_file_summary_by_event_name
+{
+  /** Column EVENT_NAME. */
+  PFS_event_name_row m_event_name;
+
+  /** Columns COUNT_STAR, SUM/MIN/AVG/MAX TIMER and NUMBER_OF_BYTES
+      for READ, WRITE and MISC operation types.
+  */
+  PFS_file_io_stat_row m_io_stat;
+};
+
+/** Table PERFORMANCE_SCHEMA.FILE_SUMMARY_BY_EVENT_NAME. */
+class table_file_summary_by_event_name : public PFS_engine_table
+{
+public:
+  /** Table share */
+  static PFS_engine_table_share m_share;
+  static PFS_engine_table* create();
+  static int delete_all_rows();
+
+  virtual int rnd_next();
+  virtual int rnd_pos(const void *pos);
+  virtual void reset_position(void);
+
+private:
+  virtual int read_row_values(TABLE *table,
+                              unsigned char *buf,
+                              Field **fields,
+                              bool read_all);
+
+  table_file_summary_by_event_name();
+
+public:
+  ~table_file_summary_by_event_name()
+  {}
+
+private:
+  void make_row(PFS_file_class *klass);
+
+  /** Table share lock. */
+  static THR_LOCK m_table_lock;
+  /** Fields definition. */
+  static TABLE_FIELD_DEF m_field_def;
+
+  /** Current row. */
+  row_file_summary_by_event_name m_row;
+  /** True if the current row exists. */
+  bool m_row_exists;
+  /** Current position. */
+  PFS_simple_index m_pos;
+  /** Next position. */
+  PFS_simple_index m_next_pos;
+};
+
+/** @} */
+#endif

=== added file 'storage/perfschema/table_file_summary_by_instance.cc'
--- a/storage/perfschema/table_file_summary_by_instance.cc	1970-01-01 00:00:00 +0000
+++ b/storage/perfschema/table_file_summary_by_instance.cc	2011-09-02 20:03:36 +0000
@@ -0,0 +1,381 @@
+/* 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,
+  51 Franklin Street, Suite 500, Boston, MA 02110-1335 USA */
+
+/**
+  @file storage/perfschema/table_file_summary.cc
+  Table FILE_SUMMARY_BY_INSTANCE (implementation).
+*/
+
+#include "my_global.h"
+#include "my_pthread.h"
+#include "pfs_instr_class.h"
+#include "pfs_column_types.h"
+#include "pfs_column_values.h"
+#include "table_file_summary_by_instance.h"
+#include "pfs_global.h"
+
+THR_LOCK table_file_summary_by_instance::m_table_lock;
+
+static const TABLE_FIELD_TYPE field_types[]=
+{
+  {
+    { C_STRING_WITH_LEN("FILE_NAME") },
+    { C_STRING_WITH_LEN("varchar(512)") },
+    { NULL, 0}
+  },
+  {
+    { C_STRING_WITH_LEN("EVENT_NAME") },
+    { C_STRING_WITH_LEN("varchar(128)") },
+    { NULL, 0}
+  },
+  {
+    { C_STRING_WITH_LEN("OBJECT_INSTANCE_BEGIN") },
+    { C_STRING_WITH_LEN("bigint(20)") },
+    { NULL, 0}
+  },
+  {
+    { C_STRING_WITH_LEN("COUNT_STAR") },
+    { C_STRING_WITH_LEN("bigint(20)") },
+    { NULL, 0}
+  },
+  {
+    { C_STRING_WITH_LEN("SUM_TIMER_WAIT") },
+    { C_STRING_WITH_LEN("bigint(20)") },
+    { NULL, 0}
+  },
+  {
+    { C_STRING_WITH_LEN("MIN_TIMER_WAIT") },
+    { C_STRING_WITH_LEN("bigint(20)") },
+    { NULL, 0}
+  },
+  {
+    { C_STRING_WITH_LEN("AVG_TIMER_WAIT") },
+    { C_STRING_WITH_LEN("bigint(20)") },
+    { NULL, 0}
+  },
+  {
+    { C_STRING_WITH_LEN("MAX_TIMER_WAIT") },
+    { C_STRING_WITH_LEN("bigint(20)") },
+    { NULL, 0}
+  },
+
+  /** Read */
+  {
+    { C_STRING_WITH_LEN("COUNT_READ") },
+    { C_STRING_WITH_LEN("bigint(20)") },
+    { NULL, 0}
+  },
+  {
+    { C_STRING_WITH_LEN("SUM_TIMER_READ") },
+    { C_STRING_WITH_LEN("bigint(20)") },
+    { NULL, 0}
+  },
+  {
+    { C_STRING_WITH_LEN("MIN_TIMER_READ") },
+    { C_STRING_WITH_LEN("bigint(20)") },
+    { NULL, 0}
+  },
+  {
+    { C_STRING_WITH_LEN("AVG_TIMER_READ") },
+    { C_STRING_WITH_LEN("bigint(20)") },
+    { NULL, 0}
+  },
+  {
+    { C_STRING_WITH_LEN("MAX_TIMER_READ") },
+    { C_STRING_WITH_LEN("bigint(20)") },
+    { NULL, 0}
+  },
+  {
+    { C_STRING_WITH_LEN("SUM_NUMBER_OF_BYTES_READ") },
+    { C_STRING_WITH_LEN("bigint(20)") },
+    { NULL, 0}
+  },
+
+  /** Write */
+  {
+    { C_STRING_WITH_LEN("COUNT_WRITE") },
+    { C_STRING_WITH_LEN("bigint(20)") },
+    { NULL, 0}
+  },
+  {
+    { C_STRING_WITH_LEN("SUM_TIMER_WRITE") },
+    { C_STRING_WITH_LEN("bigint(20)") },
+    { NULL, 0}
+  },
+  {
+    { C_STRING_WITH_LEN("MIN_TIMER_WRITE") },
+    { C_STRING_WITH_LEN("bigint(20)") },
+    { NULL, 0}
+  },
+  {
+    { C_STRING_WITH_LEN("AVG_TIMER_WRITE") },
+    { C_STRING_WITH_LEN("bigint(20)") },
+    { NULL, 0}
+  },
+  {
+    { C_STRING_WITH_LEN("MAX_TIMER_WRITE") },
+    { C_STRING_WITH_LEN("bigint(20)") },
+    { NULL, 0}
+  },
+  {
+    { C_STRING_WITH_LEN("SUM_NUMBER_OF_BYTES_WRITE") },
+    { C_STRING_WITH_LEN("bigint(20)") },
+    { NULL, 0}
+  },
+
+  /** Misc */
+  {
+    { C_STRING_WITH_LEN("COUNT_MISC") },
+    { C_STRING_WITH_LEN("bigint(20)") },
+    { NULL, 0}
+  },
+  {
+    { C_STRING_WITH_LEN("SUM_TIMER_MISC") },
+    { C_STRING_WITH_LEN("bigint(20)") },
+    { NULL, 0}
+  },
+  {
+    { C_STRING_WITH_LEN("MIN_TIMER_MISC") },
+    { C_STRING_WITH_LEN("bigint(20)") },
+    { NULL, 0}
+  },
+  {
+    { C_STRING_WITH_LEN("AVG_TIMER_MISC") },
+    { C_STRING_WITH_LEN("bigint(20)") },
+    { NULL, 0}
+  },
+  {
+    { C_STRING_WITH_LEN("MAX_TIMER_MISC") },
+    { C_STRING_WITH_LEN("bigint(20)") },
+    { NULL, 0}
+  }
+};
+
+TABLE_FIELD_DEF
+table_file_summary_by_instance::m_field_def=
+{ 25, field_types };
+
+PFS_engine_table_share
+table_file_summary_by_instance::m_share=
+{
+  { C_STRING_WITH_LEN("file_summary_by_instance") },
+  &pfs_truncatable_acl,
+  &table_file_summary_by_instance::create,
+  NULL, /* write_row */
+  table_file_summary_by_instance::delete_all_rows,
+  NULL, /* get_row_count */
+  1000, /* records */
+  sizeof(PFS_simple_index),
+  &m_table_lock,
+  &m_field_def,
+  false /* checked */
+};
+
+PFS_engine_table* table_file_summary_by_instance::create(void)
+{
+  return new table_file_summary_by_instance();
+}
+
+int table_file_summary_by_instance::delete_all_rows(void)
+{
+  reset_file_instance_io();
+  return 0;
+}
+
+table_file_summary_by_instance::table_file_summary_by_instance()
+  : PFS_engine_table(&m_share, &m_pos),
+  m_row_exists(false), m_pos(0), m_next_pos(0)
+{}
+
+void table_file_summary_by_instance::reset_position(void)
+{
+  m_pos.m_index= 0;
+  m_next_pos.m_index= 0;
+}
+
+int table_file_summary_by_instance::rnd_next(void)
+{
+  PFS_file *pfs;
+
+  for (m_pos.set_at(&m_next_pos);
+       m_pos.m_index < file_max;
+       m_pos.next())
+  {
+    pfs= &file_array[m_pos.m_index];
+    if (pfs->m_lock.is_populated())
+    {
+      make_row(pfs);
+      m_next_pos.set_after(&m_pos);
+      return 0;
+    }
+  }
+
+  return HA_ERR_END_OF_FILE;
+}
+
+int table_file_summary_by_instance::rnd_pos(const void *pos)
+{
+  PFS_file *pfs;
+
+  set_position(pos);
+  DBUG_ASSERT(m_pos.m_index < file_max);
+  pfs= &file_array[m_pos.m_index];
+
+  if (! pfs->m_lock.is_populated())
+    return HA_ERR_RECORD_DELETED;
+
+  make_row(pfs);
+  return 0;
+}
+
+/**
+  Build a row.
+  @param pfs              the file the cursor is reading
+*/
+void table_file_summary_by_instance::make_row(PFS_file *pfs)
+{
+  pfs_lock lock;
+  PFS_file_class *safe_class;
+
+  m_row_exists= false;
+
+  /* Protect this reader against a file delete */
+  pfs->m_lock.begin_optimistic_lock(&lock);
+
+  safe_class= sanitize_file_class(pfs->m_class);
+  if (unlikely(safe_class == NULL))
+    return;
+
+  m_row.m_filename= pfs->m_filename;
+  m_row.m_filename_length= pfs->m_filename_length;
+  m_row.m_event_name.make_row(safe_class);
+  m_row.m_identity= pfs->m_identity;
+
+  time_normalizer *normalizer= time_normalizer::get(wait_timer);
+
+  /* Collect timer and byte count stats */
+  m_row.m_io_stat.set(normalizer, &pfs->m_file_stat.m_io_stat);
+
+  if (pfs->m_lock.end_optimistic_lock(&lock))
+    m_row_exists= true;
+}
+
+int table_file_summary_by_instance::read_row_values(TABLE *table,
+                                                          unsigned char *,
+                                                          Field **fields,
+                                                          bool read_all)
+{
+  Field *f;
+
+  if (unlikely(! m_row_exists))
+    return HA_ERR_RECORD_DELETED;
+
+  /* Set the null bits */
+  DBUG_ASSERT(table->s->null_bytes == 0);
+
+  for (; (f= *fields) ; fields++)
+  {
+    if (read_all || bitmap_is_set(table->read_set, f->field_index))
+    {
+      switch(f->field_index)
+      {
+      case  0: /* FILE_NAME */
+        set_field_varchar_utf8(f, m_row.m_filename, m_row.m_filename_length);
+        break;
+      case  1: /* EVENT_NAME */
+        m_row.m_event_name.set_field(f);
+        break;
+      case  2: /* OBJECT_INSTANCE */
+        set_field_ulonglong(f, (ulonglong)m_row.m_identity);
+        break;
+
+      case  3:/* COUNT_STAR */
+        set_field_ulonglong(f, m_row.m_io_stat.m_all.m_waits.m_count);
+        break;
+      case  4:/* SUM_TIMER_WAIT */
+        set_field_ulonglong(f, m_row.m_io_stat.m_all.m_waits.m_sum);
+        break;
+      case  5: /* MIN_TIMER_WAIT */
+        set_field_ulonglong(f, m_row.m_io_stat.m_all.m_waits.m_min);
+        break;
+      case  6: /* AVG_TIMER_WAIT */
+        set_field_ulonglong(f, m_row.m_io_stat.m_all.m_waits.m_avg);
+        break;
+      case  7: /* MAX_TIMER_WAIT */
+        set_field_ulonglong(f, m_row.m_io_stat.m_all.m_waits.m_max);
+        break;
+
+      case  8: /* COUNT_READ */
+        set_field_ulonglong(f, m_row.m_io_stat.m_read.m_waits.m_count);
+        break;
+      case  9: /* SUM_TIMER_READ */
+        set_field_ulonglong(f, m_row.m_io_stat.m_read.m_waits.m_sum);
+        break;
+      case 10: /* MIN_TIMER_READ */
+        set_field_ulonglong(f, m_row.m_io_stat.m_read.m_waits.m_min);
+        break;
+      case 11: /* AVG_TIMER_READ */
+        set_field_ulonglong(f, m_row.m_io_stat.m_read.m_waits.m_avg);
+        break;
+      case 12: /* MAX_TIMER_READ */
+        set_field_ulonglong(f, m_row.m_io_stat.m_read.m_waits.m_max);
+        break;
+      case 13: /* SUM_NUMBER_OF_BYTES_READ */
+        set_field_ulonglong(f, m_row.m_io_stat.m_read.m_bytes);
+        break;
+
+      case 14: /* COUNT_WRITE */
+        set_field_ulonglong(f, m_row.m_io_stat.m_write.m_waits.m_count);
+        break;
+      case 15: /* SUM_TIMER_WRITE */
+        set_field_ulonglong(f, m_row.m_io_stat.m_write.m_waits.m_sum);
+        break;
+      case 16: /* MIN_TIMER_WRITE */
+        set_field_ulonglong(f, m_row.m_io_stat.m_write.m_waits.m_min);
+        break;
+      case 17: /* AVG_TIMER_WRITE */
+        set_field_ulonglong(f, m_row.m_io_stat.m_write.m_waits.m_avg);
+        break;
+      case 18: /* MAX_TIMER_WRITE */
+        set_field_ulonglong(f, m_row.m_io_stat.m_write.m_waits.m_max);
+        break;
+      case 19: /* SUM_NUMBER_OF_BYTES_WRITE */
+        set_field_ulonglong(f, m_row.m_io_stat.m_write.m_bytes);
+        break;
+
+      case 20: /* COUNT_MISC */
+        set_field_ulonglong(f, m_row.m_io_stat.m_misc.m_waits.m_count);
+        break;
+      case 21: /* SUM_TIMER_MISC */
+        set_field_ulonglong(f, m_row.m_io_stat.m_misc.m_waits.m_sum);
+        break;
+      case 22: /* MIN_TIMER_MISC */
+        set_field_ulonglong(f, m_row.m_io_stat.m_misc.m_waits.m_min);
+        break;
+      case 23: /* AVG_TIMER_MISC */
+        set_field_ulonglong(f, m_row.m_io_stat.m_misc.m_waits.m_avg);
+        break;
+      case 24: /* MAX_TIMER_MISC */
+        set_field_ulonglong(f, m_row.m_io_stat.m_misc.m_waits.m_max);
+        break;
+      default:
+        DBUG_ASSERT(false);
+      }
+    }
+  }
+
+  return 0;
+}
+

=== added file 'storage/perfschema/table_file_summary_by_instance.h'
--- a/storage/perfschema/table_file_summary_by_instance.h	1970-01-01 00:00:00 +0000
+++ b/storage/perfschema/table_file_summary_by_instance.h	2011-09-02 20:03:36 +0000
@@ -0,0 +1,99 @@
+/* Copyright (c) 2011 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,
+  51 Franklin Street, Suite 500, Boston, MA 02110-1335 USA */
+
+#ifndef TABLE_FILE_SUMMARY_BY_INSTANCE_H
+#define TABLE_FILE_SUMMARY_BY_INSTANCE_H
+
+/**
+  @file storage/perfschema/table_file_summary_by_instance.h
+  Table FILE_SUMMARY_BY_INSTANCE (declarations).
+*/
+
+#include "pfs_column_types.h"
+#include "pfs_engine_table.h"
+#include "pfs_instr_class.h"
+#include "pfs_instr.h"
+#include "table_helper.h"
+
+/**
+  @addtogroup Performance_schema_tables
+  @{
+*/
+
+/** A row of PERFORMANCE_SCHEMA.FILE_SUMMARY_BY_INSTANCE. */
+struct row_file_summary_by_instance
+{
+  /** Column FILE_NAME. */
+  const char *m_filename;
+  /** Length in bytes of @c m_filename. */
+  uint m_filename_length;
+
+  /** Column EVENT_NAME. */
+  PFS_event_name_row m_event_name;
+
+  /** Column OBJECT_INSTANCE_BEGIN */
+  const void *m_identity;
+  /**
+    Columns COUNT_STAR, SUM/MIN/AVG/MAX TIMER and NUMBER_OF_BYTES for READ,
+    WRITE and MISC operation types.
+  */
+  PFS_file_io_stat_row m_io_stat;
+};
+
+/** Table PERFORMANCE_SCHEMA.FILE_SUMMARY_BY_INSTANCE. */
+class table_file_summary_by_instance : public PFS_engine_table
+{
+public:
+  /** Table share */
+  static PFS_engine_table_share m_share;
+  static PFS_engine_table* create();
+  static int delete_all_rows();
+
+  virtual int rnd_next();
+  virtual int rnd_pos(const void *pos);
+  virtual void reset_position(void);
+
+private:
+  virtual int read_row_values(TABLE *table,
+                              unsigned char *buf,
+                              Field **fields,
+                              bool read_all);
+
+  table_file_summary_by_instance();
+
+public:
+  ~table_file_summary_by_instance()
+  {}
+
+private:
+  void make_row(PFS_file *pfs);
+
+  /** Table share lock. */
+  static THR_LOCK m_table_lock;
+  /** Fields definition. */
+  static TABLE_FIELD_DEF m_field_def;
+
+  /** Current row. */
+  row_file_summary_by_instance m_row;
+  /** True if the current row exists. */
+  bool m_row_exists;
+  /** Current position. */
+  PFS_simple_index m_pos;
+  /** Next position. */
+  PFS_simple_index m_next_pos;
+};
+
+/** @} */
+#endif

=== modified file 'storage/perfschema/table_helper.h'
--- a/storage/perfschema/table_helper.h	2011-08-11 03:11:58 +0000
+++ b/storage/perfschema/table_helper.h	2011-09-02 20:03:36 +0000
@@ -440,24 +440,40 @@ struct PFS_socket_io_stat_row
   inline void set(time_normalizer *normalizer, const PFS_socket_io_stat *stat)
   {
     PFS_byte_stat all;
-    PFS_byte_stat read= stat->m_read;
-    PFS_byte_stat write= stat->m_write;
-    PFS_byte_stat misc= stat->m_misc;
 
-    m_read.set(normalizer, &read);
-    m_write.set(normalizer, &write);
-    m_misc.set(normalizer, &misc);
-  //m_read.set(normalizer, &stat->m_read);
-  //m_write.set(normalizer, &stat->m_write);
-  //m_misc.set(normalizer, &stat->m_misc);
+    m_read.set(normalizer, &stat->m_read);
+    m_write.set(normalizer, &stat->m_write);
+    m_misc.set(normalizer, &stat->m_misc);
     
     /* Combine stats for all operations */
-    all.aggregate(&read);
-    all.aggregate(&write);
-    all.aggregate(&misc);
-  //all.aggregate(&stat->m_read);
-  //all.aggregate(&stat->m_write);
-  //all.aggregate(&stat->m_misc);
+    all.aggregate(&stat->m_read);
+    all.aggregate(&stat->m_write);
+    all.aggregate(&stat->m_misc);
+
+    m_all.set(normalizer, &all);
+  }
+};
+
+/** Row fragment for file io statistics columns. */
+struct PFS_file_io_stat_row
+{
+  PFS_byte_stat_row m_read;
+  PFS_byte_stat_row m_write;
+  PFS_byte_stat_row m_misc;
+  PFS_byte_stat_row m_all;
+  
+  inline void set(time_normalizer *normalizer, const PFS_file_io_stat *stat)
+  {
+    PFS_byte_stat all;
+
+    m_read.set(normalizer, &stat->m_read);
+    m_write.set(normalizer, &stat->m_write);
+    m_misc.set(normalizer, &stat->m_misc);
+    
+    /* Combine stats for all operations */
+    all.aggregate(&stat->m_read);
+    all.aggregate(&stat->m_write);
+    all.aggregate(&stat->m_misc);
 
     m_all.set(normalizer, &all);
   }

=== modified file 'storage/perfschema/table_socket_summary_by_instance.cc'
--- a/storage/perfschema/table_socket_summary_by_instance.cc	2011-08-18 12:27:21 +0000
+++ b/storage/perfschema/table_socket_summary_by_instance.cc	2011-09-02 20:03:36 +0000
@@ -15,7 +15,7 @@
 
 /**
   @file storage/perfschema/table_socket_summary_by_instance.cc
-  Table SOCKET_INSTANCES (implementation).
+  Table SOCKET_SUMMARY_BY_INSTANCE (implementation).
 */
 
 #include "my_global.h"

No bundle (reason: useless for push emails).
Thread
bzr push into mysql-trunk-wl5908 branch (chris.powers:3419 to 3420) WL#5908Christopher Powers5 Sep