1// 2// Copyright (C) 2019 The Android Open Source Project 3// 4// Licensed under the Apache License, Version 2.0 (the "License"); 5// you may not use this file except in compliance with the License. 6// You may obtain a copy of the License at 7// 8// http://www.apache.org/licenses/LICENSE-2.0 9// 10// Unless required by applicable law or agreed to in writing, software 11// distributed under the License is distributed on an "AS IS" BASIS, 12// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13// See the License for the specific language governing permissions and 14// limitations under the License. 15// 16 17package { 18 // See: http://go/android-license-faq 19 // A large-scale-change added 'default_applicable_licenses' to import 20 // all of the 'license_kinds' from "system_extras_simpleperf_license" 21 // to get the below license kinds: 22 // SPDX-license-identifier-Apache-2.0 23 default_applicable_licenses: ["system_extras_simpleperf_license"], 24} 25 26cc_defaults { 27 name: "simpleperf_runtest_defaults", 28 host_supported: true, 29 cflags: [ 30 "-Wall", 31 "-Wextra", 32 "-Werror", 33 "-Wunused", 34 "-O0", 35 ], 36 compile_multilib: "both", 37 multilib: { 38 lib64: { 39 suffix: "64", 40 }, 41 lib32: { 42 suffix: "32", 43 }, 44 }, 45 target: { 46 darwin: { 47 enabled: false, 48 }, 49 }, 50} 51 52cc_binary { 53 name: "simpleperf_runtest_one_function", 54 defaults: ["simpleperf_runtest_defaults"], 55 srcs: ["one_function.cpp"], 56} 57 58cc_binary { 59 name: "simpleperf_runtest_two_functions", 60 defaults: ["simpleperf_runtest_defaults"], 61 srcs: ["two_functions.cpp"], 62} 63 64cc_binary { 65 name: "simpleperf_runtest_function_fork", 66 defaults: ["simpleperf_runtest_defaults"], 67 srcs: ["function_fork.cpp"], 68} 69 70cc_binary { 71 name: "simpleperf_runtest_function_pthread", 72 defaults: ["simpleperf_runtest_defaults"], 73 srcs: ["function_pthread.cpp"], 74} 75 76cc_binary { 77 name: "simpleperf_runtest_comm_change", 78 defaults: ["simpleperf_runtest_defaults"], 79 srcs: ["comm_change.cpp"], 80} 81 82cc_binary { 83 name: "simpleperf_runtest_function_recursive", 84 defaults: ["simpleperf_runtest_defaults"], 85 srcs: ["function_recursive.cpp"], 86} 87 88cc_binary { 89 name: "simpleperf_runtest_function_indirect_recursive", 90 defaults: ["simpleperf_runtest_defaults"], 91 srcs: ["function_indirect_recursive.cpp"], 92} 93 94cc_binary { 95 name: "simpleperf_runtest_run_and_sleep", 96 defaults: ["simpleperf_runtest_defaults"], 97 srcs: ["run_and_sleep.cpp"], 98} 99 100// Used as an example in collect_etm_data_for_autofdo.md. 101cc_binary { 102 name: "etm_test_loop", 103 srcs: ["etm_test_loop.cpp"], 104 // Keep relocation sections of executables for bolt. 105 ldflags: ["-Wl,-q"], 106 // afdo: true, 107} 108 109cc_binary { 110 name: "etm_test_loop_small", 111 srcs: ["etm_test_loop.cpp"], 112 ldflags: [ 113 "-Wl,-z,noseparate-code", 114 "-Wl,-q", 115 ], 116} 117 118cc_binary { 119 name: "autofdo_addr_test", 120 srcs: ["autofdo_addr_test.cpp"], 121 ldflags: [ 122 "-Wl,-z,noseparate-code", 123 "-Wl,-q", 124 ], 125} 126