7fecd1b400
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.
52 lines
2.1 KiB
Python
52 lines
2.1 KiB
Python
# 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/>.
|
|
|
|
# Test printing of std::cerr.
|
|
# libstdc++ is typically near the end of the list of shared libraries,
|
|
# and thus searched last (or near last).
|
|
# Plus llvm had a bug where its pubnames output that gold uses to generate
|
|
# the index caused a massive perf regression (basically it emitted an entry
|
|
# for every CU that used it, whereas we only want the CU with the
|
|
# definition).
|
|
#
|
|
# Note: One difference between this test and gmonster-ptype-string.py
|
|
# is that here we do not pre-expand the symtab: we don't want include
|
|
# GDB's slowness in searching expanded symtabs first to color these results.
|
|
|
|
from perftest import perftest
|
|
from perftest import measure
|
|
from perftest import utils
|
|
|
|
class PrintCerr(perftest.TestCaseWithBasicMeasurements):
|
|
def __init__(self, name, run_names, binfile):
|
|
super(PrintCerr, self).__init__(name)
|
|
self.run_names = run_names
|
|
self.binfile = binfile
|
|
|
|
def warm_up(self):
|
|
pass
|
|
|
|
def execute_test(self):
|
|
for run in self.run_names:
|
|
this_run_binfile = "%s-%s" % (self.binfile,
|
|
utils.convert_spaces(run))
|
|
utils.select_file(this_run_binfile)
|
|
utils.runto_main()
|
|
iteration = 5
|
|
while iteration > 0:
|
|
utils.safe_execute("mt flush-symbol-cache")
|
|
func = lambda: utils.safe_execute("print gm_std::cerr")
|
|
self.measure.measure(func, run)
|
|
iteration -= 1
|