aboutsummaryrefslogtreecommitdiff
path: root/gdb/testsuite/gdb.perf/gmonster1.exp
diff options
context:
space:
mode:
authorDoug Evans <dje@google.com>2015-07-24 15:46:31 -0700
committerDoug Evans <dje@google.com>2015-07-24 15:46:31 -0700
commit7fecd1b400ba3ba0ae9efba3662e1f75b519860f (patch)
tree2b788c17fe20f3b337bc892a31c7b1a5b8ae8671 /gdb/testsuite/gdb.perf/gmonster1.exp
parent6eab34f3dc27a571071d8c56146c2ffda133f454 (diff)
downloadgdb-7fecd1b400ba3ba0ae9efba3662e1f75b519860f.zip
gdb-7fecd1b400ba3ba0ae9efba3662e1f75b519860f.tar.gz
gdb-7fecd1b400ba3ba0ae9efba3662e1f75b519860f.tar.bz2
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.
Diffstat (limited to 'gdb/testsuite/gdb.perf/gmonster1.exp')
-rw-r--r--gdb/testsuite/gdb.perf/gmonster1.exp116
1 files changed, 116 insertions, 0 deletions
diff --git a/gdb/testsuite/gdb.perf/gmonster1.exp b/gdb/testsuite/gdb.perf/gmonster1.exp
new file mode 100644
index 0000000..b3111d2
--- /dev/null
+++ b/gdb/testsuite/gdb.perf/gmonster1.exp
@@ -0,0 +1,116 @@
+# 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 "gmonster1" 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 "gmonster1"
+ 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) { { gmonster1.cc gm-hello.cc gm-use-cerr.cc gm-pervasive-typedef.cc } }
+ set testcase(binary_extra_headers) { { <stdint.h> gm-utils.h gm-std.h gm-pervasive-typedef.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-cus 100-cus 1000-cus 10000-cus }
+ set testcase(nr_compunits) { 10 100 1000 10000 }
+ } else {
+ set testcase(run_names) { 1-cu 10-cus 100-cus }
+ set testcase(nr_compunits) { 1 10 100 }
+ }
+ set testcase(nr_gen_shlibs) { 0 }
+
+ 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 gmonster1.exp make_testcase_config