blob: df6da5c81b7ba8cfef6d745923bf47a6d8463d32 [file] [log] [blame]
Primiano Tucciae2879e2017-09-27 11:02:09 +09001# Copyright (C) 2017 The Android Open Source Project
2#
3# Licensed under the Apache License, Version 2.0 (the "License");
4# you may not use this file except in compliance with the License.
5# You may obtain a copy of the License at
6#
7# http://www.apache.org/licenses/LICENSE-2.0
8#
9# Unless required by applicable law or agreed to in writing, software
10# distributed under the License is distributed on an "AS IS" BASIS,
11# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12# See the License for the specific language governing permissions and
13# limitations under the License.
14
Oystein Eftevaagdd727e42017-12-05 08:49:55 -080015import("gn/perfetto.gni")
Eric Secklera6ba1792019-01-02 12:51:00 +000016import("gn/test.gni")
Primiano Tucci4c5efa42018-10-23 13:15:13 +010017
Primiano Tucci7e05fc12019-08-27 17:29:47 +020018if (perfetto_root_path == "//") {
Florian Mayerf98c9d62018-09-03 16:38:16 +010019 import("//gn/standalone/android.gni")
Primiano Tuccia1959712018-05-17 11:01:56 +010020 import("//gn/standalone/sanitizers/vars.gni")
21} else {
Primiano Tucci7e05fc12019-08-27 17:29:47 +020022 import("//build/config/android/config.gni")
Primiano Tuccia1959712018-05-17 11:01:56 +010023 import("//build/config/sanitizers/sanitizers.gni")
24}
25
Primiano Tuccif3837d52018-01-10 21:12:41 +000026declare_args() {
27 # Only for local development. When true the binaries (perfetto, traced, ...)
28 # are monolithic and don't use a common shared library. This is mainly to
29 # avoid LD_LIBRARY_PATH dances when testing locally.
30 monolithic_binaries = false
Florian Mayerb64d6b12018-08-30 10:46:30 -070031
32 # libunwindstack requires API level 26 or newer.
Florian Mayera2fae262018-08-31 12:10:01 -070033 should_build_heapprofd =
Primiano Tucci4c5efa42018-10-23 13:15:13 +010034 (perfetto_build_standalone || perfetto_build_with_android) && is_clang &&
35 (is_linux || is_android) &&
36 (!is_android || android_api_level >= 26 || perfetto_build_with_android)
Primiano Tuccif3837d52018-01-10 21:12:41 +000037}
Primiano Tucci4c5efa42018-10-23 13:15:13 +010038assert(!monolithic_binaries || !perfetto_build_with_android)
Primiano Tuccif3837d52018-01-10 21:12:41 +000039
Primiano Tucciae2879e2017-09-27 11:02:09 +090040group("all") {
41 testonly = true # allow to build also test targets
42 deps = [
Eric Secklera6ba1792019-01-02 12:51:00 +000043 ":perfetto_unittests",
Primiano Tucci764c5042019-06-22 18:28:45 +010044 "src/protozero/protoc_plugin:protozero_plugin($host_toolchain)",
Primiano Tucciae2879e2017-09-27 11:02:09 +090045 ]
Primiano Tucci7e05fc12019-08-27 17:29:47 +020046 if (enable_perfetto_trace_processor) {
Lalit Magantiedace412019-06-18 13:28:28 +010047 deps += [ ":trace_processor_shell" ]
Mikhail Khokhlov8643d1c2019-06-04 12:02:47 +010048 }
Primiano Tucci4c5efa42018-10-23 13:15:13 +010049 if (perfetto_build_standalone || perfetto_build_with_android) {
Primiano Tuccib03ba362017-12-06 09:47:41 +000050 deps += [
Primiano Tucci808d6df2018-03-31 13:24:18 +010051 ":perfetto",
Primiano Tucci808d6df2018-03-31 13:24:18 +010052 ":perfetto_integrationtests",
53 ":traced",
54 ":traced_probes",
Hector Dearman696ff772019-04-23 18:38:53 +010055 ":trigger_perfetto",
Primiano Tuccic5010802018-01-19 17:13:21 +000056 "protos/perfetto/config:merged_config", # For syntax-checking the proto.
Hector Dearmane92c6742018-11-22 21:42:39 +000057 "protos/perfetto/trace:merged_trace", # For syntax-checking the proto.
Oystein Eftevaag067fd5b2018-03-27 12:39:30 -070058 "src/ipc/protoc_plugin:ipc_plugin($host_toolchain)",
Primiano Tucci2c5488f2019-06-01 03:27:28 +010059 "src/tracing:client_api",
Primiano Tuccidd5ebc92019-07-25 01:09:37 +010060 "test:client_api_example",
Oystein Eftevaag51e06e52018-01-18 11:28:49 -080061 "tools:protoc_helper",
Primiano Tuccib03ba362017-12-06 09:47:41 +000062 ]
Primiano Tucci4c5efa42018-10-23 13:15:13 +010063 if (perfetto_build_standalone) {
Primiano Tucci5968caf2018-08-06 10:31:46 +010064 deps += [
Primiano Tucci4c5efa42018-10-23 13:15:13 +010065 ":perfetto_benchmarks",
Florian Mayerc50bcc92019-02-07 11:43:30 +000066 "src/profiling/memory:ring_buffer",
Primiano Tucci3cd31322018-10-11 20:06:56 +010067 "src/tracing:consumer_api_test",
Primiano Tucci4c5efa42018-10-23 13:15:13 +010068 "test/configs",
69 "tools/ftrace_proto_gen:ftrace_proto_gen",
70 "tools/proto_to_cpp",
Hector Dearman7fead1c2019-06-25 00:47:38 +010071 "tools/protoprofile",
Primiano Tucci5968caf2018-08-06 10:31:46 +010072 "tools/trace_to_text",
Hector Dearman499cd602018-11-20 13:02:31 +000073 "tools/trace_to_text:trace_to_text_lite_host($host_toolchain)",
Lalit Magantif9799c62019-05-28 20:01:08 +010074
75 # The diff testing framework depends on these descriptors.
76 "protos/perfetto/metrics:descriptor",
77 "protos/perfetto/trace:descriptor",
Hector Dearman7a9ffa72019-08-13 16:00:10 +010078
79 # Used in the when updating the ftrace protos
80 "protos/perfetto/trace/ftrace:descriptor",
Primiano Tucci5968caf2018-08-06 10:31:46 +010081 ]
Primiano Tucci4c5efa42018-10-23 13:15:13 +010082 if (is_linux || is_android) {
Ryan Savitskidb7f1ae2019-04-10 17:28:28 +010083 deps += [ "tools/busy_threads" ]
Ryan Savitski488e1222019-06-26 21:28:42 +010084 deps += [ "tools/cpu_utilization" ]
Lalit Maganti787418f2019-04-11 14:14:23 +010085 deps += [ "tools/dump_ftrace_stats" ]
Ryan Savitski488e1222019-06-26 21:28:42 +010086 deps += [ "tools/skippy" ]
Primiano Tucci4c5efa42018-10-23 13:15:13 +010087 }
Florian Mayer2e480712018-12-07 16:25:41 +000088 if (is_fuzzer) {
Primiano Tucci4c5efa42018-10-23 13:15:13 +010089 deps += [ ":fuzzers" ]
90 }
Primiano Tuccia1959712018-05-17 11:01:56 +010091 }
Primiano Tuccib03ba362017-12-06 09:47:41 +000092 }
Primiano Tucciae2879e2017-09-27 11:02:09 +090093}
94
Primiano Tucci3faad742018-05-16 19:30:48 +010095# TODO(primiano): temporary workaround to:
96# 1) Prevent that the UI gets build automatically when doing ninja -C out/xx .
97# 2) Avoid breaking the chrome build, that right now depends on "all".
98group("default") {
99 testonly = true # allow to build also test targets
100 deps = [
101 ":all",
102 ]
103}
104
Mikhail Khokhlov8643d1c2019-06-04 12:02:47 +0100105# The trace processor shell executable. An interactive shell that allows to
106# make queries on the trace using the terminal.
Primiano Tucci7e05fc12019-08-27 17:29:47 +0200107if (enable_perfetto_trace_processor) {
Lalit Magantiedace412019-06-18 13:28:28 +0100108 executable("trace_processor_shell") {
Primiano Tucci5968caf2018-08-06 10:31:46 +0100109 deps = [
Lalit Magantiedace412019-06-18 13:28:28 +0100110 "gn:default_deps",
Primiano Tucci5968caf2018-08-06 10:31:46 +0100111 "src/trace_processor:trace_processor_shell",
112 ]
Lalit Magantica4d5142019-05-28 13:25:47 +0100113 testonly = true # We need this for proto full.
Primiano Tucci5968caf2018-08-06 10:31:46 +0100114 }
Primiano Tucci3faad742018-05-16 19:30:48 +0100115}
116
Mikhail Khokhlov8643d1c2019-06-04 12:02:47 +0100117if (perfetto_build_standalone) {
118 group("ui") {
119 deps = [
120 "ui",
121 ]
122 }
123}
124
Eric Secklera6ba1792019-01-02 12:51:00 +0000125test("perfetto_unittests") {
Primiano Tucciae2879e2017-09-27 11:02:09 +0900126 deps = [
Primiano Tuccib03ba362017-12-06 09:47:41 +0000127 "gn:default_deps",
Florian Mayerd8bd81b2018-01-25 12:49:15 +0000128 "gn:gtest_main",
Hector Dearman6cfec8a2018-03-14 16:54:09 +0000129 "src/base:unittests",
Bruce Dawsonc3e67632018-05-14 14:07:51 +0100130 "src/protozero:unittests",
Oystein Eftevaage5e84fb2018-06-01 17:34:56 -0700131 "src/tracing:unittests",
Primiano Tucciae2879e2017-09-27 11:02:09 +0900132 ]
Primiano Tucci1640ffa2018-05-14 18:25:33 +0100133
Primiano Tucci4c5efa42018-10-23 13:15:13 +0100134 if (perfetto_build_standalone || perfetto_build_with_android) {
Oystein Eftevaag067fd5b2018-03-27 12:39:30 -0700135 deps += [
136 "src/ipc:unittests",
137 "src/perfetto_cmd:unittests",
Florian Mayerc50bcc92019-02-07 11:43:30 +0000138 "src/profiling/memory:ring_buffer_unittests",
Primiano Tucci808d6df2018-03-31 13:24:18 +0100139 "src/traced/probes:unittests",
Oystein Eftevaag067fd5b2018-03-27 12:39:30 -0700140 "src/traced/probes/filesystem:unittests",
Primiano Tuccide82dae2018-06-04 16:17:49 +0200141 "src/traced/probes/ftrace:unittests",
Eric Seckler21077742019-03-18 09:07:54 +0000142 "src/traced/service:unittests",
Primiano Tucci808d6df2018-03-31 13:24:18 +0100143 "tools/ftrace_proto_gen:unittests",
Oystein Eftevaag067fd5b2018-03-27 12:39:30 -0700144 "tools/sanitizers_unittests",
145 ]
Primiano Tucci931284e2017-12-11 09:23:53 +0000146 }
Florian Mayerb64d6b12018-08-30 10:46:30 -0700147 if (should_build_heapprofd) {
148 # Restrict to clang, as libunwindstack and its dependencies is never
149 # built using GCC in the Android tree.
150 deps += [ "src/profiling/memory:unittests" ]
151 }
Primiano Tucci4c5efa42018-10-23 13:15:13 +0100152 if (perfetto_build_standalone && !is_android) {
Lalit Maganti5f3a0182019-05-07 16:40:36 +0100153 deps += [
154 "src/trace_processor:unittests",
155 "src/trace_processor/metrics:unittests",
156 ]
Lalit Maganticaed37e2018-06-01 03:03:08 +0100157 }
Primiano Tuccib03ba362017-12-06 09:47:41 +0000158}
Oystein Eftevaagdd727e42017-12-05 08:49:55 -0800159
Primiano Tucci4c5efa42018-10-23 13:15:13 +0100160if (perfetto_build_standalone || perfetto_build_with_android) {
Eric Secklera6ba1792019-01-02 12:51:00 +0000161 test("perfetto_integrationtests") {
Lalit Maganti79f2d7b2018-01-23 18:27:33 +0000162 deps = [
163 "gn:default_deps",
Florian Mayerd8bd81b2018-01-25 12:49:15 +0000164 "gn:gtest_main",
Primiano Tuccide82dae2018-06-04 16:17:49 +0200165 "src/traced/probes/ftrace:integrationtests",
Primiano Tucci2c5488f2019-06-01 03:27:28 +0100166 "src/tracing:client_api_integrationtests",
Lalit Maganti79f2d7b2018-01-23 18:27:33 +0000167 "test:end_to_end_integrationtests",
168 ]
Primiano Tucci4c5efa42018-10-23 13:15:13 +0100169 if (perfetto_build_standalone && !is_android) {
Hector Dearman7f71d0e2018-08-09 11:26:10 +0100170 deps += [ "src/trace_processor:integrationtests" ]
171 }
Florian Mayer42802492018-12-13 11:00:16 +0000172
173 # TODO(fmayer): Fix in process daemons.
Florian Mayer087d37f2019-05-23 12:59:08 +0100174 if (should_build_heapprofd) {
Florian Mayer42802492018-12-13 11:00:16 +0000175 deps += [ "src/profiling/memory:end_to_end_tests" ]
176 }
Lalit Maganti79f2d7b2018-01-23 18:27:33 +0000177 }
178
Primiano Tuccif3837d52018-01-10 21:12:41 +0000179 if (monolithic_binaries) {
Primiano Tuccibdb2a592018-10-11 15:59:29 +0100180 libperfetto_target_type = "source_set"
Primiano Tuccif3837d52018-01-10 21:12:41 +0000181 } else {
Primiano Tuccibdb2a592018-10-11 15:59:29 +0100182 libperfetto_target_type = "shared_library"
Primiano Tuccif3837d52018-01-10 21:12:41 +0000183 }
184
Primiano Tuccibdb2a592018-10-11 15:59:29 +0100185 target(libperfetto_target_type, "libperfetto") {
Primiano Tucci4e49c022017-12-21 18:22:44 +0100186 deps = [
187 "gn:default_deps",
Primiano Tucci6067e732018-01-08 16:19:40 +0000188 "src/traced/probes",
189 "src/traced/service",
Primiano Tucci2c5488f2019-06-01 03:27:28 +0100190 "src/tracing:consumer_api_deprecated",
Primiano Tucci6067e732018-01-08 16:19:40 +0000191 ]
192 }
193
Primiano Tucci3b729102018-01-08 18:16:36 +0000194 # The unprivileged trace daemon that listens for Producer and Consumer
195 # connections, handles the coordination of the tracing sessions and owns the
196 # log buffers.
Primiano Tucci6067e732018-01-08 16:19:40 +0000197 executable("traced") {
198 deps = [
Primiano Tuccibdb2a592018-10-11 15:59:29 +0100199 ":libperfetto",
Primiano Tucci6067e732018-01-08 16:19:40 +0000200 "gn:default_deps",
Primiano Tucci2c5488f2019-06-01 03:27:28 +0100201 "include/perfetto/ext/traced",
Primiano Tucci6067e732018-01-08 16:19:40 +0000202 ]
203 sources = [
204 "src/traced/service/main.cc",
205 ]
206 }
207
Primiano Tucci3b729102018-01-08 18:16:36 +0000208 # The unprivileged daemon that is allowed to access tracefs (for ftrace).
209 # Registers as a Producer on the traced daemon.
Primiano Tucci6067e732018-01-08 16:19:40 +0000210 executable("traced_probes") {
211 deps = [
Primiano Tuccibdb2a592018-10-11 15:59:29 +0100212 ":libperfetto",
Primiano Tucci6067e732018-01-08 16:19:40 +0000213 "gn:default_deps",
Primiano Tucci2c5488f2019-06-01 03:27:28 +0100214 "include/perfetto/ext/traced",
Primiano Tucci6067e732018-01-08 16:19:40 +0000215 ]
216 sources = [
217 "src/traced/probes/main.cc",
Primiano Tucci4e49c022017-12-21 18:22:44 +0100218 ]
219 }
Primiano Tucci3b729102018-01-08 18:16:36 +0000220
221 # The command line client for Perfetto. Allows to configure / start / stop
222 # tracing, acting as a Consumer.
223 executable("perfetto") {
224 deps = [
Primiano Tucci3b729102018-01-08 18:16:36 +0000225 "gn:default_deps",
Hector Dearmanc443a362018-02-28 16:03:56 +0000226 "src/perfetto_cmd",
Primiano Tucci3b729102018-01-08 18:16:36 +0000227 ]
228 sources = [
Hector Dearmanc443a362018-02-28 16:03:56 +0000229 "src/perfetto_cmd/main.cc",
Primiano Tucci3b729102018-01-08 18:16:36 +0000230 ]
231 }
Primiano Tucci6aa75572018-03-21 05:33:14 -0700232
Hector Dearman696ff772019-04-23 18:38:53 +0100233 # Tool to finalize long running traces.
234 # This connects to traced as a producer and sends the triggers passed on the
235 # commandline. This is a subset of what the perfetto binary can do but we
236 # need a separate binary for programs that cannot (for good reason) use the
237 # additional functionality (for example starting traces via consumer socket)
238 # due to selinux rules.
239 executable("trigger_perfetto") {
240 deps = [
241 "gn:default_deps",
242 "src/perfetto_cmd:trigger_perfetto_cmd",
243 ]
244 sources = [
245 "src/perfetto_cmd/trigger_perfetto_main.cc",
246 ]
247 }
248
Primiano Tucci4c5efa42018-10-23 13:15:13 +0100249 if (perfetto_build_with_android) {
Primiano Tucci21c19d82018-03-29 12:35:08 +0100250 executable("trace_to_text") {
251 testonly = true
252 deps = [
253 "gn:default_deps",
Primiano Tucci20dc8f72018-10-23 12:28:29 +0100254 "tools/trace_to_text:full",
Primiano Tucci21c19d82018-03-29 12:35:08 +0100255 ]
256 }
Primiano Tucci21c19d82018-03-29 12:35:08 +0100257
Primiano Tucci808d6df2018-03-31 13:24:18 +0100258 # This target exports perfetto trace protos in the Android build system,
259 # allowing both host and device targets to implement custom parsers based on
260 # our protos.
261 static_library("perfetto_trace_protos") {
262 deps = [
263 "protos/perfetto/trace:lite",
264 ]
265 }
Primiano Tucci676f0cc2018-12-03 20:03:26 +0100266
267 shared_library("libperfetto_android_internal") {
268 deps = [
269 "gn:default_deps",
270 "src/android_internal",
271 ]
272 }
273 } # if (perfetto_build_with_android)
Primiano Tucci4c5efa42018-10-23 13:15:13 +0100274} # if (perfetto_build_standalone || perfetto_build_with_android)
Oystein Eftevaaga812a942018-03-23 11:52:32 -0700275
Primiano Tucci7e05fc12019-08-27 17:29:47 +0200276if (!build_with_chromium) {
277 # Client library target.
278 # Still in experimental stage and not API stable yet.
279 # See "libperfetto_client_example" (in Android.bp.extras) for an example
280 # on how to use the Perfetto Client API from the android tree.
281 static_library("libperfetto_client_experimental") {
282 complete_static_lib = true
283 deps = [
284 "gn:default_deps",
285 "src/tracing",
286 "src/tracing:client_api",
287 "src/tracing:platform_posix",
288 ]
289 sources = [
290 "include/perfetto/tracing.h",
291 ]
Primiano Tucci4c5efa42018-10-23 13:15:13 +0100292 }
Primiano Tucci7e05fc12019-08-27 17:29:47 +0200293}
294
295# TODO(primiano): there seem to be two "libperfetto" targets defined within this
296# BUILD.gn file. Rationalize them with eseckler@. For now seems this one is only
297# used from chromium and the other one only from the Android tree.
298if (build_with_chromium) {
299 component("libperfetto") {
Primiano Tucci20b760c2018-01-19 12:36:12 +0000300 public_configs = [ "gn:public_config" ]
Oystein Eftevaag5e8a4eb2018-01-09 11:41:58 -0800301 deps = [
302 "src/tracing",
303 ]
Oystein Eftevaaga812a942018-03-23 11:52:32 -0700304 configs -= [ "//build/config/compiler:chromium_code" ]
305 configs += [ "//build/config/compiler:no_chromium_code" ]
306 public_deps = [
Primiano Tucci2c5488f2019-06-01 03:27:28 +0100307 "include/perfetto/ext/tracing/core",
Oystein Eftevaag6fcedac2018-07-02 12:02:55 -0700308 "protos/perfetto/trace:zero",
309 "protos/perfetto/trace/chrome:zero",
Eric Secklerd3139b42019-02-26 13:43:59 +0000310 "protos/perfetto/trace/interned_data:zero",
Oystein Eftevaagae116202019-07-11 09:48:42 -0700311 "protos/perfetto/trace/profiling:zero",
Eric Secklerd3139b42019-02-26 13:43:59 +0000312 "protos/perfetto/trace/track_event:zero",
Oystein Eftevaaga812a942018-03-23 11:52:32 -0700313 ]
Oystein Eftevaag5e8a4eb2018-01-09 11:41:58 -0800314 }
Primiano Tucci7e05fc12019-08-27 17:29:47 +0200315 component("libtrace_processor") {
Eric Seckler8f5299c2019-08-09 14:47:30 +0100316 public_configs = [ "gn:public_config" ]
317 deps = [
318 "src/trace_processor:lib",
319 ]
320 configs -= [ "//build/config/compiler:chromium_code" ]
321 configs += [ "//build/config/compiler:no_chromium_code" ]
322 public_deps = [
323 "include/perfetto/trace_processor",
324 ]
325 }
Oystein Eftevaaga812a942018-03-23 11:52:32 -0700326}
Primiano Tuccia1959712018-05-17 11:01:56 +0100327
Primiano Tucci4c5efa42018-10-23 13:15:13 +0100328if (perfetto_build_standalone) {
329 executable("perfetto_benchmarks") {
330 testonly = true
331 deps = [
332 "gn:default_deps",
333 "src/traced/probes/ftrace:benchmarks",
Primiano Tucci4c5efa42018-10-23 13:15:13 +0100334 "test:benchmark_main",
335 "test:end_to_end_benchmarks",
336 ]
337 }
338
Primiano Tucci59d6ace2018-09-26 22:24:20 +0100339 group("fuzzers") {
340 testonly = true
341 deps = [
342 "src/ipc:buffered_frame_deserializer_fuzzer",
Florian Mayer4a1ee942019-02-07 15:51:16 +0000343 "src/profiling/memory:shared_ring_buffer_fuzzer",
Florian Mayer00389182019-04-08 16:43:21 +0100344 "src/profiling/memory:shared_ring_buffer_write_fuzzer",
Florian Mayerc365e362018-10-24 13:21:17 +0100345 "src/profiling/memory:unwinding_fuzzer",
Primiano Tuccic1678872019-03-20 11:30:54 +0000346 "src/protozero:protozero_decoder_fuzzer",
Hector Dearman59bc02d2019-02-21 17:28:11 +0000347 "src/trace_processor:trace_processor_fuzzer",
Primiano Tucci59d6ace2018-09-26 22:24:20 +0100348 "src/traced/probes/ftrace:cpu_reader_fuzzer",
349 "test:end_to_end_shared_memory_fuzzer",
Stephen Nusko95545132019-07-09 15:00:54 +0100350 "test:producer_socket_fuzzer",
Primiano Tucci59d6ace2018-09-26 22:24:20 +0100351 ]
352 }
Primiano Tuccia1959712018-05-17 11:01:56 +0100353}
Florian Mayerb6a921f2018-10-18 18:55:23 +0100354
Ryan Savitskie65beca2019-01-29 18:29:13 +0000355# WARNING: this builds correctly only when using the generated Android.bp.
356#
357# This library gets loaded into (and executes in) arbitrary android processes.
358# Logging must be non-allocating. This is achieved by defining
359# PERFETTO_ANDROID_ASYNC_SAFE_LOG, which needs to be set for all perfetto code
360# being compiled for this library. When generating Android.bp, the |cflags|
361# entry on this target is sufficient (as all sources are flattened into a
362# single bp target). However this is not correctly reflected in the gn
363# structure (which is a tree of targets) as the dependencies would not pick
364# up the flag (and thus use the wrong logging macro).
365#
366# This is deemed acceptable as, at the time of writing, there is no interest in
367# building this library standalone.
Primiano Tucci4c5efa42018-10-23 13:15:13 +0100368if (perfetto_build_with_android) {
Florian Mayerb6a921f2018-10-18 18:55:23 +0100369 # TODO(fmayer): Investigate shared library for common pieces.
370 shared_library("heapprofd_client") {
Ryan Savitskia3da9be2019-01-30 17:45:53 +0000371 configs -= [ "//gn/standalone:android_liblog" ]
Ryan Savitskie65beca2019-01-29 18:29:13 +0000372 cflags = [ "-DPERFETTO_ANDROID_ASYNC_SAFE_LOG" ]
Florian Mayerb6a921f2018-10-18 18:55:23 +0100373 deps = [
374 "src/profiling/memory:malloc_hooks",
375 ]
376 }
Florian Mayer8e7eac42018-11-05 16:04:11 +0000377}
Florian Mayerb6a921f2018-10-18 18:55:23 +0100378
Florian Mayer8e7eac42018-11-05 16:04:11 +0000379if (should_build_heapprofd) {
Florian Mayerb6a921f2018-10-18 18:55:23 +0100380 executable("heapprofd") {
381 deps = [
382 "gn:default_deps",
Florian Mayer4afdd642018-11-13 11:11:04 +0000383 "protos/perfetto/trace:zero",
Florian Mayerb6a921f2018-10-18 18:55:23 +0100384 "src/base",
385 "src/base:unix_socket",
386 "src/profiling/memory:daemon",
387 "src/profiling/memory:wire_protocol",
Florian Mayer8e7eac42018-11-05 16:04:11 +0000388 "src/tracing:ipc",
Florian Mayerb6a921f2018-10-18 18:55:23 +0100389 ]
390 sources = [
391 "src/profiling/memory/main.cc",
392 ]
393 }
394}
Florian Mayer67be9652019-05-31 16:17:11 +0100395
Eric Seckler4d7ccd92019-06-04 15:50:16 +0100396if (perfetto_build_standalone) {
397 executable("idle_alloc") {
398 sources = [
399 "tools/idle_alloc.cc",
400 ]
401 }
Florian Mayer67be9652019-05-31 16:17:11 +0100402}