summaryrefslogtreecommitdiff
path: root/mysql-test/mysql-test-run.pl
diff options
context:
space:
mode:
authorBjorn Munch <Bjorn.Munch@sun.com>2010-01-06 09:54:43 +0100
committerBjorn Munch <Bjorn.Munch@sun.com>2010-01-06 09:54:43 +0100
commitfcb43b2956236b42a7f2bb177a8bcadcd6b63274 (patch)
tree36bf08795b043ecccce43a5af527cab1a71982a6 /mysql-test/mysql-test-run.pl
parentdc3a76b2dac90671796e11cb0d4e01b0e1d0dd1c (diff)
parent1ae30d113da3f5829584f4646b1b6dda5e4fec13 (diff)
downloadmariadb-git-fcb43b2956236b42a7f2bb177a8bcadcd6b63274.tar.gz
merge 49345
Diffstat (limited to 'mysql-test/mysql-test-run.pl')
-rwxr-xr-xmysql-test/mysql-test-run.pl12
1 files changed, 11 insertions, 1 deletions
diff --git a/mysql-test/mysql-test-run.pl b/mysql-test/mysql-test-run.pl
index d2bad11e698..83740e08ca6 100755
--- a/mysql-test/mysql-test-run.pl
+++ b/mysql-test/mysql-test-run.pl
@@ -87,6 +87,7 @@ use IO::Select;
require "lib/mtr_process.pl";
require "lib/mtr_io.pl";
require "lib/mtr_gcov.pl";
+require "lib/mtr_gprof.pl";
require "lib/mtr_misc.pl";
$SIG{INT}= sub { mtr_error("Got ^C signal"); };
@@ -167,6 +168,9 @@ our $opt_gcov_exe= "gcov";
our $opt_gcov_err= "mysql-test-gcov.msg";
our $opt_gcov_msg= "mysql-test-gcov.err";
+our $opt_gprof;
+our %gprof_dirs;
+
our $glob_debugger= 0;
our $opt_gdb;
our $opt_client_gdb;
@@ -745,6 +749,9 @@ sub run_worker ($) {
if ($opt_valgrind_mysqld) {
valgrind_exit_reports();
}
+ if ( $opt_gprof ) {
+ gprof_collect (find_mysqld($basedir), keys %gprof_dirs);
+ }
exit(0);
}
else {
@@ -858,6 +865,7 @@ sub command_line_setup {
# Coverage, profiling etc
'gcov' => \$opt_gcov,
+ 'gprof' => \$opt_gprof,
'valgrind|valgrind-all' => \$opt_valgrind,
'valgrind-mysqltest' => \$opt_valgrind_mysqltest,
'valgrind-mysqld' => \$opt_valgrind_mysqld,
@@ -1250,7 +1258,7 @@ sub command_line_setup {
# --------------------------------------------------------------------------
# Gcov flag
# --------------------------------------------------------------------------
- if ( $opt_gcov and ! $source_dist )
+ if ( ($opt_gcov or $opt_gprof) and ! $source_dist )
{
mtr_error("Coverage test needs the source - please use source dist");
}
@@ -4318,6 +4326,8 @@ sub mysqld_start ($$) {
}
# Remember this log file for valgrind error report search
$mysqld_logs{$output}= 1 if $opt_valgrind;
+ # Remember data dir for gmon.out files if using gprof
+ $gprof_dirs{$mysqld->value('datadir')}= 1 if $opt_gprof;
if ( defined $exe )
{