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