added gprof options

added a benchmark test for count(distinct)
parent 635ef42a
......@@ -127,6 +127,9 @@ while test $# -gt 0; do
fi
DO_GCOV=1
;;
--gprof )
DO_GPROF=1
;;
--gdb )
if [ x$BINARY_DIST = x1 ] ; then
$ECHO "Note: you will get more meaningful output on a source distribution compiled with debugging option when running tests with -gdb option"
......@@ -239,6 +242,9 @@ GDB_MASTER_INIT=$MYSQL_TMP_DIR/gdbinit.master
GDB_SLAVE_INIT=$MYSQL_TMP_DIR/gdbinit.slave
GCOV_MSG=$MYSQL_TMP_DIR/mysqld-gcov.out
GCOV_ERR=$MYSQL_TMP_DIR/mysqld-gcov.err
GPROF_DIR=$MYSQL_TMP_DIR/gprof
GPROF_MASTER=$GPROF_DIR/master.gprof
GPROF_SLAVE=$GPROF_DIR/slave.gprof
TIMEFILE="$MYSQL_TMP_DIR/mysqltest-time"
SLAVE_MYSQLD=$MYSQLD #this can be changed later if we are doing gcov
......@@ -324,6 +330,24 @@ mysql_install_db () {
return 0
}
gprof_prepare ()
{
rm -rf $GPROF_DIR
mkdir -p $GPROF_DIR
}
gprof_collect ()
{
if [ -f $MASTER_MYDDIR/gmon.out ]; then
gprof $MYSQLD $MASTER_MYDDIR/gmon.out > $GPROF_MASTER
echo "Master execution profile has been saved in $GPROF_MASTER"
fi
if [ -f $SLAVE_MYDDIR/gmon.out ]; then
gprof $MYSQLD $SLAVE_MYDDIR/gmon.out > $GPROF_SLAVE
echo "Slave execution profile has been saved in $GPROF_SLAVE"
fi
}
gcov_prepare () {
$FIND $BASEDIR -name \*.gcov \
-or -name \*.da | $XARGS $RM
......@@ -663,6 +687,7 @@ run_testcase ()
[ "$DO_GCOV" -a ! -x "$GCOV" ] && error "No gcov found"
[ "$DO_GCOV" ] && gcov_prepare
[ "$DO_GPROF" ] && gprof_prepare
# Ensure that no old mysqld test servers are running
if [ -z "$USE_RUNNING_SERVER" ]
......@@ -722,5 +747,6 @@ report_stats
$ECHO
[ "$DO_GCOV" ] && gcov_collect # collect coverage information
[ "$DO_GPROF" ] && gprof_collect # collect coverage information
exit 0
drop table if exists t1;
create table t1(n int not null, key(n));
let $1=10000;
while ($1)
{
eval insert into t1 values($1);
eval insert into t1 values($1);
dec $1;
}
select count(distinct n) from t1;
drop table t1;
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment