mirror of
https://github.com/MariaDB/server.git
synced 2025-08-01 03:47:19 +03:00
Add support for valgrind with callgrind
This commit is contained in:
@ -290,6 +290,7 @@ our $opt_valgrind_mysqltest= 0;
|
|||||||
our $default_valgrind_options= "--show-reachable=yes";
|
our $default_valgrind_options= "--show-reachable=yes";
|
||||||
our $opt_valgrind_options;
|
our $opt_valgrind_options;
|
||||||
our $opt_valgrind_path;
|
our $opt_valgrind_path;
|
||||||
|
our $opt_callgrind;
|
||||||
|
|
||||||
our $opt_stress= "";
|
our $opt_stress= "";
|
||||||
our $opt_stress_suite= "main";
|
our $opt_stress_suite= "main";
|
||||||
@ -635,6 +636,7 @@ sub command_line_setup () {
|
|||||||
'valgrind-mysqld' => \$opt_valgrind_mysqld,
|
'valgrind-mysqld' => \$opt_valgrind_mysqld,
|
||||||
'valgrind-options=s' => \$opt_valgrind_options,
|
'valgrind-options=s' => \$opt_valgrind_options,
|
||||||
'valgrind-path=s' => \$opt_valgrind_path,
|
'valgrind-path=s' => \$opt_valgrind_path,
|
||||||
|
'callgrind' => \$opt_callgrind,
|
||||||
|
|
||||||
# Stress testing
|
# Stress testing
|
||||||
'stress' => \$opt_stress,
|
'stress' => \$opt_stress,
|
||||||
@ -873,6 +875,17 @@ sub command_line_setup () {
|
|||||||
$opt_valgrind= 1;
|
$opt_valgrind= 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if ( $opt_callgrind )
|
||||||
|
{
|
||||||
|
mtr_report("Turning on valgrind with callgrind for mysqld(s)");
|
||||||
|
$opt_valgrind= 1;
|
||||||
|
$opt_valgrind_mysqld= 1;
|
||||||
|
|
||||||
|
# Set special valgrind options unless options passed on command line
|
||||||
|
$opt_valgrind_options="--trace-children=yes"
|
||||||
|
unless defined $opt_valgrind_options;
|
||||||
|
}
|
||||||
|
|
||||||
if ( $opt_valgrind )
|
if ( $opt_valgrind )
|
||||||
{
|
{
|
||||||
# Set valgrind_options to default unless already defined
|
# Set valgrind_options to default unless already defined
|
||||||
@ -4098,12 +4111,20 @@ sub valgrind_arguments {
|
|||||||
my $args= shift;
|
my $args= shift;
|
||||||
my $exe= shift;
|
my $exe= shift;
|
||||||
|
|
||||||
mtr_add_arg($args, "--tool=memcheck"); # From >= 2.1.2 needs this option
|
if ( $opt_callgrind)
|
||||||
mtr_add_arg($args, "--alignment=8");
|
{
|
||||||
mtr_add_arg($args, "--leak-check=yes");
|
mtr_add_arg($args, "--tool=callgrind");
|
||||||
mtr_add_arg($args, "--num-callers=16");
|
mtr_add_arg($args, "--base=$opt_vardir/log");
|
||||||
mtr_add_arg($args, "--suppressions=%s/valgrind.supp", $glob_mysql_test_dir)
|
}
|
||||||
if -f "$glob_mysql_test_dir/valgrind.supp";
|
else
|
||||||
|
{
|
||||||
|
mtr_add_arg($args, "--tool=memcheck"); # From >= 2.1.2 needs this option
|
||||||
|
mtr_add_arg($args, "--alignment=8");
|
||||||
|
mtr_add_arg($args, "--leak-check=yes");
|
||||||
|
mtr_add_arg($args, "--num-callers=16");
|
||||||
|
mtr_add_arg($args, "--suppressions=%s/valgrind.supp", $glob_mysql_test_dir)
|
||||||
|
if -f "$glob_mysql_test_dir/valgrind.supp";
|
||||||
|
}
|
||||||
|
|
||||||
# Add valgrind options, can be overriden by user
|
# Add valgrind options, can be overriden by user
|
||||||
mtr_add_arg($args, '%s', $_) for (split(' ', $opt_valgrind_options));
|
mtr_add_arg($args, '%s', $_) for (split(' ', $opt_valgrind_options));
|
||||||
@ -4226,6 +4247,7 @@ Options for coverage, profiling etc
|
|||||||
valgrind-mysqld Run the "mysqld" executable with valgrind
|
valgrind-mysqld Run the "mysqld" executable with valgrind
|
||||||
valgrind-options=ARGS Options to give valgrind, replaces default options
|
valgrind-options=ARGS Options to give valgrind, replaces default options
|
||||||
valgrind-path=[EXE] Path to the valgrind executable
|
valgrind-path=[EXE] Path to the valgrind executable
|
||||||
|
callgrind Instruct valgrind to use callgrind
|
||||||
|
|
||||||
Misc options
|
Misc options
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user