Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
M
mariadb
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
mariadb
Commits
90b24e99
Commit
90b24e99
authored
Jan 06, 2010
by
Bjorn Munch
Browse files
Options
Browse Files
Download
Plain Diff
merge 49345
parents
d3c57be8
ce019a2f
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
22 additions
and
35 deletions
+22
-35
mysql-test/lib/mtr_gprof.pl
mysql-test/lib/mtr_gprof.pl
+11
-34
mysql-test/mysql-test-run.pl
mysql-test/mysql-test-run.pl
+11
-1
No files found.
mysql-test/lib/mtr_gprof.pl
View file @
90b24e99
...
@@ -20,43 +20,20 @@
...
@@ -20,43 +20,20 @@
use
strict
;
use
strict
;
# These are not to be prefixed with "mtr_"
sub
gprof_collect
($@)
{
my
(
$exe_mysqld
,
@gprof_dirs
)
=
@_
;
sub
gprof_prepare
();
print
("
Collecting gprof reports.....
\n
");
sub
gprof_collect
();
##############################################################################
foreach
my
$datadir
(
@gprof_dirs
)
#
#
#
##############################################################################
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
"
)
{
{
# FIXME check result code?!
my
$gprof_msg
=
"
$datadir
/gprof.msg
";
mtr_run
("
gprof
",
my
$gprof_err
=
"
$datadir
/gprof.err
";
[
$::exe_slave_mysqld
,
if
(
-
f
"
$datadir
/gmon.out
"
)
"
$::slave->[0]->{'path_myddir'}/gmon.out
"],
{
$::opt_gprof_slave
,
"",
"",
"");
system
("
gprof
$exe_mysqld
$datadir
/gmon.out 2>
$gprof_err
>
$gprof_msg
");
print
"
Slave execution profile has been saved in $::opt_gprof_slave
\n
";
print
("
GPROF output in
$gprof_msg
, errors in
$gprof_err
\n
");
}
}
}
}
}
...
...
mysql-test/mysql-test-run.pl
View file @
90b24e99
...
@@ -87,6 +87,7 @@ use IO::Select;
...
@@ -87,6 +87,7 @@ use IO::Select;
require
"
lib/mtr_process.pl
";
require
"
lib/mtr_process.pl
";
require
"
lib/mtr_io.pl
";
require
"
lib/mtr_io.pl
";
require
"
lib/mtr_gcov.pl
";
require
"
lib/mtr_gcov.pl
";
require
"
lib/mtr_gprof.pl
";
require
"
lib/mtr_misc.pl
";
require
"
lib/mtr_misc.pl
";
$SIG
{
INT
}
=
sub
{
mtr_error
("
Got ^C signal
");
};
$SIG
{
INT
}
=
sub
{
mtr_error
("
Got ^C signal
");
};
...
@@ -167,6 +168,9 @@ our $opt_gcov_exe= "gcov";
...
@@ -167,6 +168,9 @@ our $opt_gcov_exe= "gcov";
our
$opt_gcov_err
=
"
mysql-test-gcov.msg
";
our
$opt_gcov_err
=
"
mysql-test-gcov.msg
";
our
$opt_gcov_msg
=
"
mysql-test-gcov.err
";
our
$opt_gcov_msg
=
"
mysql-test-gcov.err
";
our
$opt_gprof
;
our
%
gprof_dirs
;
our
$glob_debugger
=
0
;
our
$glob_debugger
=
0
;
our
$opt_gdb
;
our
$opt_gdb
;
our
$opt_client_gdb
;
our
$opt_client_gdb
;
...
@@ -745,6 +749,9 @@ sub run_worker ($) {
...
@@ -745,6 +749,9 @@ sub run_worker ($) {
if
(
$opt_valgrind_mysqld
)
{
if
(
$opt_valgrind_mysqld
)
{
valgrind_exit_reports
();
valgrind_exit_reports
();
}
}
if
(
$opt_gprof
)
{
gprof_collect
(
find_mysqld
(
$basedir
),
keys
%
gprof_dirs
);
}
exit
(
0
);
exit
(
0
);
}
}
else
{
else
{
...
@@ -858,6 +865,7 @@ sub command_line_setup {
...
@@ -858,6 +865,7 @@ sub command_line_setup {
# Coverage, profiling etc
# Coverage, profiling etc
'
gcov
'
=>
\
$opt_gcov
,
'
gcov
'
=>
\
$opt_gcov
,
'
gprof
'
=>
\
$opt_gprof
,
'
valgrind|valgrind-all
'
=>
\
$opt_valgrind
,
'
valgrind|valgrind-all
'
=>
\
$opt_valgrind
,
'
valgrind-mysqltest
'
=>
\
$opt_valgrind_mysqltest
,
'
valgrind-mysqltest
'
=>
\
$opt_valgrind_mysqltest
,
'
valgrind-mysqld
'
=>
\
$opt_valgrind_mysqld
,
'
valgrind-mysqld
'
=>
\
$opt_valgrind_mysqld
,
...
@@ -1250,7 +1258,7 @@ sub command_line_setup {
...
@@ -1250,7 +1258,7 @@ sub command_line_setup {
# --------------------------------------------------------------------------
# --------------------------------------------------------------------------
# Gcov flag
# 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
");
mtr_error
("
Coverage test needs the source - please use source dist
");
}
}
...
@@ -4318,6 +4326,8 @@ sub mysqld_start ($$) {
...
@@ -4318,6 +4326,8 @@ sub mysqld_start ($$) {
}
}
# Remember this log file for valgrind error report search
# Remember this log file for valgrind error report search
$mysqld_logs
{
$output
}
=
1
if
$opt_valgrind
;
$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
)
if
(
defined
$exe
)
{
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment