diff options
author | sayantan.dutta@oracle.com <> | 2011-12-01 18:54:29 +0530 |
---|---|---|
committer | sayantan.dutta@oracle.com <> | 2011-12-01 18:54:29 +0530 |
commit | d638b4100728d919ca272e0f6f2883e38a86a5c4 (patch) | |
tree | 79ea8f57925aaca5454d27595a31c0f88134ab6f /mysql-test/mysql-test-run.pl | |
parent | d52aea2591d7e6f6dbfcbad4561d4b88fe4d46a8 (diff) | |
download | mariadb-git-d638b4100728d919ca272e0f6f2883e38a86a5c4.tar.gz |
BUG #11746897 - 29508: PLEASE IMPLEMENT MYSQL-TEST-RUN.PL --STRACE-MASTER
Includes fix for strace-client and restricted to strace and linux only.
******
Diffstat (limited to 'mysql-test/mysql-test-run.pl')
-rwxr-xr-x | mysql-test/mysql-test-run.pl | 56 |
1 files changed, 45 insertions, 11 deletions
diff --git a/mysql-test/mysql-test-run.pl b/mysql-test/mysql-test-run.pl index d278c36f033..2df6087f2b4 100755 --- a/mysql-test/mysql-test-run.pl +++ b/mysql-test/mysql-test-run.pl @@ -280,6 +280,7 @@ my $opt_reorder= 1; my $opt_force_restart= 0; my $opt_strace_client; +my $opt_strace_server; our $opt_user = "root"; @@ -1117,7 +1118,8 @@ sub command_line_setup { 'debugger=s' => \$opt_debugger, 'boot-dbx' => \$opt_boot_dbx, 'client-debugger=s' => \$opt_client_debugger, - 'strace-client:s' => \$opt_strace_client, + 'strace-server' => \$opt_strace_server, + 'strace-client' => \$opt_strace_client, 'max-save-core=i' => \$opt_max_save_core, 'max-save-datadir=i' => \$opt_max_save_datadir, 'max-test-fail=i' => \$opt_max_test_fail, @@ -1721,6 +1723,19 @@ sub command_line_setup { $debug_d= "d,query,info,error,enter,exit"; } + if ( $opt_strace_server && ($^O ne "linux") ) + { + $opt_strace_server=0; + mtr_warning("Strace only supported in Linux "); + } + + if ( $opt_strace_client && ($^O ne "linux") ) + { + $opt_strace_client=0; + mtr_warning("Strace only supported in Linux "); + } + + mtr_report("Checking supported features..."); check_ndbcluster_support(\%mysqld_variables); @@ -4875,6 +4890,12 @@ sub mysqld_start ($$) { my $args; mtr_init_args(\$args); +# implementation for strace-server + if ( $opt_strace_server ) + { + strace_server_arguments($args, \$exe, $mysqld->name()); + } + if ( $opt_valgrind_mysqld ) { @@ -5440,6 +5461,14 @@ sub start_mysqltest ($) { mtr_init_args(\$args); + if ( $opt_strace_client ) + { + $exe= "strace"; + mtr_add_arg($args, "-o"); + mtr_add_arg($args, "%s/log/mysqltest.strace", $opt_vardir); + mtr_add_arg($args, "$exe_mysqltest"); + } + mtr_add_arg($args, "--defaults-file=%s", $path_config_file); mtr_add_arg($args, "--silent"); mtr_add_arg($args, "--tmpdir=%s", $opt_tmpdir); @@ -5476,13 +5505,6 @@ sub start_mysqltest ($) { mtr_add_arg($args, "--cursor-protocol"); } - if ( $opt_strace_client ) - { - $exe= $opt_strace_client || "strace"; - mtr_add_arg($args, "-o"); - mtr_add_arg($args, "%s/log/mysqltest.strace", $opt_vardir); - mtr_add_arg($args, "$exe_mysqltest"); - } mtr_add_arg($args, "--timer-file=%s/log/timer", $opt_vardir); @@ -5783,6 +5805,19 @@ sub debugger_arguments { } } +# +# Modify the exe and args so that program is run in strace +# +sub strace_server_arguments { + my $args= shift; + my $exe= shift; + my $type= shift; + + mtr_add_arg($args, "-o"); + mtr_add_arg($args, "%s/log/%s.strace", $opt_vardir, $type); + mtr_add_arg($args, $$exe); + $$exe= "strace"; +} # # Modify the exe and args so that program is run in valgrind @@ -6099,9 +6134,8 @@ Options for debugging the product test(s) manual-dbx Let user manually start mysqld in dbx, 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 + strace-client Create strace output for mysqltest client, + strace-server Create strace output for mysqltest server, 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 |