Primiano Tucci | ae2879e | 2017-09-27 11:02:09 +0900 | [diff] [blame] | 1 | # 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 Eftevaag | dd727e4 | 2017-12-05 08:49:55 -0800 | [diff] [blame] | 15 | import("gn/perfetto.gni") |
Eric Seckler | a6ba179 | 2019-01-02 12:51:00 +0000 | [diff] [blame^] | 16 | import("gn/test.gni") |
Primiano Tucci | 4c5efa4 | 2018-10-23 13:15:13 +0100 | [diff] [blame] | 17 | |
| 18 | if (perfetto_build_standalone || perfetto_build_with_android) { |
Florian Mayer | f98c9d6 | 2018-09-03 16:38:16 +0100 | [diff] [blame] | 19 | import("//gn/standalone/android.gni") |
| 20 | } else { |
| 21 | import("//build/config/android/config.gni") |
| 22 | } |
Oystein Eftevaag | dd727e4 | 2017-12-05 08:49:55 -0800 | [diff] [blame] | 23 | |
Primiano Tucci | a195971 | 2018-05-17 11:01:56 +0100 | [diff] [blame] | 24 | # For use_libfuzzer. |
Primiano Tucci | 4c5efa4 | 2018-10-23 13:15:13 +0100 | [diff] [blame] | 25 | if (perfetto_build_standalone || perfetto_build_with_android) { |
Primiano Tucci | a195971 | 2018-05-17 11:01:56 +0100 | [diff] [blame] | 26 | import("//gn/standalone/sanitizers/vars.gni") |
| 27 | } else { |
| 28 | import("//build/config/sanitizers/sanitizers.gni") |
| 29 | } |
| 30 | |
Primiano Tucci | f3837d5 | 2018-01-10 21:12:41 +0000 | [diff] [blame] | 31 | declare_args() { |
| 32 | # Only for local development. When true the binaries (perfetto, traced, ...) |
| 33 | # are monolithic and don't use a common shared library. This is mainly to |
| 34 | # avoid LD_LIBRARY_PATH dances when testing locally. |
| 35 | monolithic_binaries = false |
Florian Mayer | b64d6b1 | 2018-08-30 10:46:30 -0700 | [diff] [blame] | 36 | |
| 37 | # libunwindstack requires API level 26 or newer. |
Florian Mayer | a2fae26 | 2018-08-31 12:10:01 -0700 | [diff] [blame] | 38 | should_build_heapprofd = |
Primiano Tucci | 4c5efa4 | 2018-10-23 13:15:13 +0100 | [diff] [blame] | 39 | (perfetto_build_standalone || perfetto_build_with_android) && is_clang && |
| 40 | (is_linux || is_android) && |
| 41 | (!is_android || android_api_level >= 26 || perfetto_build_with_android) |
Primiano Tucci | f3837d5 | 2018-01-10 21:12:41 +0000 | [diff] [blame] | 42 | } |
Primiano Tucci | 4c5efa4 | 2018-10-23 13:15:13 +0100 | [diff] [blame] | 43 | assert(!monolithic_binaries || !perfetto_build_with_android) |
Primiano Tucci | f3837d5 | 2018-01-10 21:12:41 +0000 | [diff] [blame] | 44 | |
Primiano Tucci | ae2879e | 2017-09-27 11:02:09 +0900 | [diff] [blame] | 45 | group("all") { |
| 46 | testonly = true # allow to build also test targets |
| 47 | deps = [ |
Eric Seckler | a6ba179 | 2019-01-02 12:51:00 +0000 | [diff] [blame^] | 48 | ":perfetto_unittests", |
Primiano Tucci | 4f9b6d7 | 2017-12-05 20:59:16 +0000 | [diff] [blame] | 49 | "src/protozero/protoc_plugin($host_toolchain)", |
Primiano Tucci | ae2879e | 2017-09-27 11:02:09 +0900 | [diff] [blame] | 50 | ] |
Primiano Tucci | 4c5efa4 | 2018-10-23 13:15:13 +0100 | [diff] [blame] | 51 | if (perfetto_build_standalone || perfetto_build_with_android) { |
Primiano Tucci | b03ba36 | 2017-12-06 09:47:41 +0000 | [diff] [blame] | 52 | deps += [ |
Primiano Tucci | 808d6df | 2018-03-31 13:24:18 +0100 | [diff] [blame] | 53 | ":perfetto", |
Primiano Tucci | 808d6df | 2018-03-31 13:24:18 +0100 | [diff] [blame] | 54 | ":perfetto_integrationtests", |
| 55 | ":traced", |
| 56 | ":traced_probes", |
Primiano Tucci | c501080 | 2018-01-19 17:13:21 +0000 | [diff] [blame] | 57 | "protos/perfetto/config:merged_config", # For syntax-checking the proto. |
Hector Dearman | e92c674 | 2018-11-22 21:42:39 +0000 | [diff] [blame] | 58 | "protos/perfetto/trace:merged_trace", # For syntax-checking the proto. |
Oystein Eftevaag | 067fd5b | 2018-03-27 12:39:30 -0700 | [diff] [blame] | 59 | "src/ipc/protoc_plugin:ipc_plugin($host_toolchain)", |
Oystein Eftevaag | 51e06e5 | 2018-01-18 11:28:49 -0800 | [diff] [blame] | 60 | "tools:protoc_helper", |
Primiano Tucci | b03ba36 | 2017-12-06 09:47:41 +0000 | [diff] [blame] | 61 | ] |
Primiano Tucci | 4c5efa4 | 2018-10-23 13:15:13 +0100 | [diff] [blame] | 62 | if (perfetto_build_standalone) { |
Primiano Tucci | 5968caf | 2018-08-06 10:31:46 +0100 | [diff] [blame] | 63 | deps += [ |
Primiano Tucci | 4c5efa4 | 2018-10-23 13:15:13 +0100 | [diff] [blame] | 64 | ":perfetto_benchmarks", |
Primiano Tucci | 5968caf | 2018-08-06 10:31:46 +0100 | [diff] [blame] | 65 | ":trace_processor", |
Primiano Tucci | 3cd3132 | 2018-10-11 20:06:56 +0100 | [diff] [blame] | 66 | "src/tracing:consumer_api_test", |
Primiano Tucci | 4c5efa4 | 2018-10-23 13:15:13 +0100 | [diff] [blame] | 67 | "test/configs", |
| 68 | "tools/ftrace_proto_gen:ftrace_proto_gen", |
| 69 | "tools/proto_to_cpp", |
Primiano Tucci | 5968caf | 2018-08-06 10:31:46 +0100 | [diff] [blame] | 70 | "tools/trace_to_text", |
Hector Dearman | 499cd60 | 2018-11-20 13:02:31 +0000 | [diff] [blame] | 71 | "tools/trace_to_text:trace_to_text_lite_host($host_toolchain)", |
Primiano Tucci | 5968caf | 2018-08-06 10:31:46 +0100 | [diff] [blame] | 72 | ] |
Primiano Tucci | 4c5efa4 | 2018-10-23 13:15:13 +0100 | [diff] [blame] | 73 | if (is_linux || is_android) { |
| 74 | deps += [ "tools/skippy" ] |
| 75 | } |
Florian Mayer | 2e48071 | 2018-12-07 16:25:41 +0000 | [diff] [blame] | 76 | if (is_fuzzer) { |
Primiano Tucci | 4c5efa4 | 2018-10-23 13:15:13 +0100 | [diff] [blame] | 77 | deps += [ ":fuzzers" ] |
| 78 | } |
Primiano Tucci | a195971 | 2018-05-17 11:01:56 +0100 | [diff] [blame] | 79 | } |
Primiano Tucci | b03ba36 | 2017-12-06 09:47:41 +0000 | [diff] [blame] | 80 | } |
Primiano Tucci | ae2879e | 2017-09-27 11:02:09 +0900 | [diff] [blame] | 81 | } |
| 82 | |
Primiano Tucci | 3faad74 | 2018-05-16 19:30:48 +0100 | [diff] [blame] | 83 | # TODO(primiano): temporary workaround to: |
| 84 | # 1) Prevent that the UI gets build automatically when doing ninja -C out/xx . |
| 85 | # 2) Avoid breaking the chrome build, that right now depends on "all". |
| 86 | group("default") { |
| 87 | testonly = true # allow to build also test targets |
| 88 | deps = [ |
| 89 | ":all", |
| 90 | ] |
| 91 | } |
| 92 | |
Primiano Tucci | 4c5efa4 | 2018-10-23 13:15:13 +0100 | [diff] [blame] | 93 | if (perfetto_build_standalone) { |
Primiano Tucci | 3faad74 | 2018-05-16 19:30:48 +0100 | [diff] [blame] | 94 | group("ui") { |
| 95 | deps = [ |
| 96 | "ui", |
| 97 | ] |
| 98 | } |
Primiano Tucci | 5968caf | 2018-08-06 10:31:46 +0100 | [diff] [blame] | 99 | |
| 100 | # The trace processor shell executable. An interactive shell that allows to |
| 101 | # make queries on the trace using the terminal. |
| 102 | group("trace_processor") { |
| 103 | deps = [ |
| 104 | "src/trace_processor:trace_processor_shell", |
| 105 | ] |
| 106 | } |
Primiano Tucci | 3faad74 | 2018-05-16 19:30:48 +0100 | [diff] [blame] | 107 | } |
| 108 | |
Eric Seckler | a6ba179 | 2019-01-02 12:51:00 +0000 | [diff] [blame^] | 109 | test("perfetto_unittests") { |
Primiano Tucci | ae2879e | 2017-09-27 11:02:09 +0900 | [diff] [blame] | 110 | deps = [ |
Primiano Tucci | b03ba36 | 2017-12-06 09:47:41 +0000 | [diff] [blame] | 111 | "gn:default_deps", |
Florian Mayer | d8bd81b | 2018-01-25 12:49:15 +0000 | [diff] [blame] | 112 | "gn:gtest_main", |
Hector Dearman | 6cfec8a | 2018-03-14 16:54:09 +0000 | [diff] [blame] | 113 | "src/base:unittests", |
Bruce Dawson | c3e6763 | 2018-05-14 14:07:51 +0100 | [diff] [blame] | 114 | "src/protozero:unittests", |
Oystein Eftevaag | e5e84fb | 2018-06-01 17:34:56 -0700 | [diff] [blame] | 115 | "src/tracing:unittests", |
Primiano Tucci | ae2879e | 2017-09-27 11:02:09 +0900 | [diff] [blame] | 116 | ] |
Primiano Tucci | 1640ffa | 2018-05-14 18:25:33 +0100 | [diff] [blame] | 117 | |
Primiano Tucci | 4c5efa4 | 2018-10-23 13:15:13 +0100 | [diff] [blame] | 118 | if (perfetto_build_standalone || perfetto_build_with_android) { |
Oystein Eftevaag | 067fd5b | 2018-03-27 12:39:30 -0700 | [diff] [blame] | 119 | deps += [ |
| 120 | "src/ipc:unittests", |
| 121 | "src/perfetto_cmd:unittests", |
Primiano Tucci | 808d6df | 2018-03-31 13:24:18 +0100 | [diff] [blame] | 122 | "src/traced/probes:unittests", |
Oystein Eftevaag | 067fd5b | 2018-03-27 12:39:30 -0700 | [diff] [blame] | 123 | "src/traced/probes/filesystem:unittests", |
Primiano Tucci | de82dae | 2018-06-04 16:17:49 +0200 | [diff] [blame] | 124 | "src/traced/probes/ftrace:unittests", |
Primiano Tucci | 808d6df | 2018-03-31 13:24:18 +0100 | [diff] [blame] | 125 | "tools/ftrace_proto_gen:unittests", |
Oystein Eftevaag | 067fd5b | 2018-03-27 12:39:30 -0700 | [diff] [blame] | 126 | "tools/sanitizers_unittests", |
| 127 | ] |
Primiano Tucci | 931284e | 2017-12-11 09:23:53 +0000 | [diff] [blame] | 128 | } |
Florian Mayer | b64d6b1 | 2018-08-30 10:46:30 -0700 | [diff] [blame] | 129 | if (should_build_heapprofd) { |
| 130 | # Restrict to clang, as libunwindstack and its dependencies is never |
| 131 | # built using GCC in the Android tree. |
| 132 | deps += [ "src/profiling/memory:unittests" ] |
| 133 | } |
Primiano Tucci | 4c5efa4 | 2018-10-23 13:15:13 +0100 | [diff] [blame] | 134 | if (perfetto_build_standalone && !is_android) { |
Lalit Maganti | caed37e | 2018-06-01 03:03:08 +0100 | [diff] [blame] | 135 | deps += [ "src/trace_processor:unittests" ] |
| 136 | } |
Primiano Tucci | b03ba36 | 2017-12-06 09:47:41 +0000 | [diff] [blame] | 137 | } |
Oystein Eftevaag | dd727e4 | 2017-12-05 08:49:55 -0800 | [diff] [blame] | 138 | |
Primiano Tucci | 4c5efa4 | 2018-10-23 13:15:13 +0100 | [diff] [blame] | 139 | if (perfetto_build_standalone || perfetto_build_with_android) { |
Eric Seckler | a6ba179 | 2019-01-02 12:51:00 +0000 | [diff] [blame^] | 140 | test("perfetto_integrationtests") { |
Lalit Maganti | 79f2d7b | 2018-01-23 18:27:33 +0000 | [diff] [blame] | 141 | deps = [ |
| 142 | "gn:default_deps", |
Florian Mayer | d8bd81b | 2018-01-25 12:49:15 +0000 | [diff] [blame] | 143 | "gn:gtest_main", |
Primiano Tucci | de82dae | 2018-06-04 16:17:49 +0200 | [diff] [blame] | 144 | "src/traced/probes/ftrace:integrationtests", |
Lalit Maganti | 79f2d7b | 2018-01-23 18:27:33 +0000 | [diff] [blame] | 145 | "test:end_to_end_integrationtests", |
| 146 | ] |
Primiano Tucci | 4c5efa4 | 2018-10-23 13:15:13 +0100 | [diff] [blame] | 147 | if (perfetto_build_standalone && !is_android) { |
Hector Dearman | 7f71d0e | 2018-08-09 11:26:10 +0100 | [diff] [blame] | 148 | deps += [ "src/trace_processor:integrationtests" ] |
| 149 | } |
Primiano Tucci | 4c5efa4 | 2018-10-23 13:15:13 +0100 | [diff] [blame] | 150 | if (perfetto_build_with_android) { |
Lalit Maganti | 0b9a6ac | 2018-02-16 18:05:06 +0000 | [diff] [blame] | 151 | cflags = [ "-DPERFETTO_BUILD_WITH_ANDROID" ] |
| 152 | } |
Florian Mayer | 4280249 | 2018-12-13 11:00:16 +0000 | [diff] [blame] | 153 | |
| 154 | # TODO(fmayer): Fix in process daemons. |
| 155 | if (should_build_heapprofd && is_android && !start_daemons_for_testing) { |
| 156 | deps += [ "src/profiling/memory:end_to_end_tests" ] |
| 157 | } |
Lalit Maganti | 79f2d7b | 2018-01-23 18:27:33 +0000 | [diff] [blame] | 158 | } |
| 159 | |
Primiano Tucci | f3837d5 | 2018-01-10 21:12:41 +0000 | [diff] [blame] | 160 | if (monolithic_binaries) { |
Primiano Tucci | bdb2a59 | 2018-10-11 15:59:29 +0100 | [diff] [blame] | 161 | libperfetto_target_type = "source_set" |
Primiano Tucci | f3837d5 | 2018-01-10 21:12:41 +0000 | [diff] [blame] | 162 | } else { |
Primiano Tucci | bdb2a59 | 2018-10-11 15:59:29 +0100 | [diff] [blame] | 163 | libperfetto_target_type = "shared_library" |
Primiano Tucci | f3837d5 | 2018-01-10 21:12:41 +0000 | [diff] [blame] | 164 | } |
| 165 | |
Primiano Tucci | bdb2a59 | 2018-10-11 15:59:29 +0100 | [diff] [blame] | 166 | target(libperfetto_target_type, "libperfetto") { |
Primiano Tucci | 4e49c02 | 2017-12-21 18:22:44 +0100 | [diff] [blame] | 167 | deps = [ |
| 168 | "gn:default_deps", |
Primiano Tucci | 6067e73 | 2018-01-08 16:19:40 +0000 | [diff] [blame] | 169 | "src/traced/probes", |
| 170 | "src/traced/service", |
Primiano Tucci | 3cd3132 | 2018-10-11 20:06:56 +0100 | [diff] [blame] | 171 | "src/tracing:api", |
Primiano Tucci | 6067e73 | 2018-01-08 16:19:40 +0000 | [diff] [blame] | 172 | ] |
| 173 | } |
| 174 | |
Primiano Tucci | 3b72910 | 2018-01-08 18:16:36 +0000 | [diff] [blame] | 175 | # The unprivileged trace daemon that listens for Producer and Consumer |
| 176 | # connections, handles the coordination of the tracing sessions and owns the |
| 177 | # log buffers. |
Primiano Tucci | 6067e73 | 2018-01-08 16:19:40 +0000 | [diff] [blame] | 178 | executable("traced") { |
| 179 | deps = [ |
Primiano Tucci | bdb2a59 | 2018-10-11 15:59:29 +0100 | [diff] [blame] | 180 | ":libperfetto", |
Primiano Tucci | 6067e73 | 2018-01-08 16:19:40 +0000 | [diff] [blame] | 181 | "gn:default_deps", |
Primiano Tucci | c2eb510 | 2018-05-15 10:40:01 +0100 | [diff] [blame] | 182 | "include/perfetto/traced", |
Primiano Tucci | 6067e73 | 2018-01-08 16:19:40 +0000 | [diff] [blame] | 183 | ] |
| 184 | sources = [ |
| 185 | "src/traced/service/main.cc", |
| 186 | ] |
| 187 | } |
| 188 | |
Primiano Tucci | 3b72910 | 2018-01-08 18:16:36 +0000 | [diff] [blame] | 189 | # The unprivileged daemon that is allowed to access tracefs (for ftrace). |
| 190 | # Registers as a Producer on the traced daemon. |
Primiano Tucci | 6067e73 | 2018-01-08 16:19:40 +0000 | [diff] [blame] | 191 | executable("traced_probes") { |
| 192 | deps = [ |
Primiano Tucci | bdb2a59 | 2018-10-11 15:59:29 +0100 | [diff] [blame] | 193 | ":libperfetto", |
Primiano Tucci | 6067e73 | 2018-01-08 16:19:40 +0000 | [diff] [blame] | 194 | "gn:default_deps", |
Primiano Tucci | c2eb510 | 2018-05-15 10:40:01 +0100 | [diff] [blame] | 195 | "include/perfetto/traced", |
Primiano Tucci | 6067e73 | 2018-01-08 16:19:40 +0000 | [diff] [blame] | 196 | ] |
| 197 | sources = [ |
| 198 | "src/traced/probes/main.cc", |
Primiano Tucci | 4e49c02 | 2017-12-21 18:22:44 +0100 | [diff] [blame] | 199 | ] |
| 200 | } |
Primiano Tucci | 3b72910 | 2018-01-08 18:16:36 +0000 | [diff] [blame] | 201 | |
| 202 | # The command line client for Perfetto. Allows to configure / start / stop |
| 203 | # tracing, acting as a Consumer. |
| 204 | executable("perfetto") { |
| 205 | deps = [ |
Primiano Tucci | 3b72910 | 2018-01-08 18:16:36 +0000 | [diff] [blame] | 206 | "gn:default_deps", |
Hector Dearman | c443a36 | 2018-02-28 16:03:56 +0000 | [diff] [blame] | 207 | "src/perfetto_cmd", |
Primiano Tucci | 3b72910 | 2018-01-08 18:16:36 +0000 | [diff] [blame] | 208 | ] |
| 209 | sources = [ |
Hector Dearman | c443a36 | 2018-02-28 16:03:56 +0000 | [diff] [blame] | 210 | "src/perfetto_cmd/main.cc", |
Primiano Tucci | 3b72910 | 2018-01-08 18:16:36 +0000 | [diff] [blame] | 211 | ] |
Lalit Maganti | 0b9a6ac | 2018-02-16 18:05:06 +0000 | [diff] [blame] | 212 | if (is_android) { |
| 213 | deps += [ "src/base:android_task_runner" ] |
| 214 | } |
Primiano Tucci | 4c5efa4 | 2018-10-23 13:15:13 +0100 | [diff] [blame] | 215 | if (perfetto_build_with_android) { |
Primiano Tucci | 6d84853 | 2018-01-17 10:32:33 +0000 | [diff] [blame] | 216 | cflags = [ "-DPERFETTO_BUILD_WITH_ANDROID" ] |
Primiano Tucci | 6d84853 | 2018-01-17 10:32:33 +0000 | [diff] [blame] | 217 | libs = [ |
| 218 | "binder", |
| 219 | "services", |
| 220 | "utils", |
| 221 | ] |
| 222 | } |
Primiano Tucci | 3b72910 | 2018-01-08 18:16:36 +0000 | [diff] [blame] | 223 | } |
Primiano Tucci | 6aa7557 | 2018-03-21 05:33:14 -0700 | [diff] [blame] | 224 | |
Primiano Tucci | 4c5efa4 | 2018-10-23 13:15:13 +0100 | [diff] [blame] | 225 | if (perfetto_build_with_android) { |
Primiano Tucci | 21c19d8 | 2018-03-29 12:35:08 +0100 | [diff] [blame] | 226 | executable("trace_to_text") { |
| 227 | testonly = true |
| 228 | deps = [ |
| 229 | "gn:default_deps", |
Primiano Tucci | 20dc8f7 | 2018-10-23 12:28:29 +0100 | [diff] [blame] | 230 | "tools/trace_to_text:full", |
Primiano Tucci | 21c19d8 | 2018-03-29 12:35:08 +0100 | [diff] [blame] | 231 | ] |
| 232 | } |
Primiano Tucci | 21c19d8 | 2018-03-29 12:35:08 +0100 | [diff] [blame] | 233 | |
Primiano Tucci | 808d6df | 2018-03-31 13:24:18 +0100 | [diff] [blame] | 234 | # This target exports perfetto trace protos in the Android build system, |
| 235 | # allowing both host and device targets to implement custom parsers based on |
| 236 | # our protos. |
| 237 | static_library("perfetto_trace_protos") { |
| 238 | deps = [ |
| 239 | "protos/perfetto/trace:lite", |
| 240 | ] |
| 241 | } |
Primiano Tucci | 676f0cc | 2018-12-03 20:03:26 +0100 | [diff] [blame] | 242 | |
| 243 | shared_library("libperfetto_android_internal") { |
| 244 | deps = [ |
| 245 | "gn:default_deps", |
| 246 | "src/android_internal", |
| 247 | ] |
| 248 | } |
| 249 | } # if (perfetto_build_with_android) |
Primiano Tucci | 4c5efa4 | 2018-10-23 13:15:13 +0100 | [diff] [blame] | 250 | } # if (perfetto_build_standalone || perfetto_build_with_android) |
Oystein Eftevaag | a812a94 | 2018-03-23 11:52:32 -0700 | [diff] [blame] | 251 | |
Primiano Tucci | 4c5efa4 | 2018-10-23 13:15:13 +0100 | [diff] [blame] | 252 | if (perfetto_build_with_embedder) { |
| 253 | if (build_with_chromium) { |
| 254 | libperfetto_target_type = "component" |
| 255 | } else { |
| 256 | libperfetto_target_type = "source_set" |
| 257 | } |
| 258 | target(libperfetto_target_type, "libperfetto") { |
Primiano Tucci | 20b760c | 2018-01-19 12:36:12 +0000 | [diff] [blame] | 259 | public_configs = [ "gn:public_config" ] |
Oystein Eftevaag | 5e8a4eb | 2018-01-09 11:41:58 -0800 | [diff] [blame] | 260 | deps = [ |
| 261 | "src/tracing", |
| 262 | ] |
Oystein Eftevaag | a812a94 | 2018-03-23 11:52:32 -0700 | [diff] [blame] | 263 | configs -= [ "//build/config/compiler:chromium_code" ] |
| 264 | configs += [ "//build/config/compiler:no_chromium_code" ] |
| 265 | public_deps = [ |
| 266 | "include/perfetto/tracing/core", |
Oystein Eftevaag | 6fcedac | 2018-07-02 12:02:55 -0700 | [diff] [blame] | 267 | "protos/perfetto/trace:zero", |
| 268 | "protos/perfetto/trace/chrome:zero", |
Oystein Eftevaag | a812a94 | 2018-03-23 11:52:32 -0700 | [diff] [blame] | 269 | ] |
Oystein Eftevaag | 5e8a4eb | 2018-01-09 11:41:58 -0800 | [diff] [blame] | 270 | } |
Oystein Eftevaag | a812a94 | 2018-03-23 11:52:32 -0700 | [diff] [blame] | 271 | } |
Primiano Tucci | a195971 | 2018-05-17 11:01:56 +0100 | [diff] [blame] | 272 | |
Primiano Tucci | 4c5efa4 | 2018-10-23 13:15:13 +0100 | [diff] [blame] | 273 | if (perfetto_build_standalone) { |
| 274 | executable("perfetto_benchmarks") { |
| 275 | testonly = true |
| 276 | deps = [ |
| 277 | "gn:default_deps", |
| 278 | "src/traced/probes/ftrace:benchmarks", |
| 279 | "src/tracing:tracing_benchmarks", |
| 280 | "test:benchmark_main", |
| 281 | "test:end_to_end_benchmarks", |
| 282 | ] |
| 283 | } |
| 284 | |
Primiano Tucci | 59d6ace | 2018-09-26 22:24:20 +0100 | [diff] [blame] | 285 | group("fuzzers") { |
| 286 | testonly = true |
| 287 | deps = [ |
| 288 | "src/ipc:buffered_frame_deserializer_fuzzer", |
Florian Mayer | c365e36 | 2018-10-24 13:21:17 +0100 | [diff] [blame] | 289 | "src/profiling/memory:unwinding_fuzzer", |
Primiano Tucci | 59d6ace | 2018-09-26 22:24:20 +0100 | [diff] [blame] | 290 | "src/traced/probes/ftrace:cpu_reader_fuzzer", |
| 291 | "test:end_to_end_shared_memory_fuzzer", |
| 292 | ] |
| 293 | } |
Primiano Tucci | a195971 | 2018-05-17 11:01:56 +0100 | [diff] [blame] | 294 | } |
Florian Mayer | b6a921f | 2018-10-18 18:55:23 +0100 | [diff] [blame] | 295 | |
Primiano Tucci | 4c5efa4 | 2018-10-23 13:15:13 +0100 | [diff] [blame] | 296 | if (perfetto_build_with_android) { |
Florian Mayer | b6a921f | 2018-10-18 18:55:23 +0100 | [diff] [blame] | 297 | # TODO(fmayer): Investigate shared library for common pieces. |
| 298 | shared_library("heapprofd_client") { |
| 299 | deps = [ |
| 300 | "src/profiling/memory:malloc_hooks", |
| 301 | ] |
| 302 | } |
Florian Mayer | 8e7eac4 | 2018-11-05 16:04:11 +0000 | [diff] [blame] | 303 | } |
Florian Mayer | b6a921f | 2018-10-18 18:55:23 +0100 | [diff] [blame] | 304 | |
Florian Mayer | 8e7eac4 | 2018-11-05 16:04:11 +0000 | [diff] [blame] | 305 | if (should_build_heapprofd) { |
Florian Mayer | b6a921f | 2018-10-18 18:55:23 +0100 | [diff] [blame] | 306 | executable("heapprofd") { |
| 307 | deps = [ |
| 308 | "gn:default_deps", |
Florian Mayer | 4afdd64 | 2018-11-13 11:11:04 +0000 | [diff] [blame] | 309 | "protos/perfetto/trace:zero", |
Florian Mayer | b6a921f | 2018-10-18 18:55:23 +0100 | [diff] [blame] | 310 | "src/base", |
| 311 | "src/base:unix_socket", |
| 312 | "src/profiling/memory:daemon", |
| 313 | "src/profiling/memory:wire_protocol", |
Florian Mayer | 8e7eac4 | 2018-11-05 16:04:11 +0000 | [diff] [blame] | 314 | "src/tracing:ipc", |
Florian Mayer | b6a921f | 2018-10-18 18:55:23 +0100 | [diff] [blame] | 315 | ] |
| 316 | sources = [ |
| 317 | "src/profiling/memory/main.cc", |
| 318 | ] |
| 319 | } |
| 320 | } |