summaryrefslogtreecommitdiff
path: root/mysql-test/lib
diff options
context:
space:
mode:
authorBjorn Munch <Bjorn.Munch@sun.com>2010-01-06 10:01:11 +0100
committerBjorn Munch <Bjorn.Munch@sun.com>2010-01-06 10:01:11 +0100
commite9313022c2f86c63bf032c3a5d1635d41235329f (patch)
treeee53cd16dd1ca4ccd0bbc0849d78054f955767fc /mysql-test/lib
parent658d3f5b16ced8306337136213a530a2c82cb248 (diff)
parentafdaf6d9dfa9fa5812efac6e8e808b200502b559 (diff)
downloadmariadb-git-e9313022c2f86c63bf032c3a5d1635d41235329f.tar.gz
merge 48863,49269,49345,49672,49761
Diffstat (limited to 'mysql-test/lib')
-rw-r--r--mysql-test/lib/mtr_gprof.pl45
1 files changed, 11 insertions, 34 deletions
diff --git a/mysql-test/lib/mtr_gprof.pl b/mysql-test/lib/mtr_gprof.pl
index f6615301dd7..5820a4007b8 100644
--- a/mysql-test/lib/mtr_gprof.pl
+++ b/mysql-test/lib/mtr_gprof.pl
@@ -20,43 +20,20 @@
use strict;
-# These are not to be prefixed with "mtr_"
+sub gprof_collect ($@) {
+ my ($exe_mysqld, @gprof_dirs)= @_;
-sub gprof_prepare ();
-sub gprof_collect ();
+ print ("Collecting gprof reports.....\n");
-##############################################################################
-#
-#
-#
-##############################################################################
-
-sub gprof_prepare () {
-
- rmtree($::opt_gprof_dir);
- mkdir($::opt_gprof_dir);
-}
-
-# FIXME what about master1 and slave1?!
-sub gprof_collect () {
-
- if ( -f "$::master->[0]->{'path_myddir'}/gmon.out" )
- {
- # FIXME check result code?!
- mtr_run("gprof",
- [$::exe_master_mysqld,
- "$::master->[0]->{'path_myddir'}/gmon.out"],
- $::opt_gprof_master, "", "", "");
- print "Master execution profile has been saved in $::opt_gprof_master\n";
- }
- if ( -f "$::slave->[0]->{'path_myddir'}/gmon.out" )
+ foreach my $datadir (@gprof_dirs)
{
- # FIXME check result code?!
- mtr_run("gprof",
- [$::exe_slave_mysqld,
- "$::slave->[0]->{'path_myddir'}/gmon.out"],
- $::opt_gprof_slave, "", "", "");
- print "Slave execution profile has been saved in $::opt_gprof_slave\n";
+ my $gprof_msg= "$datadir/gprof.msg";
+ my $gprof_err= "$datadir/gprof.err";
+ if ( -f "$datadir/gmon.out" )
+ {
+ system("gprof $exe_mysqld $datadir/gmon.out 2>$gprof_err >$gprof_msg");
+ print ("GPROF output in $gprof_msg, errors in $gprof_err\n");
+ }
}
}