Home | History | Annotate | Line # | Download | only in gdb.perf
      1  1.1.1.6  christos # Copyright (C) 2015-2024 Free Software Foundation, Inc.
      2      1.1  christos 
      3      1.1  christos # This program is free software; you can redistribute it and/or modify
      4      1.1  christos # it under the terms of the GNU General Public License as published by
      5      1.1  christos # the Free Software Foundation; either version 3 of the License, or
      6      1.1  christos # (at your option) any later version.
      7      1.1  christos #
      8      1.1  christos # This program is distributed in the hope that it will be useful,
      9      1.1  christos # but WITHOUT ANY WARRANTY; without even the implied warranty of
     10      1.1  christos # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
     11      1.1  christos # GNU General Public License for more details.
     12      1.1  christos #
     13      1.1  christos # You should have received a copy of the GNU General Public License
     14      1.1  christos # along with this program.  If not, see <http://www.gnu.org/licenses/>.
     15      1.1  christos 
     16      1.1  christos # Perftest description file for building the "gmonster1" benchmark.
     17      1.1  christos # Where does the name come from?  The benchmark is derived from one of the
     18      1.1  christos # monster programs at Google.
     19      1.1  christos #
     20      1.1  christos # Perftest descriptions are loaded thrice:
     21      1.1  christos # 1) To generate the build .exp files
     22      1.1  christos #    GDB_PERFTEST_MODE=gen-build-exps
     23      1.1  christos #    This step allows for parallel builds of the majority of pieces of the
     24      1.1  christos #    test binary and shlibs.
     25      1.1  christos # 2) To compile the "pieces" of the binary and shlibs.
     26      1.1  christos #    "Pieces" are the bulk of the machine-generated sources of the test.
     27      1.1  christos #    This step is driven by lib/build-piece.exp.
     28      1.1  christos #    GDB_PERFTEST_MODE=build-pieces
     29      1.1  christos # 3) To perform the final link of the binary and shlibs.
     30      1.1  christos #    GDB_PERFTEST_MODE=compile
     31      1.1  christos #
     32      1.1  christos # Example usage:
     33      1.1  christos # bash$ make -j5 build-perf RUNTESTFLAGS="gmonster1.exp gmonster2.exp"
     34      1.1  christos # bash$ make check-perf RUNTESTFLAGS="gdb.perf/gm*-*.exp GDB=/path/to/gdb"
     35      1.1  christos 
     36      1.1  christos load_lib perftest.exp
     37      1.1  christos load_lib gen-perf-test.exp
     38      1.1  christos 
     39  1.1.1.6  christos require allow_perf_tests
     40      1.1  christos 
     41      1.1  christos if ![info exists MONSTER] {
     42      1.1  christos     set MONSTER "n"
     43      1.1  christos }
     44      1.1  christos 
     45      1.1  christos proc make_testcase_config { } {
     46      1.1  christos     global MONSTER
     47      1.1  christos 
     48      1.1  christos     set program_name "gmonster1"
     49      1.1  christos     array set testcase [GenPerfTest::init_testcase $program_name]
     50      1.1  christos 
     51      1.1  christos     set testcase(language) c++
     52      1.1  christos 
     53      1.1  christos     # *_{sources,headers} need to be embedded in an outer list
     54      1.1  christos     # because remember each element of the outer list is for each run, and
     55      1.1  christos     # here we want to use the same value for all runs.
     56      1.1  christos     set testcase(binary_extra_sources) { { gmonster1.cc gm-hello.cc gm-use-cerr.cc gm-pervasive-typedef.cc } }
     57      1.1  christos     set testcase(binary_extra_headers) { { <stdint.h> gm-utils.h gm-std.h gm-pervasive-typedef.h } }
     58      1.1  christos     set testcase(tail_shlib_sources) { { gm-std.cc } }
     59      1.1  christos     set testcase(tail_shlib_headers) { { gm-std.h } }
     60      1.1  christos 
     61      1.1  christos     if { $MONSTER == "y" } {
     62      1.1  christos 	set testcase(run_names) { 10-cus 100-cus 1000-cus 10000-cus }
     63      1.1  christos 	set testcase(nr_compunits) { 10 100 1000 10000 }
     64      1.1  christos     } else {
     65      1.1  christos 	set testcase(run_names) { 1-cu 10-cus 100-cus }
     66      1.1  christos 	set testcase(nr_compunits) { 1 10 100 }
     67      1.1  christos     }
     68      1.1  christos     set testcase(nr_gen_shlibs) { 0 }
     69      1.1  christos 
     70      1.1  christos     set testcase(nr_extern_globals) 10
     71      1.1  christos     set testcase(nr_static_globals) 10
     72      1.1  christos     set testcase(nr_extern_functions) 10
     73      1.1  christos     set testcase(nr_static_functions) 10
     74      1.1  christos 
     75      1.1  christos     # class_specs needs to be embedded in an outer list because remember
     76      1.1  christos     # each element of the outer list is for each run, and here we want to use
     77      1.1  christos     # the same value for all runs.
     78      1.1  christos     set testcase(class_specs) { {
     79      1.1  christos 	{
     80      1.1  christos 	    count 1 name { class }
     81      1.1  christos 	    nr_members 10 nr_static_members 10
     82      1.1  christos 	    nr_methods 10 nr_static_methods 10
     83      1.1  christos 	    nr_inline_methods 10 nr_static_inline_methods 10
     84      1.1  christos 	}
     85      1.1  christos 	{
     86      1.1  christos 	    count 1 name { ns0 class }
     87      1.1  christos 	    nr_members 10 nr_static_members 10
     88      1.1  christos 	    nr_methods 10 nr_static_methods 10
     89      1.1  christos 	    nr_inline_methods 10 nr_static_inline_methods 10
     90      1.1  christos 	}
     91      1.1  christos 	{
     92      1.1  christos 	    count 1 name { ns0 anonymous aclass }
     93      1.1  christos 	    nr_members 10 nr_static_members 10
     94      1.1  christos 	    nr_methods 10 nr_static_methods 10
     95      1.1  christos 	    nr_inline_methods 10 nr_static_inline_methods 10
     96      1.1  christos 	}
     97      1.1  christos 	{
     98      1.1  christos 	    count 1 name { ns0 ns1 class }
     99      1.1  christos 	    nr_members 10 nr_static_members 10
    100      1.1  christos 	    nr_methods 10 nr_static_methods 10
    101      1.1  christos 	    nr_inline_methods 10 nr_static_inline_methods 10
    102      1.1  christos 	}
    103      1.1  christos 	{
    104      1.1  christos 	    count 1 name { ns0 anonymous ns1 aclass }
    105      1.1  christos 	    nr_members 10 nr_static_members 10
    106      1.1  christos 	    nr_methods 10 nr_static_methods 10
    107      1.1  christos 	    nr_inline_methods 10 nr_static_inline_methods 10
    108      1.1  christos 	}
    109      1.1  christos     } }
    110      1.1  christos 
    111      1.1  christos     return [array get testcase]
    112      1.1  christos }
    113      1.1  christos 
    114      1.1  christos GenPerfTest::standard_compile_driver gmonster1.exp make_testcase_config
    115