List:Commits« Previous MessageNext Message »
From:Marc Alff Date:November 3 2011 10:39pm
Subject:bzr push into mysql-trunk-marc branch (marc.alff:3557 to 3558)
View as plain text  
 3558 Marc Alff	2011-11-03
      Added tooling from mysql-trunk-perfschema for benchmarks

    added:
      storage/perfschema/unittest/doit-linux
      storage/perfschema/unittest/pfs_benchmark-t.cc
      storage/perfschema/unittest/pfs_benchmark_helper.cc
      storage/perfschema/unittest/pfs_benchmark_helper.h
    modified:
      storage/perfschema/unittest/CMakeLists.txt
 3557 Marc Alff	2011-11-03
      New tree for performance tuning (Marc)

    modified:
      .bzr-mysql/default.conf
=== modified file 'storage/perfschema/unittest/CMakeLists.txt'
--- a/storage/perfschema/unittest/CMakeLists.txt	2011-07-29 09:10:56 +0000
+++ b/storage/perfschema/unittest/CMakeLists.txt	2011-11-03 22:38:27 +0000
@@ -43,3 +43,9 @@ SET(tests
 FOREACH(testname ${tests})
   PFS_ADD_TEST(${testname})
 ENDFOREACH()
+
+ADD_EXECUTABLE(pfs_benchmark-t pfs_benchmark-t.cc pfs_benchmark_helper.cc)
+TARGET_LINK_LIBRARIES(pfs_benchmark-t mytap perfschema mysys)
+ADD_TEST(pfs_benchmark pfs_benchmark-t)
+
+

=== added file 'storage/perfschema/unittest/doit-linux'
--- a/storage/perfschema/unittest/doit-linux	1970-01-01 00:00:00 +0000
+++ b/storage/perfschema/unittest/doit-linux	2011-11-03 22:38:27 +0000
@@ -0,0 +1,21 @@
+#!/bin/bash
+
+echo "Host"
+hostname
+
+echo "Platform"
+uname -a
+
+echo "Compiler"
+gcc --version
+
+# ldd ./pfs_benchmark-t
+
+echo "RAW timer data"
+../../../unittest/mysys/my_rdtsc-t
+
+echo "PFS BENCHMARK"
+./pfs_benchmark-t
+
+
+

=== added file 'storage/perfschema/unittest/pfs_benchmark-t.cc'
--- a/storage/perfschema/unittest/pfs_benchmark-t.cc	1970-01-01 00:00:00 +0000
+++ b/storage/perfschema/unittest/pfs_benchmark-t.cc	2011-11-03 22:38:27 +0000
@@ -0,0 +1,649 @@
+/* Copyright (c) 2010, Oracle and/or its affiliates. All rights reserved.
+
+  This program is free software; you can redistribute it and/or modify
+  it under the terms of the GNU General Public License as published by
+  the Free Software Foundation; version 2 of the License.
+
+  This program is distributed in the hope that it will be useful,
+  but WITHOUT ANY WARRANTY; without even the implied warranty of
+  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+  GNU General Public License for more details.
+
+  You should have received a copy of the GNU General Public License
+  along with this program; if not, write to the Free Software
+  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA */
+
+
+/*
+  Define any of these to measure the baseline cost
+
+#define DISABLE_PSI_MUTEX
+#define DISABLE_PSI_RWLOCK
+#define DISABLE_PSI_COND
+#define DISABLE_PSI_FILE
+#define DISABLE_PSI_TABLE
+#define DISABLE_PSI_STAGE
+#define DISABLE_PSI_STATEMENT
+*/
+
+#include "my_global.h"
+#include "my_pthread.h"
+#include "pfs_timer.h"
+#include "pfs_server.h"
+#include "pfs_events_waits.h"
+#include "pfs_instr_class.h"
+#include "pfs_instr.h"
+#include "mysql/psi/psi.h"
+#include "mysql/psi/mysql_thread.h"
+#include "mysql/psi/mysql_table.h"
+#include "my_sys.h"
+#include "tap.h"
+
+#include "stub_server_misc.h"
+#include "pfs_benchmark_helper.h"
+
+#include <string.h> /* memset */
+
+static bool bench_pfs_enabled= false;
+
+static PFS_mutex_class *bench_mutex_class= NULL;
+static mysql_mutex_t bench_mutex;
+static PSI_mutex_key bench_mutex_key;
+PSI_mutex_info all_bench_mutexes[]=
+{
+  { & bench_mutex_key, "benchmark", 0}
+};
+
+static PFS_rwlock_class *bench_rwlock_class= NULL;
+static mysql_rwlock_t bench_rwlock;
+static PSI_rwlock_key bench_rwlock_key;
+PSI_rwlock_info all_bench_rwlocks[]=
+{
+  { & bench_rwlock_key, "benchmark", 0}
+};
+
+static PFS_cond_class *bench_cond_class= NULL;
+static mysql_cond_t bench_cond;
+static PSI_cond_key bench_cond_key;
+PSI_cond_info all_bench_conds[]=
+{
+  { & bench_cond_key, "benchmark", 0}
+};
+
+static PFS_file_class *bench_file_class= NULL;
+static PSI_file_key bench_file_key;
+PSI_file_info all_bench_files[]=
+{
+  { & bench_file_key, "benchmark", 0}
+};
+
+static PSI_thread_key key_thread_main;
+static PSI_thread_info all_bench_threads[]=
+{
+  { & key_thread_main, "main", 0}
+};
+
+// static PSI_table_share *bench_table_share= NULL;
+static PSI_table *bench_table_handle= NULL;
+
+static void setup(bool pfs_enabled)
+{
+  PFS_global_param param;
+
+  memset(& param, 0xFF, sizeof(param));
+  param.m_enabled= true;
+  param.m_mutex_class_sizing= 10;
+  param.m_rwlock_class_sizing= 10;
+  param.m_cond_class_sizing= 10;
+  param.m_thread_class_sizing= 10;
+  param.m_table_share_sizing= 10;
+  param.m_file_class_sizing= 10;
+  param.m_mutex_sizing= 10;
+  param.m_rwlock_sizing= 10;
+  param.m_cond_sizing= 10;
+  param.m_thread_sizing= 10;
+  param.m_table_sizing= 10;
+  param.m_file_sizing= 10;
+  param.m_file_handle_sizing= 32000;
+  param.m_socket_sizing= 10;
+  param.m_socket_class_sizing= 10;
+  param.m_events_waits_history_sizing= 10;
+  param.m_events_waits_history_long_sizing= 1000;
+  param.m_setup_actor_sizing= 10;
+  param.m_setup_object_sizing= 10;
+  param.m_host_sizing= 10;
+  param.m_user_sizing= 10;
+  param.m_account_sizing= 10;
+  param.m_stage_class_sizing= 0;
+  param.m_events_stages_history_sizing= 0;
+  param.m_events_stages_history_long_sizing= 0;
+  param.m_statement_class_sizing= 0;
+  param.m_events_statements_history_sizing= 0;
+  param.m_events_statements_history_long_sizing= 0;
+
+  bench_pfs_enabled= pfs_enabled;
+
+  if (pfs_enabled)
+  {
+    PSI_bootstrap *boot;
+    boot= initialize_performance_schema(& param);
+    ok(boot != NULL, "boot");
+    ok(boot->get_interface != NULL, "boot->get_interface");
+
+    PSI_server= (PSI*) boot->get_interface(PSI_CURRENT_VERSION);
+  }
+
+  ok(PSI_server != NULL, "current version");
+
+  PSI_server->register_mutex("unittest", all_bench_mutexes, 1);
+  PSI_server->register_rwlock("unittest", all_bench_rwlocks, 1);
+  PSI_server->register_cond("unittest", all_bench_conds, 1);
+  PSI_server->register_file("unittest", all_bench_files, 1);
+  PSI_server->register_thread("unittest", all_bench_threads, 1);
+
+  PSI_thread *psi= PSI_server->new_thread(key_thread_main, NULL, 0);
+  ok(!pfs_enabled || psi != NULL, "main thread");
+  PSI_server->set_thread(psi);
+
+  mysql_mutex_init(bench_mutex_key, & bench_mutex, MY_MUTEX_INIT_FAST);
+  bench_mutex_class= find_mutex_class(bench_mutex_key);
+  ok(!pfs_enabled || bench_mutex_class != NULL, "mutex class");
+
+  mysql_rwlock_init(bench_rwlock_key, & bench_rwlock);
+  bench_rwlock_class= find_rwlock_class(bench_rwlock_key);
+  ok(!pfs_enabled || bench_rwlock_class != NULL, "rwlock class");
+
+  mysql_cond_init(bench_cond_key, & bench_cond, NULL);
+  bench_cond_class= find_cond_class(bench_cond_key);
+  ok(!pfs_enabled || bench_cond_class != NULL, "cond class");
+
+  bench_file_class= find_file_class(bench_file_key);
+  ok(!pfs_enabled || bench_file_class != NULL, "file class");
+}
+
+static void teardown()
+{
+  mysql_mutex_destroy(& bench_mutex);
+  mysql_rwlock_destroy(& bench_rwlock);
+  mysql_cond_destroy(& bench_cond);
+  shutdown_performance_schema();
+}
+
+void benchmark_mutex(uint count, const char *test)
+{
+  ulonglong timer_start;
+  ulonglong timer_end;
+  ulonglong timer_cycles;
+
+  mysql_mutex_t *that= & bench_mutex;
+
+  timer_start= my_timer_cycles();
+
+  uint i;
+  start_some_work();
+  for (i= 0 ; i<count; i++)
+  {
+    mysql_mutex_lock(that);
+    do_some_work();
+    mysql_mutex_unlock(that);
+  }
+
+  timer_end= my_timer_cycles();
+  timer_cycles= timer_end-timer_start;
+  // ok(get_work_done() == count, "work done");
+
+  diag("MUTEX benchmark: %s, %d calls, %13llu cycles, %13llu avg",
+       test,
+       count, timer_cycles, timer_cycles/count);
+}
+
+void benchmark_rwlock(uint count, const char *test)
+{
+  ulonglong timer_start;
+  ulonglong timer_end;
+  ulonglong timer_cycles;
+
+  mysql_rwlock_t *that= & bench_rwlock;
+
+  timer_start= my_timer_cycles();
+
+  uint i;
+  start_some_work();
+  for (i= 0 ; i<count; i++)
+  {
+    mysql_rwlock_rdlock(that);
+    do_some_work();
+    mysql_rwlock_unlock(that);
+  }
+
+  timer_end= my_timer_cycles();
+  timer_cycles= timer_end-timer_start;
+  // ok(get_work_done() == count, "work done");
+
+  diag("RWLOCK benchmark: %s, %d calls, %13llu cycles, %13llu avg",
+       test,
+       count, timer_cycles, timer_cycles/count);
+}
+
+void benchmark_cond(uint count, const char *test)
+{
+  ulonglong timer_start;
+  ulonglong timer_end;
+  ulonglong timer_cycles;
+
+  mysql_cond_t *that= & bench_cond;
+  mysql_mutex_t *mutex= & bench_mutex;
+
+  mysql_mutex_lock(mutex);
+  timer_start= my_timer_cycles();
+
+  uint i;
+  start_some_work();
+  for (i= 0 ; i<count; i++)
+  {
+    mysql_cond_signal(that);
+    mysql_cond_broadcast(that);
+    // mysql_cond_wait(that, mutex);
+    do_some_work();
+  }
+
+  timer_end= my_timer_cycles();
+  timer_cycles= timer_end-timer_start;
+  mysql_mutex_unlock(mutex);
+  // ok(get_work_done() == count, "work done");
+
+  diag("COND benchmark: %s, %d calls, %13llu cycles, %13llu avg",
+       test,
+       count, timer_cycles, timer_cycles/count);
+}
+
+void benchmark_file_read(uint count, const char *test)
+{
+  ulonglong timer_start;
+  ulonglong timer_end;
+  ulonglong timer_cycles;
+
+  File file;
+
+  /* MYSQL_FILE_OPEN */
+  {
+    struct PSI_file_locker *locker= NULL;
+    PSI_file_locker_state state;
+    if (likely(PSI_server != NULL))
+    {
+      locker= PSI_server->get_thread_file_name_locker(&state, bench_file_key, PSI_FILE_OPEN,
+                                                      "pfs_benchmark-t.cc", &locker);
+      if (likely(locker != NULL))
+        PSI_server->start_file_open_wait(locker, __FILE__, __LINE__);
+    }
+    file= 12;
+    if (likely(locker != NULL))
+      PSI_server->end_file_open_wait_and_bind_to_descriptor(locker, file);
+  }
+
+  timer_start= my_timer_cycles();
+
+  uint i;
+  for (i= 0 ; i<count; i++)
+  {
+    /* MYSQL_FILE_READ */
+    {
+      struct PSI_file_locker *locker= NULL;
+      PSI_file_locker_state state;
+      if (likely(PSI_server != NULL))
+      {
+        locker= PSI_server->get_thread_file_descriptor_locker(&state, file,
+                                                              PSI_FILE_READ);
+        if (likely(locker != NULL))
+          PSI_server->start_file_wait(locker, i, __FILE__, __LINE__);
+      }
+      size_t result= i;
+      if (likely(locker != NULL))
+      {
+        size_t bytes_read;
+/*
+        if (flags & (MY_NABP | MY_FNABP))
+          bytes_read= (result == 0) ? count : 0;
+        else
+*/
+          bytes_read= (result != MY_FILE_ERROR) ? result : 0;
+        PSI_server->end_file_wait(locker, bytes_read);
+      }
+    }
+  }
+
+  timer_end= my_timer_cycles();
+
+  /* MYSQL_FILE_CLOSE */
+  {
+    struct PSI_file_locker *locker= NULL;
+    PSI_file_locker_state state;
+    if (likely(PSI_server != NULL))
+    {
+      locker= PSI_server->get_thread_file_descriptor_locker(&state, file,
+                                                            PSI_FILE_CLOSE);
+      if (likely(locker != NULL))
+        PSI_server->start_file_wait(locker, (size_t) 0, __FILE__, __LINE__);
+    }
+    if (likely(locker != NULL))
+      PSI_server->end_file_wait(locker, (size_t) 0);
+  }
+
+  timer_cycles= timer_end-timer_start;
+
+  diag("FILE READ benchmark: %s, %d calls, %13llu cycles, %13llu avg",
+       test,
+       count, timer_cycles, timer_cycles/count);
+}
+
+void benchmark_file_open(uint count, const char *test)
+{
+  ulonglong timer_start;
+  ulonglong timer_end;
+  ulonglong timer_cycles;
+
+  File file;
+
+  timer_start= my_timer_cycles();
+
+  uint i;
+  for (i= 0 ; i<count; i++)
+  {
+    /* MYSQL_FILE_OPEN */
+    {
+      struct PSI_file_locker *locker= NULL;
+      PSI_file_locker_state state;
+      if (likely(PSI_server != NULL))
+      {
+        locker= PSI_server->get_thread_file_name_locker(&state,
+                                                        bench_file_key, PSI_FILE_OPEN,
+                                                        "pfs_benchmark-t.cc", &locker);
+        if (likely(locker != NULL))
+          PSI_server->start_file_open_wait(locker, __FILE__, __LINE__);
+      }
+      file= 12;
+      if (likely(locker != NULL))
+        PSI_server->end_file_open_wait_and_bind_to_descriptor(locker, file);
+    }
+
+    /* MYSQL_FILE_CLOSE */
+    {
+      struct PSI_file_locker *locker= NULL;
+      PSI_file_locker_state state;
+      if (likely(PSI_server != NULL))
+      {
+        locker= PSI_server->get_thread_file_descriptor_locker(&state, file,
+                                                              PSI_FILE_CLOSE);
+        if (likely(locker != NULL))
+          PSI_server->start_file_wait(locker, (size_t) 0, __FILE__, __LINE__);
+      }
+      if (likely(locker != NULL))
+        PSI_server->end_file_wait(locker, (size_t) 0);
+    }
+  }
+
+  timer_end= my_timer_cycles();
+  timer_cycles= timer_end-timer_start;
+
+  diag("FILE OPEN benchmark: %s, %d calls, %13llu cycles, %13llu avg",
+       test,
+       count, timer_cycles, timer_cycles/count);
+}
+
+void benchmark_table_open(uint count, const char *test)
+{
+  ulonglong timer_start;
+  ulonglong timer_end;
+  ulonglong timer_cycles;
+
+  PSI_table *that= bench_table_handle;
+  ok(that == NULL, "table is not instrumented yet");
+
+  timer_start= my_timer_cycles();
+
+  uint i;
+  start_some_work();
+  for (i= 0 ; i<count; i++)
+  {
+    MYSQL_TABLE_WAIT_VARIABLES(locker, state) /* no ';' */
+    MYSQL_START_TABLE_IO_WAIT(locker, &state, that,
+                              PSI_TABLE_FETCH_ROW, MAX_KEY, 0);
+    do_some_work();
+    MYSQL_END_TABLE_IO_WAIT(locker);
+  }
+
+  timer_end= my_timer_cycles();
+  timer_cycles= timer_end-timer_start;
+  // ok(get_work_done() == count, "work done");
+
+  diag("TABLE_IO benchmark: %s, %d calls, %13llu cycles, %13llu avg",
+       test,
+       count, timer_cycles, timer_cycles/count);
+}
+
+void benchmark_table_io(uint count, const char *test)
+{
+  ulonglong timer_start;
+  ulonglong timer_end;
+  ulonglong timer_cycles;
+
+  PSI_table *that= bench_table_handle;
+  ok(that == NULL, "table is not instrumented yet");
+
+  timer_start= my_timer_cycles();
+
+  uint i;
+  start_some_work();
+  for (i= 0 ; i<count; i++)
+  {
+    MYSQL_TABLE_WAIT_VARIABLES(locker, state) /* no ';' */
+    MYSQL_START_TABLE_IO_WAIT(locker, &state, that,
+                              PSI_TABLE_FETCH_ROW, MAX_KEY, 0);
+    do_some_work();
+    MYSQL_END_TABLE_IO_WAIT(locker);
+  }
+
+  timer_end= my_timer_cycles();
+  timer_cycles= timer_end-timer_start;
+  // ok(get_work_done() == count, "work done");
+
+  diag("TABLE_IO benchmark: %s, %d calls, %13llu cycles, %13llu avg",
+       test,
+       count, timer_cycles, timer_cycles/count);
+}
+
+void benchmark_table_lock(uint count, const char *test)
+{
+  ulonglong timer_start;
+  ulonglong timer_end;
+  ulonglong timer_cycles;
+
+  PSI_table *that= bench_table_handle;
+  ok(that == NULL, "table is not instrumented yet");
+
+  timer_start= my_timer_cycles();
+
+  uint i;
+  start_some_work();
+  for (i= 0 ; i<count; i++)
+  {
+    MYSQL_TABLE_WAIT_VARIABLES(locker, state) /* no ';' */
+    MYSQL_START_TABLE_LOCK_WAIT(locker, &state, that,
+                                PSI_TABLE_EXTERNAL_LOCK, F_RDLCK);
+    do_some_work();
+    MYSQL_END_TABLE_LOCK_WAIT(locker);
+  }
+
+  timer_end= my_timer_cycles();
+  timer_cycles= timer_end-timer_start;
+  // ok(get_work_done() == count, "work done");
+
+  diag("TABLE_LOCK benchmark: %s, %d calls, %13llu cycles, %13llu avg",
+       test,
+       count, timer_cycles, timer_cycles/count);
+}
+
+void benchmark_all(bool enabled, bool timed, const char *test)
+{
+  /* The setup may have changed. */
+  update_instruments_derived_flags();
+
+  char msg[80];
+
+  if (enabled)
+  {
+    sprintf(msg, "%s (enabled, %s)",
+            test,
+            (timed ? "timed" : "untimed"));
+  }
+  else
+  {
+    sprintf(msg, "%s (disabled)", test);
+  }
+
+  benchmark_mutex(1, msg);
+  benchmark_rwlock(1, msg);
+  benchmark_cond(1, msg);
+/*
+  benchmark_file_read(1, msg);
+  benchmark_file_open(1, msg);
+*/
+  benchmark_table_io(1, msg);
+  benchmark_table_lock(1, msg);
+
+  benchmark_mutex(1000, msg);
+  benchmark_rwlock(1000, msg);
+  benchmark_cond(1000, msg);
+/*
+  benchmark_file_read(1000, msg);
+  benchmark_file_open(1000, msg);
+*/
+  benchmark_table_io(1000, msg);
+  benchmark_table_lock(1000, msg);
+
+  benchmark_mutex(1000000, msg);
+  benchmark_rwlock(1000000, msg);
+  benchmark_cond(1000000, msg);
+/*
+  benchmark_file_read(1000000, msg);
+  benchmark_file_open(1000000, msg);
+*/
+  benchmark_table_io(1000000, msg);
+  benchmark_table_lock(1000000, msg);
+
+/*
+  benchmark_mutex(10000000, msg);
+  benchmark_rwlock(10000000, msg);
+  benchmark_cond(10000000, msg);
+  benchmark_table_io(10000000, msg);
+  benchmark_table_lock(10000000, msg);
+*/
+}
+
+void test_all(bool enabled, bool timed)
+{
+  if (! bench_pfs_enabled)
+  {
+    benchmark_all(false, false, "noop");
+  }
+  else
+  {
+    flag_events_waits_current= true;
+    flag_events_waits_history= true;
+    flag_events_waits_history_long= true;
+    flag_global_instrumentation= true;
+    flag_thread_instrumentation= true;
+
+    bench_mutex_class->m_enabled= enabled;
+    bench_mutex_class->m_timed= timed;
+    bench_rwlock_class->m_enabled= enabled;
+    bench_rwlock_class->m_timed= timed;
+    bench_cond_class->m_enabled= enabled;
+    bench_cond_class->m_timed= timed;
+    bench_file_class->m_enabled= enabled;
+    bench_file_class->m_timed= timed;
+
+    benchmark_all(enabled, timed, "bigbang");
+
+    flag_events_waits_history_long= false;
+    benchmark_all(enabled, timed, "history");
+
+    /* Now same as no history */
+    benchmark_all(enabled, timed, "current");
+
+    flag_events_waits_current= false;
+    benchmark_all(enabled, timed, "thread_instrumentation");
+
+    flag_thread_instrumentation= false;
+    benchmark_all(enabled, timed, "global_instrumentation");
+
+    flag_global_instrumentation= false;
+    benchmark_all(enabled, timed, "nothing");
+  }
+}
+
+void do_print_config()
+{
+#ifdef HAVE_PSI_MUTEX_INTERFACE
+  diag("MUTEX INSTRUMENTATION compiled in");
+#else
+  diag("MUTEX INSTRUMENTATION not compiled in");
+#endif
+
+#ifdef HAVE_PSI_RWLOCK_INTERFACE
+  diag("RWLOCK INSTRUMENTATION compiled in");
+#else
+  diag("RWLOCK INSTRUMENTATION not compiled in");
+#endif
+
+#ifdef HAVE_PSI_COND_INTERFACE
+  diag("COND INSTRUMENTATION compiled in");
+#else
+  diag("COND INSTRUMENTATION not compiled in");
+#endif
+
+#ifdef HAVE_PSI_FILE_INTERFACE
+  diag("FILE INSTRUMENTATION compiled in");
+#else
+  diag("FILE INSTRUMENTATION not compiled in");
+#endif
+
+#ifdef HAVE_PSI_TABLE_INTERFACE
+  diag("TABLE INSTRUMENTATION compiled in");
+#else
+  diag("TABLE INSTRUMENTATION not compiled in");
+#endif
+
+#ifdef HAVE_PSI_STAGE_INTERFACE
+  diag("STAGE INSTRUMENTATION compiled in");
+#else
+  diag("STAGE INSTRUMENTATION not compiled in");
+#endif
+
+#ifdef HAVE_PSI_STATEMENT_INTERFACE
+  diag("STATEMENT INSTRUMENTATION compiled in");
+#else
+  diag("STATEMENT INSTRUMENTATION not compiled in");
+#endif
+}
+
+int main(int, char **)
+{
+  plan(8);
+  MY_INIT("pfs_benchmark-t");
+
+  do_print_config();
+
+  setup(false);
+  test_all(false, false);
+  teardown();
+
+  setup(true);
+  test_all(false, false);
+  test_all(true, false);
+  test_all(true, true);
+  teardown();
+
+  return 0;
+}
+

=== added file 'storage/perfschema/unittest/pfs_benchmark_helper.cc'
--- a/storage/perfschema/unittest/pfs_benchmark_helper.cc	1970-01-01 00:00:00 +0000
+++ b/storage/perfschema/unittest/pfs_benchmark_helper.cc	2011-11-03 22:38:27 +0000
@@ -0,0 +1,63 @@
+
+unsigned long long work_done;
+
+void start_some_work()
+{
+  work_done= 0;
+}
+
+void do_some_work()
+{
+  work_done++;
+}
+
+unsigned long long get_work_done()
+{
+  return work_done;
+}
+
+// STUB the pthread library
+
+#include "my_global.h"
+#include "my_pthread.h"
+
+int pthread_mutex_lock(pthread_mutex_t *)
+{
+  return 0;
+}
+
+int pthread_mutex_unlock(pthread_mutex_t *)
+{
+  return 0;
+}
+
+int pthread_rwlock_rdlock(pthread_rwlock_t *)
+{
+  return 0;
+}
+
+int pthread_rwlock_wrlock(pthread_rwlock_t *)
+{
+  return 0;
+}
+
+int pthread_rwlock_unlock(pthread_rwlock_t *)
+{
+  return 0;
+}
+
+int pthread_cond_signal(pthread_cond_t *)
+{
+  return 0;
+}
+
+int pthread_cond_broadcast(mysql_cond_t *)
+{
+  return 0;
+}
+
+int pthread_cond_wait(mysql_cond_t *, mysql_mutex_t *)
+{
+  return 0;
+}
+

=== added file 'storage/perfschema/unittest/pfs_benchmark_helper.h'
--- a/storage/perfschema/unittest/pfs_benchmark_helper.h	1970-01-01 00:00:00 +0000
+++ b/storage/perfschema/unittest/pfs_benchmark_helper.h	2011-11-03 22:38:27 +0000
@@ -0,0 +1,10 @@
+
+#ifndef PFS_BENCHMARK_HELPER_H
+#define PFS_BENCHMARK_HELPER_H
+
+extern void start_some_work();
+extern void do_some_work();
+extern unsigned long long get_work_done();
+
+#endif
+

No bundle (reason: useless for push emails).
Thread
bzr push into mysql-trunk-marc branch (marc.alff:3557 to 3558) Marc Alff7 Nov