old-cross-binutils/gdb/testsuite/gdb.perf/gmonster2.exp

119 lines
4 KiB
Text
Raw Normal View History

Add gmonster-{1,2} perf testcases. These testcases are mocks of real programs. GDB doesn't care what the programs do, they just have to look and/or behave like the real program. These testcases exercise gdb when debugging really large programs. E.g., gmonster-1 has 10,000 CUs, and gmonster-2 has 1000 shared libs (which is actually a little small, 5000 would be more accurate). gdb/testsuite/ChangeLog: * gdb.perf/lib/perftest/utils.py: New file. * gdb.perf/gm-hello.cc: New file. * gdb.perf/gm-pervasive-typedef.cc: New file. * gdb.perf/gm-pervasive-typedef.h: New file. * gdb.perf/gm-std.cc: New file. * gdb.perf/gm-std.h: New file. * gdb.perf/gm-use-cerr.cc: New file. * gdb.perf/gm-utils.h: New file. * gdb.perf/gmonster-null-lookup.py: New file. * gdb.perf/gmonster-pervasive-typedef.py: New file. * gdb.perf/gmonster-print-cerr.py: New file. * gdb.perf/gmonster-ptype-string.py: New file. * gdb.perf/gmonster-runto-main.py: New file. * gdb.perf/gmonster-select-file.py: New file. * gdb.perf/gmonster1-null-lookup.exp: New file. * gdb.perf/gmonster1-pervasive-typedef.exp: New file. * gdb.perf/gmonster1-print-cerr.exp: New file. * gdb.perf/gmonster1-ptype-string.exp: New file. * gdb.perf/gmonster1-runto-main.exp: New file. * gdb.perf/gmonster1-select-file.exp: New file. * gdb.perf/gmonster1.cc: New file. * gdb.perf/gmonster1.exp: New file. * gdb.perf/gmonster2-null-lookup.exp: New file. * gdb.perf/gmonster2-pervasive-typedef.exp: New file. * gdb.perf/gmonster2-print-cerr.exp: New file. * gdb.perf/gmonster2-ptype-string.exp: New file. * gdb.perf/gmonster2-runto-main.exp: New file. * gdb.perf/gmonster2-select-file.exp: New file. * gdb.perf/gmonster2.cc: New file. * gdb.perf/gmonster2.exp: New file.
2015-07-24 22:46:31 +00:00
# Copyright (C) 2015 Free Software Foundation, Inc.
# 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; either version 3 of the License, or
# (at your option) any later version.
#
# 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, see <http://www.gnu.org/licenses/>.
# Perftest description file for building the "gmonster2" benchmark.
# Where does the name come from? The benchmark is derived from one of the
# monster programs at Google.
#
# Perftest descriptions are loaded thrice:
# 1) To generate the build .exp files
# GDB_PERFTEST_MODE=gen-build-exps
# This step allows for parallel builds of the majority of pieces of the
# test binary and shlibs.
# 2) To compile the "pieces" of the binary and shlibs.
# "Pieces" are the bulk of the machine-generated sources of the test.
# This step is driven by lib/build-piece.exp.
# GDB_PERFTEST_MODE=build-pieces
# 3) To perform the final link of the binary and shlibs.
# GDB_PERFTEST_MODE=compile
#
# Example usage:
# bash$ make -j5 build-perf RUNTESTFLAGS="gmonster1.exp gmonster2.exp"
# bash$ make check-perf RUNTESTFLAGS="gdb.perf/gm*-*.exp GDB=/path/to/gdb"
load_lib perftest.exp
load_lib gen-perf-test.exp
if [skip_perf_tests] {
return 0
}
if ![info exists MONSTER] {
set MONSTER "n"
}
proc make_testcase_config { } {
global MONSTER
set program_name "gmonster2"
array set testcase [GenPerfTest::init_testcase $program_name]
set testcase(language) c++
# *_{sources,headers} need to be embedded in an outer list
# because remember each element of the outer list is for each run, and
# here we want to use the same value for all runs.
set testcase(binary_extra_sources) { { gmonster2.cc gm-hello.cc gm-use-cerr.cc } }
set testcase(binary_extra_headers) { { gm-utils.h gm-std.h } }
set testcase(gen_shlib_extra_sources) { { gm-hello.cc gm-use-cerr.cc } }
set testcase(gen_shlib_extra_headers) { { gm-utils.h gm-std.h } }
set testcase(tail_shlib_sources) { { gm-std.cc } }
set testcase(tail_shlib_headers) { { gm-std.h } }
if { $MONSTER == "y" } {
set testcase(run_names) { 10-sos 100-sos 1000-sos }
set testcase(nr_gen_shlibs) { 10 100 1000 }
} else {
set testcase(run_names) { 1-so 10-sos 100-sos }
set testcase(nr_gen_shlibs) { 1 10 100 }
}
set testcase(nr_compunits) 10
set testcase(nr_extern_globals) 10
set testcase(nr_static_globals) 10
set testcase(nr_extern_functions) 10
set testcase(nr_static_functions) 10
# class_specs needs to be embedded in an outer list because remember
# each element of the outer list is for each run, and here we want to use
# the same value for all runs.
set testcase(class_specs) { {
{
count 1 name { class }
nr_members 10 nr_static_members 10
nr_methods 10 nr_static_methods 10
nr_inline_methods 10 nr_static_inline_methods 10
}
{
count 1 name { ns0 class }
nr_members 10 nr_static_members 10
nr_methods 10 nr_static_methods 10
nr_inline_methods 10 nr_static_inline_methods 10
}
{
count 1 name { ns0 anonymous aclass }
nr_members 10 nr_static_members 10
nr_methods 10 nr_static_methods 10
nr_inline_methods 10 nr_static_inline_methods 10
}
{
count 1 name { ns0 ns1 class }
nr_members 10 nr_static_members 10
nr_methods 10 nr_static_methods 10
nr_inline_methods 10 nr_static_inline_methods 10
}
{
count 1 name { ns0 anonymous ns1 aclass }
nr_members 10 nr_static_members 10
nr_methods 10 nr_static_methods 10
nr_inline_methods 10 nr_static_inline_methods 10
}
} }
return [array get testcase]
}
GenPerfTest::standard_compile_driver gmonster2.exp make_testcase_config