~ubuntu-branches/ubuntu/saucy/drizzle/saucy-proposed

« back to all changes in this revision

Viewing changes to tests/lib/mtr_gprof.pl

  • Committer: Bazaar Package Importer
  • Author(s): Monty Taylor
  • Date: 2010-03-18 12:12:31 UTC
  • Revision ID: james.westby@ubuntu.com-20100318121231-k6g1xe6cshbwa0f8
Tags: upstream-2010.03.1347
ImportĀ upstreamĀ versionĀ 2010.03.1347

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
# -*- cperl -*-
 
2
# Copyright (C) 2004 MySQL AB
 
3
 
4
# This program is free software; you can redistribute it and/or modify
 
5
# it under the terms of the GNU General Public License as published by
 
6
# the Free Software Foundation; version 2 of the License.
 
7
 
8
# This program is distributed in the hope that it will be useful,
 
9
# but WITHOUT ANY WARRANTY; without even the implied warranty of
 
10
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 
11
# GNU General Public License for more details.
 
12
 
13
# You should have received a copy of the GNU General Public License
 
14
# along with this program; if not, write to the Free Software
 
15
# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
 
16
 
 
17
# This is a library file used by the Perl version of mysql-test-run,
 
18
# and is part of the translation of the Bourne shell script with the
 
19
# same name.
 
20
 
 
21
use strict;
 
22
 
 
23
# These are not to be prefixed with "mtr_"
 
24
 
 
25
sub gprof_prepare ();
 
26
sub gprof_collect ();
 
27
 
 
28
##############################################################################
 
29
#
 
30
#  
 
31
#
 
32
##############################################################################
 
33
 
 
34
sub gprof_prepare () {
 
35
 
 
36
  rmtree($::opt_gprof_dir);
 
37
  mkdir($::opt_gprof_dir);
 
38
}
 
39
 
 
40
# FIXME what about master1 and slave1?!
 
41
sub gprof_collect () {
 
42
 
 
43
  if ( -f "$::master->[0]->{'path_myddir'}/gmon.out" )
 
44
  {
 
45
    # FIXME check result code?!
 
46
    mtr_run("gprof",
 
47
            [$::exe_master_mysqld,
 
48
             "$::master->[0]->{'path_myddir'}/gmon.out"],
 
49
            $::opt_gprof_master, "", "", "");
 
50
    print "Master execution profile has been saved in $::opt_gprof_master\n";
 
51
  }
 
52
  if ( -f "$::slave->[0]->{'path_myddir'}/gmon.out" )
 
53
  {
 
54
    # FIXME check result code?!
 
55
    mtr_run("gprof",
 
56
            [$::exe_slave_mysqld,
 
57
             "$::slave->[0]->{'path_myddir'}/gmon.out"],
 
58
            $::opt_gprof_slave, "", "", "");
 
59
    print "Slave execution profile has been saved in $::opt_gprof_slave\n";
 
60
  }
 
61
}
 
62
 
 
63
 
 
64
1;