This page collects useful notes on running the GDB performance testsuite.

N.B. This page is very much a work-in-progress.

The "monster" performance testcases

These testcases are mocks of real programs. GDB doesn't care what the program does, the mocks just have to look like the real program along the axes one wishes to measure.

Since these programs are huge (I mean probably bigger than anything you'll normally experience) building them is separate from running them. Building them takes awhile, and we don't want to rebuild them each time when testing gdb patches or different copies of gdb.

Example of running the "monster" performance testcases

The author likes to use a collection of three scripts:

  1. configperf.sh - this just exists to put common aspects of building and running into one location.
  2. buildperf.sh - run this script to build the monster performance testcases
  3. runperf.sh - run this script to run the monster performance testcases

Note: The author usually has a copy of these in $obj/gdb/testsuite. They don't begin with "perf" so that tab-completion on perftest.sum works nicely.

Remember: This is just an example. Feel free to use it or not. It is offered as a way to get one started using the testsuite quickly.

configperf.sh:

GCC_HEAD="/path/to/gcc/install"
BINUTILS_HEAD="/path/to/binutils/install"

#board=--target_board=dwarf4-gdb-index
board=

#tests="gmonster1-backtrace.exp gmonster1-null-lookup.exp gmonster1-pervasive-typedef.exp gmonster1-print-cerr.exp gmonster1-ptype-string.exp gmonster1-runto-main.exp gmonster1-select-file.exp gmonster2-backtrace.exp gmonster2-null-lookup.exp gmonster2-pervasive-typedef.exp gmonster2-print-cerr.exp gmonster2-ptype-string.exp gmonster2-runto-main.exp gmonster2-select-file.exp"
tests=gmonster2-ptype-string.exp

# Set this to n or y.
# y builds the really big versions of the programs (that try to match the real ones they're based on).
monster=y

#gdb=/usr/bin/gdb
gdb=/build/perf-tests/rel/usr/bin/gdb

#EXTRA_CFLAGS="\\ -Wl,-rpath,$GCC_HEAD/lib64"

CC_FOR_TARGET="gcc${EXTRA_CFLAGS}"
CXX_FOR_TARGET="g++${EXTRA_CFLAGS}"

PATH="$GCC_HEAD/bin:$BINUTILS_HEAD/bin:$PATH"

# Workaround dejagnu 1.5.3 bug, --directory is broken.                                                                                                           
PATH=$HOME/gnu/rel64/dejagnu-1.5.1/bin:$PATH

buildperf.sh:

#! /bin/sh
. ./configperf.sh
make -j10 build-perf \
    RUNTESTFLAGS="gmonster1.exp gmonster2.exp MONSTER=$monster $board CC_FOR_TARGET=$CC_FOR_TARGET CXX_FOR_TARGET=$CXX_FOR_TARGET"

runperf.sh:

#! /bin/sh
. ./configperf.sh
make -j10 check-perf GDB_PERFTEST_MODE=run \
    RUNTESTFLAGS="$tests MONSTER=$monster $board CC_FOR_TARGET=$CC_FOR_TARGET CXX_FOR_TARGET=$CXX_FOR_TARGET GDB=$gdb"

bash$ cd $obj/gdb/testsuite
bash$ sh buildperf.sh
bash$ sh runperf.sh

At this point you should see perftest.sum and perftest.log in the directory with the results of the test.

Remember: These files are appended to by default.

None: GDBPerfTestsuite (last edited 2015-08-15 06:19:38 by DougEvans)

All content (C) 2008 Free Software Foundation. For terms of use, redistribution, and modification, please see the WikiLicense page.