From 86815029511a8bf97991f39afc99dec706e10680 Mon Sep 17 00:00:00 2001 From: Daniel Black Date: Tue, 28 Jun 2016 11:32:22 +1000 Subject: [PATCH 1/2] Add valgrind-tool as mtr option --- mysql-test/mysql-test-run.pl | 24 ++++++++++++++++++++++-- 1 file changed, 22 insertions(+), 2 deletions(-) diff --git a/mysql-test/mysql-test-run.pl b/mysql-test/mysql-test-run.pl index 79a2262..8a81b7c 100755 --- a/mysql-test/mysql-test-run.pl +++ b/mysql-test/mysql-test-run.pl @@ -308,6 +308,7 @@ END my $opt_valgrind_path; my $valgrind_reports= 0; my $opt_callgrind; +my $opt_valgrind_tool; my %mysqld_logs; my $opt_debug_sync_timeout= 600; # Default timeout for WAIT_FOR actions. my $daemonize_mysqld= 0; @@ -1181,6 +1182,7 @@ sub command_line_setup { }, 'valgrind-option=s' => \@valgrind_args, 'valgrind-path=s' => \$opt_valgrind_path, + 'valgrind-tool=s' => \$opt_valgrind_tool, 'callgrind' => \$opt_callgrind, 'debug-sync-timeout=i' => \$opt_debug_sync_timeout, @@ -1768,7 +1770,19 @@ sub command_line_setup { $opt_valgrind= 1; } - if ( $opt_callgrind ) + if ( $opt_valgrind_tool ) + { + mtr_report("Turning on valgrind with tool $opt_valgrind_tool for mysqld(s)"); + $opt_valgrind= 1; + $opt_valgrind_mysqld= 1; + if ( $opt_callgrind ) + { + mtr_error("--callgrind incompatible with --valgrind-tool.", + "Use at most one of these options"); + } + } + + if ( $opt_callgrind && !$opt_valgrind_tool ) { mtr_report("Turning on valgrind with callgrind for mysqld(s)"); $opt_valgrind= 1; @@ -6832,7 +6846,11 @@ sub valgrind_arguments { my $args= shift; my $exe= shift; - if ( $opt_callgrind) + if ( $opt_valgrind_tool) + { + mtr_add_arg($args, "--tool=$opt_valgrind_tool"); + } + elsif ( $opt_callgrind) { mtr_add_arg($args, "--tool=callgrind"); mtr_add_arg($args, "--base=$opt_vardir/log"); @@ -7213,6 +7231,8 @@ ($) valgrind-option=ARGS Option to give valgrind, replaces default option(s), can be specified more then once valgrind-path= Path to the valgrind executable + valgrind-tool= Use valgrind --tool= instead of memcheck (or + callgrind). callgrind Instruct valgrind to use callgrind Misc options From ecd2594ecf5133f88b21a22cbdbb20c16a333b95 Mon Sep 17 00:00:00 2001 From: Daniel Black Date: Tue, 28 Jun 2016 11:32:48 +1000 Subject: [PATCH 2/2] Put testname into environment as MTR_TEST_NAME during MTR --- mysql-test/mysql-test-run.pl | 1 + 1 file changed, 1 insertion(+) diff --git a/mysql-test/mysql-test-run.pl b/mysql-test/mysql-test-run.pl index 8a81b7c..e257c1c 100755 --- a/mysql-test/mysql-test-run.pl +++ b/mysql-test/mysql-test-run.pl @@ -4374,6 +4374,7 @@ ($) my $print_freq=20; mtr_verbose("Running test:", $tinfo->{name}); + $ENV{'MTR_TEST_NAME'} = $tinfo->{name}; resfile_report_test($tinfo) if $opt_resfile; # Allow only alpanumerics pluss _ - + . in combination names,