1
0
mirror of https://github.com/MariaDB/server.git synced 2025-07-29 05:21:33 +03:00

Fixed some test failures after last push (failing tests and valgrind warnings)

Added --strace support to mysql-test-run

mysql-test/mysql-test-run.pl:
  Added support for --strace (usefull for example to check how much memory mysqld was using)
mysql-test/suite/funcs_1/t/is_engines_innodb.test:
  Fixed test case to also work with xtradb
mysql-test/suite/innodb_plugin/t/innodb.test:
  Don't run if we don't have the used character sets.
mysql-test/suite/innodb_plugin/t/innodb_mysql.test:
  Don't run if we don't have the used character sets.
sql/sql_show.cc:
  Extended comment to 160 characters to get full comment from xtradb
storage/xtradb/handler/ha_innodb.cc:
  Fixed valgrind warning.
This commit is contained in:
Michael Widenius
2010-08-04 13:19:18 +03:00
parent 60ddf6f2b7
commit 7b4bd6dfce
6 changed files with 63 additions and 11 deletions

View File

@ -234,10 +234,12 @@ my $opt_strace_client;
our $opt_user = "root";
my $opt_valgrind= 0;
our $opt_valgrind_mysqld= 0;
my $opt_valgrind_mysqltest= 0;
my @default_valgrind_args= ("--show-reachable=yes");
my @valgrind_args;
our $opt_valgrind_mysqld= 0;
my $opt_valgrind_mysqltest= 0;
my $opt_strace= 0;
my @strace_args;
my $opt_valgrind_path;
my $opt_callgrind;
my %mysqld_logs;
@ -929,7 +931,9 @@ sub command_line_setup {
'manual-ddd' => \$opt_manual_ddd,
'debugger=s' => \$opt_debugger,
'client-debugger=s' => \$opt_client_debugger,
'strace' => \$opt_strace,
'strace-client:s' => \$opt_strace_client,
'strace-option=s' => \@strace_args,
'max-save-core=i' => \$opt_max_save_core,
'max-save-datadir=i' => \$opt_max_save_datadir,
'max-test-fail=i' => \$opt_max_test_fail,
@ -1473,6 +1477,11 @@ sub command_line_setup {
join(" ", @valgrind_args), "\"");
}
if (@strace_args)
{
$opt_strace=1;
}
# InnoDB does not bother to do individual de-allocations at exit. Instead it
# relies on a custom allocator to track every allocation, and frees all at
# once during exit.
@ -1724,9 +1733,9 @@ sub executable_setup () {
if ( -x "../libtool")
{
$exe_libtool= "../libtool";
if ($opt_valgrind or $glob_debugger)
if ($opt_valgrind or $glob_debugger or $opt_strace)
{
mtr_report("Using \"$exe_libtool\" when running valgrind or debugger");
mtr_report("Using \"$exe_libtool\" when running valgrind, strace or debugger");
}
}
@ -4636,6 +4645,10 @@ sub mysqld_start ($$) {
{
valgrind_arguments($args, \$exe);
}
if ( $opt_strace)
{
strace_arguments($args, \$exe, $mysqld->name());
}
mtr_add_arg($args, "--defaults-group-suffix=%s", $mysqld->after('mysqld'));
mysqld_arguments($args,$mysqld,$extra_opts);
@ -5575,6 +5588,33 @@ sub valgrind_arguments {
}
}
#
# Modify the exe and args so that program is run in strace
#
sub strace_arguments {
my $args= shift;
my $exe= shift;
my $mysqld_name= shift;
mtr_add_arg($args, "-f");
mtr_add_arg($args, "-o%s/var/log/%s.strace", $glob_mysql_test_dir, $mysqld_name);
# Add strace options, can be overriden by user
mtr_add_arg($args, '%s', $_) for (@strace_args);
mtr_add_arg($args, $$exe);
$$exe= "strace";
if ($exe_libtool)
{
# Add "libtool --mode-execute" before the test to execute
# if running in valgrind(to avoid valgrinding bash)
unshift(@$args, "--mode=execute", $$exe);
$$exe= $exe_libtool;
}
}
#
# Usage
@ -5702,9 +5742,6 @@ Options for debugging the product
test(s)
manual-ddd Let user manually start mysqld in ddd, before running
test(s)
strace-client=[path] Create strace output for mysqltest client, optionally
specifying name and path to the trace program to use.
Example: $0 --strace-client=ktrace
max-save-core Limit the number of core files saved (to avoid filling
up disks for heavily crashing server). Defaults to
$opt_max_save_core, set to 0 for no limit. Set
@ -5732,6 +5769,15 @@ Options for valgrind
valgrind-path=<EXE> Path to the valgrind executable
callgrind Instruct valgrind to use callgrind
Options for strace
strace Run the "mysqld" executables using strace. Default
options are -f -o var/log/'mysqld-name'.strace
strace-option=ARGS Option to give strace, replaces default option(s),
strace-client=[path] Create strace output for mysqltest client, optionally
specifying name and path to the trace program to use.
Example: $0 --strace-client=ktrace
Misc options
user=USER User for connecting to mysqld(default: $opt_user)
comment=STR Write STR to the output