List:Commits« Previous MessageNext Message »
From:msvensson Date:August 1 2006 7:33am
Subject:bk commit into 5.1 tree (msvensson:1.2244)
View as plain text  
Below is the list of changes that have just been committed into a local
5.1 repository of msvensson. When msvensson does a push these changes will
be propagated to the main repository and, within 24 hours after the
push, to the public repository.
For information on how to access the public repository
see http://dev.mysql.com/doc/mysql/en/installing-source-tree.html

ChangeSet@stripped, 2006-08-01 09:33:00+02:00, msvensson@neptunus.(none) +3 -0
  Merge neptunus.(none):/home/msvensson/mysql/my51-m-bug19535
  into  neptunus.(none):/home/msvensson/mysql/mysql-5.1-new-maint
  MERGE: 1.2222.1.3

  client/mysqltest.c@stripped, 2006-08-01 09:32:56+02:00, msvensson@neptunus.(none) +0 -0
    Auto merged
    MERGE: 1.214.1.2

  mysql-test/lib/mtr_process.pl@stripped, 2006-08-01 09:32:57+02:00, msvensson@neptunus.(none) +0 -0
    Auto merged
    MERGE: 1.43.1.1

  mysql-test/mysql-test-run.pl@stripped, 2006-08-01 09:32:56+02:00, msvensson@neptunus.(none) +0 -0
    Auto merged
    MERGE: 1.143.1.5

# This is a BitKeeper patch.  What follows are the unified diffs for the
# set of deltas contained in the patch.  The rest of the patch, the part
# that BitKeeper cares about, is below these diffs.
# User:	msvensson
# Host:	neptunus.(none)
# Root:	/home/msvensson/mysql/mysql-5.1-new-maint/RESYNC

