1 1.1 christos # Copyright (C) 2015-2016 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 christos if [skip_perf_tests] { 40 1.1 christos return 0 41 1.1 christos } 42 1.1 christos 43 1.1 christos if ![info exists MONSTER] { 44 1.1 christos set MONSTER "n" 45 1.1 christos } 46 1.1 christos 47 1.1 christos proc make_testcase_config { } { 48 1.1 christos global MONSTER 49 1.1 christos 50 1.1 christos set program_name "gmonster1" 51 1.1 christos array set testcase [GenPerfTest::init_testcase $program_name] 52 1.1 christos 53 1.1 christos set testcase(language) c++ 54 1.1 christos 55 1.1 christos # *_{sources,headers} need to be embedded in an outer list 56 1.1 christos # because remember each element of the outer list is for each run, and 57 1.1 christos # here we want to use the same value for all runs. 58 1.1 christos set testcase(binary_extra_sources) { { gmonster1.cc gm-hello.cc gm-use-cerr.cc gm-pervasive-typedef.cc } } 59 1.1 christos set testcase(binary_extra_headers) { { <stdint.h> gm-utils.h gm-std.h gm-pervasive-typedef.h } } 60 1.1 christos set testcase(tail_shlib_sources) { { gm-std.cc } } 61 1.1 christos set testcase(tail_shlib_headers) { { gm-std.h } } 62 1.1 christos 63 1.1 christos if { $MONSTER == "y" } { 64 1.1 christos set testcase(run_names) { 10-cus 100-cus 1000-cus 10000-cus } 65 1.1 christos set testcase(nr_compunits) { 10 100 1000 10000 } 66 1.1 christos } else { 67 1.1 christos set testcase(run_names) { 1-cu 10-cus 100-cus } 68 1.1 christos set testcase(nr_compunits) { 1 10 100 } 69 1.1 christos } 70 1.1 christos set testcase(nr_gen_shlibs) { 0 } 71 1.1 christos 72 1.1 christos set testcase(nr_extern_globals) 10 73 1.1 christos set testcase(nr_static_globals) 10 74 1.1 christos set testcase(nr_extern_functions) 10 75 1.1 christos set testcase(nr_static_functions) 10 76 1.1 christos 77 1.1 christos # class_specs needs to be embedded in an outer list because remember 78 1.1 christos # each element of the outer list is for each run, and here we want to use 79 1.1 christos # the same value for all runs. 80 1.1 christos set testcase(class_specs) { { 81 1.1 christos { 82 1.1 christos count 1 name { class } 83 1.1 christos nr_members 10 nr_static_members 10 84 1.1 christos nr_methods 10 nr_static_methods 10 85 1.1 christos nr_inline_methods 10 nr_static_inline_methods 10 86 1.1 christos } 87 1.1 christos { 88 1.1 christos count 1 name { ns0 class } 89 1.1 christos nr_members 10 nr_static_members 10 90 1.1 christos nr_methods 10 nr_static_methods 10 91 1.1 christos nr_inline_methods 10 nr_static_inline_methods 10 92 1.1 christos } 93 1.1 christos { 94 1.1 christos count 1 name { ns0 anonymous aclass } 95 1.1 christos nr_members 10 nr_static_members 10 96 1.1 christos nr_methods 10 nr_static_methods 10 97 1.1 christos nr_inline_methods 10 nr_static_inline_methods 10 98 1.1 christos } 99 1.1 christos { 100 1.1 christos count 1 name { ns0 ns1 class } 101 1.1 christos nr_members 10 nr_static_members 10 102 1.1 christos nr_methods 10 nr_static_methods 10 103 1.1 christos nr_inline_methods 10 nr_static_inline_methods 10 104 1.1 christos } 105 1.1 christos { 106 1.1 christos count 1 name { ns0 anonymous ns1 aclass } 107 1.1 christos nr_members 10 nr_static_members 10 108 1.1 christos nr_methods 10 nr_static_methods 10 109 1.1 christos nr_inline_methods 10 nr_static_inline_methods 10 110 1.1 christos } 111 1.1 christos } } 112 1.1 christos 113 1.1 christos return [array get testcase] 114 1.1 christos } 115 1.1 christos 116 1.1 christos GenPerfTest::standard_compile_driver gmonster1.exp make_testcase_config 117