1// 2// Copyright (C) 2018 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 default_team: "trendy_team_native_tools_libraries", 19 default_applicable_licenses: ["system_extras_memory_replay_license"], 20} 21 22// Added automatically by a large-scale-change 23// See: http://go/android-license-faq 24license { 25 name: "system_extras_memory_replay_license", 26 visibility: [":__subpackages__"], 27 license_kinds: [ 28 "SPDX-license-identifier-Apache-2.0", 29 ], 30 license_text: [ 31 "NOTICE", 32 ], 33} 34 35cc_defaults { 36 name: "memory_replay_flag_defaults", 37 38 host_supported: true, 39 40 cflags: [ 41 "-Wall", 42 "-Wextra", 43 "-Werror", 44 ], 45} 46 47cc_defaults { 48 name: "memory_replay_defaults", 49 defaults: ["memory_replay_flag_defaults"], 50 51 shared_libs: [ 52 "libbase", 53 "liblog", 54 "libziparchive", 55 ], 56} 57 58cc_library_static { 59 name: "libmemory_trace", 60 host_supported: true, 61 defaults: ["memory_replay_flag_defaults"], 62 63 export_include_dirs: ["include"], 64 shared_libs: ["libbase"], 65 srcs: ["MemoryTrace.cpp"], 66 67 apex_available: [ 68 "//apex_available:platform", 69 "com.android.runtime", 70 ], 71} 72 73cc_library_static { 74 name: "libmemory_replay", 75 defaults: ["memory_replay_defaults"], 76 77 srcs: [ 78 "Alloc.cpp", 79 "File.cpp", 80 "NativeInfo.cpp", 81 "Pointers.cpp", 82 "Thread.cpp", 83 "Threads.cpp", 84 ], 85 86 whole_static_libs: [ 87 "libmemory_trace", 88 ], 89} 90 91cc_binary { 92 name: "memory_replay", 93 defaults: ["memory_replay_defaults"], 94 host_supported: true, 95 96 srcs: ["main.cpp"], 97 98 static_libs: [ 99 "libmemory_replay", 100 ], 101 102 compile_multilib: "both", 103 multilib: { 104 lib32: { 105 suffix: "32", 106 }, 107 lib64: { 108 suffix: "64", 109 }, 110 }, 111 112 target: { 113 host: { 114 // Keep debug information for host executables. 115 strip: { 116 none: true, 117 }, 118 }, 119 }, 120} 121 122cc_binary_host { 123 name: "filter_trace", 124 defaults: ["memory_replay_defaults"], 125 126 static_libs: [ 127 "libmemory_replay", 128 ], 129 130 srcs: [ 131 "FilterTrace.cpp", 132 ], 133} 134 135cc_binary_host { 136 name: "print_trace", 137 defaults: ["memory_replay_defaults"], 138 139 static_libs: [ 140 "libmemory_replay", 141 ], 142 143 srcs: [ 144 "PrintTrace.cpp", 145 ], 146} 147 148cc_binary_host { 149 name: "verify_trace", 150 defaults: ["memory_replay_defaults"], 151 152 static_libs: [ 153 "libmemory_replay", 154 ], 155 156 srcs: [ 157 "VerifyTrace.cpp", 158 ], 159} 160 161cc_test { 162 name: "memory_replay_tests", 163 defaults: ["memory_replay_defaults"], 164 isolated: true, 165 166 srcs: [ 167 "tests/FileTest.cpp", 168 "tests/MemoryTraceTest.cpp", 169 "tests/NativeInfoTest.cpp", 170 "tests/PointersTest.cpp", 171 "tests/ThreadTest.cpp", 172 "tests/ThreadsTest.cpp", 173 ], 174 175 local_include_dirs: ["tests"], 176 177 static_libs: [ 178 "libmemory_replay", 179 ], 180 181 data: [ 182 "tests/test.txt", 183 "tests/test.zip", 184 ], 185 186 test_suites: ["general-tests"], 187} 188 189cc_benchmark { 190 name: "trace_benchmark", 191 defaults: ["memory_replay_defaults"], 192 193 srcs: [ 194 "TraceBenchmark.cpp", 195 ], 196 197 static_libs: [ 198 "libmemory_replay", 199 ], 200 201 data: [ 202 "traces/*.zip", 203 ], 204} 205