2004-12-30 16:34:01 +01:00
|
|
|
# -*- cperl -*-
|
2006-12-31 01:02:27 +01:00
|
|
|
# Copyright (C) 2004 MySQL AB
|
|
|
|
#
|
|
|
|
# This program is free software; you can redistribute it and/or modify
|
|
|
|
# it under the terms of the GNU General Public License as published by
|
|
|
|
# the Free Software Foundation; version 2 of the License.
|
|
|
|
#
|
|
|
|
# This program is distributed in the hope that it will be useful,
|
|
|
|
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
# GNU General Public License for more details.
|
|
|
|
#
|
|
|
|
# You should have received a copy of the GNU General Public License
|
|
|
|
# along with this program; if not, write to the Free Software
|
|
|
|
# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
2004-12-30 16:34:01 +01:00
|
|
|
|
|
|
|
# This is a library file used by the Perl version of mysql-test-run,
|
|
|
|
# and is part of the translation of the Bourne shell script with the
|
|
|
|
# same name.
|
|
|
|
|
|
|
|
use strict;
|
|
|
|
|
2010-01-05 21:35:50 +01:00
|
|
|
sub gprof_collect ($@) {
|
|
|
|
my ($exe_mysqld, @gprof_dirs)= @_;
|
2004-12-30 16:34:01 +01:00
|
|
|
|
2010-01-05 21:35:50 +01:00
|
|
|
print ("Collecting gprof reports.....\n");
|
2004-12-30 16:34:01 +01:00
|
|
|
|
2010-01-05 21:35:50 +01:00
|
|
|
foreach my $datadir (@gprof_dirs)
|
2004-12-30 16:34:01 +01:00
|
|
|
{
|
2010-01-05 21:35:50 +01:00
|
|
|
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");
|
|
|
|
}
|
2004-12-30 16:34:01 +01:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
1;
|