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: false, 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 113cc_binary_host { 114 name: "filter_trace", 115 defaults: ["memory_replay_defaults"], 116 117 static_libs: [ 118 "libmemory_replay", 119 ], 120 121 srcs: [ 122 "FilterTrace.cpp", 123 ], 124} 125 126cc_binary_host { 127 name: "print_trace", 128 defaults: ["memory_replay_defaults"], 129 130 static_libs: [ 131 "libmemory_replay", 132 ], 133 134 srcs: [ 135 "PrintTrace.cpp", 136 ], 137} 138 139cc_binary_host { 140 name: "verify_trace", 141 defaults: ["memory_replay_defaults"], 142 143 static_libs: [ 144 "libmemory_replay", 145 ], 146 147 srcs: [ 148 "VerifyTrace.cpp", 149 ], 150} 151 152cc_test { 153 name: "memory_replay_tests", 154 defaults: ["memory_replay_defaults"], 155 isolated: true, 156 157 srcs: [ 158 "tests/FileTest.cpp", 159 "tests/MemoryTraceTest.cpp", 160 "tests/NativeInfoTest.cpp", 161 "tests/PointersTest.cpp", 162 "tests/ThreadTest.cpp", 163 "tests/ThreadsTest.cpp", 164 ], 165 166 local_include_dirs: ["tests"], 167 168 static_libs: [ 169 "libmemory_replay", 170 ], 171 172 data: [ 173 "tests/test.txt", 174 "tests/test.zip", 175 ], 176 177 test_suites: ["general-tests"], 178} 179 180cc_benchmark { 181 name: "trace_benchmark", 182 defaults: ["memory_replay_defaults"], 183 184 srcs: [ 185 "TraceBenchmark.cpp", 186 ], 187 188 static_libs: [ 189 "libmemory_replay", 190 ], 191 192 data: [ 193 "traces/*.zip", 194 ], 195} 196