--- 1.44/mysql-test/lib/mtr_process.pl	2006-08-01 09:33:06 +02:00
+++ 1.45/mysql-test/lib/mtr_process.pl	2006-08-01 09:33:06 +02:00
@@ -340,7 +340,9 @@ sub mtr_kill_leftovers () {
   my $pid;
 
   #Start shutdown of instance_managers, masters and slaves
-  foreach my $srv (@{$::instance_manager->{'instances'}},@{$::master},@{$::slave})
+  foreach my $srv ($::instance_manager,
+		   @{$::instance_manager->{'instances'}},
+		   @{$::master},@{$::slave})
   {
     $pid= mtr_mysqladmin_start($srv, "shutdown", 70);
 

--- 1.145/mysql-test/mysql-test-run.pl	2006-08-01 09:33:06 +02:00
+++ 1.146/mysql-test/mysql-test-run.pl	2006-08-01 09:33:06 +02:00
@@ -290,6 +290,7 @@ our $opt_valgrind_mysqltest= 0;
 our $default_valgrind_options= "--show-reachable=yes";
 our $opt_valgrind_options;
 our $opt_valgrind_path;
+our $opt_callgrind;
 
 our $opt_stress=               "";
 our $opt_stress_suite=     "main";
@@ -367,7 +368,7 @@ sub mysqld_start ($$$);
 sub mysqld_arguments ($$$$$);
 sub stop_all_servers ();
 sub im_start ($$);
-sub im_stop ($);
+sub im_stop ($$);
 sub run_mysqltest ($);
 sub usage ($);
 
@@ -635,6 +636,7 @@ sub command_line_setup () {
              'valgrind-mysqld'          => \$opt_valgrind_mysqld,
              'valgrind-options=s'       => \$opt_valgrind_options,
              'valgrind-path=s'          => \$opt_valgrind_path,
+	     'callgrind'                => \$opt_callgrind,
 
              # Stress testing 
              'stress'                   => \$opt_stress,
@@ -873,6 +875,17 @@ sub command_line_setup () {
     $opt_valgrind= 1;
   }
 
+  if ( $opt_callgrind )
+  {
+    mtr_report("Turning on valgrind with callgrind for mysqld(s)");
+    $opt_valgrind= 1;
+    $opt_valgrind_mysqld= 1;
+
+    # Set special valgrind options unless options passed on command line
+    $opt_valgrind_options="--trace-children=yes"
+      unless defined $opt_valgrind_options;
+  }
+
   if ( $opt_valgrind )
   {
     # Set valgrind_options to default unless already defined
@@ -2371,7 +2384,7 @@ sub run_testcase ($) {
   if ( ! $glob_use_running_server and $tinfo->{'component_id'} eq 'im' and
        $instance_manager->{'pid'} )
   {
-    im_stop($instance_manager);
+    im_stop($instance_manager, $tinfo->{'name'});
   }
 }
 
@@ -2912,7 +2925,7 @@ sub stop_all_servers () {
   if ( $instance_manager->{'pid'} )
   {
     print  "Shutting-down Instance Manager\n";
-    im_stop($instance_manager);
+    im_stop($instance_manager, "stop_all_servers");
   }
 
   my %admin_pids; # hash of admin processes that requests shutdown
@@ -3363,7 +3376,7 @@ sub run_testcase_start_servers($) {
 
     if (mysqld_wait_started($mysqld))
     {
-      mtr_error("Failed to start $mysqld->{'type'} mysqld $mysqld->{'idx'}");
+      mtr_warning("Failed to start $mysqld->{'type'} mysqld $mysqld->{'idx'}");
     }
   }
 }
@@ -3431,8 +3444,9 @@ sub im_start($$) {
 }
 
 
-sub im_stop($) {
+sub im_stop($$) {
   my $instance_manager = shift;
+  my $where = shift;
 
   # Obtain mysqld-process pids before we start stopping IM (it can delete pid
   # files).
@@ -3493,36 +3507,29 @@ sub im_stop($) {
     }
   }
 
-  # Check that all processes died.
+  # Check if all processes shutdown cleanly
+  my $clean_shutdown= 1; # Assum they did
 
-  my $clean_shutdown= 0;
-
-  while (1)
+  if (kill (0, $instance_manager->{'pid'}))
   {
-    if (kill (0, $instance_manager->{'pid'}))
-    {
-      mtr_warning("IM-main is still alive.");
-      last;
-    }
+    mtr_warning("IM-main is still alive.");
+    $clean_shutdown= 0;
+  }
 
-    if (defined $instance_manager->{'angel_pid'} &&
-        kill (0, $instance_manager->{'angel_pid'}))
-    {
-      mtr_warning("IM-angel is still alive.");
-      last;
-    }
+  if (defined $instance_manager->{'angel_pid'} &&
+      kill (0, $instance_manager->{'angel_pid'}))
+  {
+    mtr_warning("IM-angel is still alive.");
+    $clean_shutdown= 0;
+  }
 
-    foreach my $pid (@mysqld_pids)
+  foreach my $pid (@mysqld_pids)
+  {
+    if (kill (0, $pid))
     {
-      if (kill (0, $pid))
-      {
-        mtr_warning("Guarded mysqld ($pid) is still alive.");
-        last;
-      }
+      mtr_warning("Guarded mysqld ($pid) is still alive.");
+      $clean_shutdown= 0;
     }
-
-    $clean_shutdown= 1;
-    last;
   }
 
   # Kill leftovers (the order is important).
@@ -3554,7 +3561,7 @@ sub im_stop($) {
 
     my $ts= localtime();
     print ERRLOG
-      "Warning: [$ts] Instance Manager did not shutdown gracefully.\n";
+      "[$where] Warning: [$ts] Instance Manager did not shutdown gracefully.\n";
 
     close ERRLOG;
   }
@@ -4112,12 +4119,20 @@ sub valgrind_arguments {
   my $args= shift;
   my $exe=  shift;
 
-  mtr_add_arg($args, "--tool=memcheck"); # From >= 2.1.2 needs this option
-  mtr_add_arg($args, "--alignment=8");
-  mtr_add_arg($args, "--leak-check=yes");
-  mtr_add_arg($args, "--num-callers=16");
-  mtr_add_arg($args, "--suppressions=%s/valgrind.supp", $glob_mysql_test_dir)
-    if -f "$glob_mysql_test_dir/valgrind.supp";
+  if ( $opt_callgrind)
+  {
+    mtr_add_arg($args, "--tool=callgrind");
+    mtr_add_arg($args, "--base=$opt_vardir/log");
+  }
+  else
+  {
+    mtr_add_arg($args, "--tool=memcheck"); # From >= 2.1.2 needs this option
+    mtr_add_arg($args, "--alignment=8");
+    mtr_add_arg($args, "--leak-check=yes");
+    mtr_add_arg($args, "--num-callers=16");
+    mtr_add_arg($args, "--suppressions=%s/valgrind.supp", $glob_mysql_test_dir)
+      if -f "$glob_mysql_test_dir/valgrind.supp";
+  }
 
   # Add valgrind options, can be overriden by user
   mtr_add_arg($args, '%s', $_) for (split(' ', $opt_valgrind_options));
@@ -4240,6 +4255,7 @@ Options for coverage, profiling etc
   valgrind-mysqld       Run the "mysqld" executable with valgrind
   valgrind-options=ARGS Options to give valgrind, replaces default options
   valgrind-path=[EXE]   Path to the valgrind executable
+  callgrind             Instruct valgrind to use callgrind
 
 Misc options
 

--- 1.217/client/mysqltest.c	2006-08-01 09:33:06 +02:00
+++ 1.218/client/mysqltest.c	2006-08-01 09:33:06 +02:00
@@ -171,7 +171,7 @@ typedef struct
 static test_file file_stack[MAX_INCLUDE_DEPTH];
 static test_file* cur_file;
 static test_file* file_stack_end;
-uint start_lineno; /* Start line of query */
+uint start_lineno= 0; /* Start line of query */
 
 /* Stores regex substitutions */
 
@@ -646,7 +646,7 @@ static void die(const char *fmt, ...)
     if (cur_file && cur_file != file_stack)
       fprintf(stderr, "In included file \"%s\": ",
               cur_file->file_name);
-    if (start_lineno != 0)
+    if (start_lineno > 0)
       fprintf(stderr, "At line %u: ", start_lineno);
     vfprintf(stderr, fmt, args);
     fprintf(stderr, "\n");
@@ -1173,7 +1173,7 @@ static void do_exec(struct st_query *que
     }
   }
   error= pclose(res_file);
-  if (error != 0)
+  if (error > 0)
   {
     uint status= WEXITSTATUS(error), i;
     my_bool ok= 0;
Thread
bk commit into 5.1 tree (msvensson:1.2244)msvensson1 Aug