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 | |
Primiano Tucci | 02c1176 | 2019-08-30 00:57:59 +0200 | [diff] [blame] | 18 | # +----------------------------------------------------------------------------+ |
| 19 | # | "all" targets definition: defines targets reachable by the various configs | |
| 20 | # +----------------------------------------------------------------------------+ |
| 21 | # There is a subtletly here related with chromium and other GN embedders. |
| 22 | # When adding a dependency some_dir/:target_name, some_dir/BUILD.gn is |
| 23 | # "discovered". As a side effect any *other* target defined in some_dir/BUILD.gn |
| 24 | # (and its transitive dependencies) becomes implicitly part of the "default" |
| 25 | # target, the one invoked running ninja -C out/xxx without further args. |
| 26 | # Because of this, care must be taken to wrap dependencies to targets in other |
| 27 | # build files with if (enable_xxx) flags. Accidentally including a harmless |
| 28 | # target that happens to be defined in the same BUILD.gn that contains targets |
| 29 | # incompatible with the chromium build will cause build/roll failures. |
| 30 | |
| 31 | all_targets = [ "protos/perfetto/trace:perfetto_trace_protos" ] |
| 32 | |
| 33 | if (enable_perfetto_platform_services) { |
| 34 | all_targets += [ |
| 35 | "src/perfetto_cmd:perfetto", |
| 36 | "src/perfetto_cmd:trigger_perfetto", |
| 37 | "src/traced/service:traced", |
Primiano Tucci | 02c1176 | 2019-08-30 00:57:59 +0200 | [diff] [blame] | 38 | ] |
Primiano Tucci | a7f5a8e | 2021-01-02 17:10:50 +0100 | [diff] [blame] | 39 | if (enable_perfetto_traced_probes) { |
| 40 | all_targets += [ "src/traced/probes:traced_probes" ] |
| 41 | } |
Chinglin Yu | 4ce8390 | 2023-06-28 08:16:35 +0000 | [diff] [blame] | 42 | if (enable_perfetto_traced_relay) { |
| 43 | all_targets += [ "src/traced_relay:traced_relay" ] |
| 44 | } |
Primiano Tucci | a195971 | 2018-05-17 11:01:56 +0100 | [diff] [blame] | 45 | } |
| 46 | |
Mikhail Khokhlov | 0f7e68d | 2020-01-16 15:39:27 +0000 | [diff] [blame] | 47 | if (enable_perfetto_trace_processor && enable_perfetto_trace_processor_sqlite) { |
Primiano Tucci | 02c1176 | 2019-08-30 00:57:59 +0200 | [diff] [blame] | 48 | all_targets += [ "src/trace_processor:trace_processor_shell" ] |
Primiano Tucci | f3837d5 | 2018-01-10 21:12:41 +0000 | [diff] [blame] | 49 | } |
Primiano Tucci | 02c1176 | 2019-08-30 00:57:59 +0200 | [diff] [blame] | 50 | |
Aaron Vaage | 608d07a | 2024-03-04 09:56:04 -0800 | [diff] [blame] | 51 | if (enable_perfetto_trace_processor) { |
| 52 | all_targets += [ "src/trace_redaction:trace_redactor" ] |
| 53 | } |
| 54 | |
Hector Dearman | a9545e5 | 2022-05-17 12:23:25 +0100 | [diff] [blame] | 55 | if (enable_perfetto_traceconv) { |
| 56 | all_targets += [ "src/traceconv" ] |
Primiano Tucci | bc7a9c2 | 2022-03-15 14:09:49 +0000 | [diff] [blame] | 57 | if (is_cross_compiling) { |
| 58 | # In many cross-compilation scenarios (typically Android) developers expect |
Hector Dearman | a9545e5 | 2022-05-17 12:23:25 +0100 | [diff] [blame] | 59 | # the host version of traceconv to be available somewhere in out/, so |
Primiano Tucci | bc7a9c2 | 2022-03-15 14:09:49 +0000 | [diff] [blame] | 60 | # they can convert Android traces on their dev machine. Also |
| 61 | # tools/gen_android_bp explicitly depends on the host version for the |
Hector Dearman | a9545e5 | 2022-05-17 12:23:25 +0100 | [diff] [blame] | 62 | # cc_binary_host("traceconv") target in Android.bp. |
Primiano Tucci | bc7a9c2 | 2022-03-15 14:09:49 +0000 | [diff] [blame] | 63 | # Note that when cross-compiling the host executable will be available in |
Hector Dearman | a9545e5 | 2022-05-17 12:23:25 +0100 | [diff] [blame] | 64 | # out/xxx/gcc_like_host/traceconv NOT just out/xxx/traceconv. |
| 65 | all_targets += [ "src/traceconv($host_toolchain)" ] |
Primiano Tucci | bc7a9c2 | 2022-03-15 14:09:49 +0000 | [diff] [blame] | 66 | } |
| 67 | } |
| 68 | |
Primiano Tucci | 02c1176 | 2019-08-30 00:57:59 +0200 | [diff] [blame] | 69 | if (enable_perfetto_heapprofd) { |
Florian Mayer | ddc8ae2 | 2021-02-18 17:20:09 +0000 | [diff] [blame] | 70 | all_targets += [ "src/profiling/memory:heapprofd" ] |
| 71 | |
| 72 | if (is_linux && !is_android) { |
| 73 | all_targets += [ "src/profiling/memory:heapprofd_glibc_preload" ] |
| 74 | } |
Primiano Tucci | 02c1176 | 2019-08-30 00:57:59 +0200 | [diff] [blame] | 75 | if (perfetto_build_with_android) { |
Florian Mayer | 23f7937 | 2020-06-16 14:37:06 +0200 | [diff] [blame] | 76 | all_targets += [ |
| 77 | "src/profiling/memory:heapprofd_client", |
| 78 | "src/profiling/memory:heapprofd_client_api", |
| 79 | ] |
Primiano Tucci | 02c1176 | 2019-08-30 00:57:59 +0200 | [diff] [blame] | 80 | } |
| 81 | } |
| 82 | |
Ryan Savitski | a76b3cc | 2019-11-20 16:25:24 +0000 | [diff] [blame] | 83 | if (enable_perfetto_traced_perf) { |
| 84 | all_targets += [ "src/profiling/perf:traced_perf" ] |
| 85 | } |
| 86 | |
Primiano Tucci | 02c1176 | 2019-08-30 00:57:59 +0200 | [diff] [blame] | 87 | if (perfetto_build_with_android) { |
Primiano Tucci | 94ca9a9 | 2021-01-14 11:16:15 +0100 | [diff] [blame] | 88 | all_targets += [ "src/android_internal:libperfetto_android_internal" ] |
Primiano Tucci | 02c1176 | 2019-08-30 00:57:59 +0200 | [diff] [blame] | 89 | } |
| 90 | |
| 91 | if (enable_perfetto_tools) { |
Lalit Maganti | 6a641aa | 2022-08-26 14:36:27 +0100 | [diff] [blame] | 92 | all_targets += [ "src/tools" ] |
| 93 | |
| 94 | # Windows does not have an IPC implementation. |
| 95 | if (!is_win) { |
| 96 | all_targets += [ "src/websocket_bridge" ] |
| 97 | } |
Primiano Tucci | 02c1176 | 2019-08-30 00:57:59 +0200 | [diff] [blame] | 98 | } |
| 99 | |
| 100 | if (enable_perfetto_unittests) { |
| 101 | import("gn/perfetto_unittests.gni") |
| 102 | test("perfetto_unittests") { |
Chong Gu | 2dc2d8e | 2022-02-10 07:28:09 -0800 | [diff] [blame] | 103 | if (is_fuchsia) { |
Hector Dearman | 06a6eb6 | 2022-08-02 12:49:58 +0100 | [diff] [blame] | 104 | additional_manifest_fragments = |
Primiano Tucci | d4bbac3 | 2024-02-09 16:45:56 +0000 | [diff] [blame] | 105 | [ "//build/config/fuchsia/test/network.shard.test-cml" ] # nogncheck |
Chong Gu | 2dc2d8e | 2022-02-10 07:28:09 -0800 | [diff] [blame] | 106 | } |
Primiano Tucci | 02c1176 | 2019-08-30 00:57:59 +0200 | [diff] [blame] | 107 | deps = perfetto_unittests_targets |
| 108 | } |
| 109 | all_targets += [ ":perfetto_unittests" ] |
| 110 | } |
| 111 | |
| 112 | if (enable_perfetto_integration_tests) { |
| 113 | import("gn/perfetto_integrationtests.gni") |
| 114 | test("perfetto_integrationtests") { |
| 115 | deps = perfetto_integrationtests_targets |
| 116 | } |
| 117 | all_targets += [ |
| 118 | ":perfetto_integrationtests", |
Mohit Saini | c56f769 | 2022-01-12 10:28:01 +0000 | [diff] [blame] | 119 | "examples/sdk:sdk_example", |
Primiano Tucci | 02c1176 | 2019-08-30 00:57:59 +0200 | [diff] [blame] | 120 | "test:client_api_example", |
Primiano Tucci | ff68cac | 2020-08-06 18:13:17 +0200 | [diff] [blame] | 121 | "test/stress_test", |
Primiano Tucci | 02c1176 | 2019-08-30 00:57:59 +0200 | [diff] [blame] | 122 | ] |
Hector Dearman | c9f7008 | 2023-03-15 21:26:57 +0000 | [diff] [blame] | 123 | if (!is_win && !is_mac) { |
Daniele Di Proietto | 48c739d | 2023-06-19 13:52:42 +0000 | [diff] [blame] | 124 | all_targets += [ |
| 125 | "examples/shared_lib:example_shlib_data_source", |
| 126 | "examples/shared_lib:example_shlib_track_event", |
| 127 | ] |
Daniele Di Proietto | 3b5b77c | 2022-06-20 11:05:17 +0100 | [diff] [blame] | 128 | } |
Primiano Tucci | 02c1176 | 2019-08-30 00:57:59 +0200 | [diff] [blame] | 129 | } |
| 130 | |
Mikhail Khokhlov | 90f09f6 | 2019-12-17 12:53:51 +0000 | [diff] [blame] | 131 | if (enable_perfetto_trace_processor_json) { |
Stephen Nusko | aca7748 | 2020-01-10 15:47:06 +0000 | [diff] [blame] | 132 | test("trace_processor_minimal_smoke_tests") { |
Mikhail Khokhlov | 90f09f6 | 2019-12-17 12:53:51 +0000 | [diff] [blame] | 133 | testonly = true |
| 134 | deps = [ |
| 135 | "gn:default_deps", |
| 136 | "src/trace_processor:storage_minimal_smoke_tests", |
| 137 | ] |
| 138 | } |
| 139 | all_targets += [ ":trace_processor_minimal_smoke_tests" ] |
| 140 | } |
| 141 | |
Primiano Tucci | 02c1176 | 2019-08-30 00:57:59 +0200 | [diff] [blame] | 142 | if (enable_perfetto_benchmarks) { |
| 143 | import("gn/perfetto_benchmarks.gni") |
| 144 | executable("perfetto_benchmarks") { |
| 145 | testonly = true |
| 146 | deps = perfetto_benchmarks_targets |
| 147 | } |
| 148 | all_targets += [ ":perfetto_benchmarks" ] |
| 149 | } |
| 150 | |
| 151 | if (enable_perfetto_fuzzers) { |
| 152 | import("gn/perfetto_fuzzers.gni") |
| 153 | group("fuzzers") { |
| 154 | testonly = true |
| 155 | deps = perfetto_fuzzers_targets |
| 156 | } |
| 157 | all_targets += [ ":fuzzers" ] |
| 158 | } |
| 159 | |
| 160 | # Less interesting stuff that makes sense only in the standalone build, mainly |
| 161 | # compile-time checks for the CI. |
| 162 | if (perfetto_build_standalone) { |
| 163 | all_targets += [ |
Primiano Tucci | 02c1176 | 2019-08-30 00:57:59 +0200 | [diff] [blame] | 164 | "test/configs", |
| 165 | |
Lalit Maganti | 88e64de | 2022-11-21 18:29:57 +0000 | [diff] [blame] | 166 | # Used to evaluate the Python folder for Bazel script generation. |
| 167 | "python:trace_processor_py", |
| 168 | |
Lalit Maganti | 79d70fe | 2022-02-15 18:31:09 +0000 | [diff] [blame] | 169 | # For syntax-checking the protos. |
Lalit Maganti | 79d70fe | 2022-02-15 18:31:09 +0000 | [diff] [blame] | 170 | "protos/perfetto/trace:merged_trace_lite", |
Primiano Tucci | 02c1176 | 2019-08-30 00:57:59 +0200 | [diff] [blame] | 171 | |
Primiano Tucci | 57dd66b | 2019-10-15 23:09:04 +0100 | [diff] [blame] | 172 | # For checking all generated xxx.gen.{cc,h} files without waiting for |
| 173 | # embedders to try to use them and fail. |
Primiano Tucci | 57dd66b | 2019-10-15 23:09:04 +0100 | [diff] [blame] | 174 | "protos/perfetto/config:cpp", |
| 175 | "protos/perfetto/common:cpp", |
| 176 | |
Primiano Tucci | 02c1176 | 2019-08-30 00:57:59 +0200 | [diff] [blame] | 177 | # Used in the when updating the ftrace protos |
| 178 | "protos/perfetto/trace/ftrace:descriptor", |
Primiano Tucci | 55b4d91 | 2020-01-28 11:17:51 +0000 | [diff] [blame] | 179 | |
| 180 | # Checks that the "fake" backend implementations build. |
| 181 | "src/tracing:client_api_no_backends_compile_test", |
Primiano Tucci | 02c1176 | 2019-08-30 00:57:59 +0200 | [diff] [blame] | 182 | ] |
Primiano Tucci | 497c3ed | 2021-05-24 12:24:39 +0100 | [diff] [blame] | 183 | if (is_linux || is_android || is_mac) { |
| 184 | all_targets += [ "src/tracebox" ] |
| 185 | } |
Primiano Tucci | 02c1176 | 2019-08-30 00:57:59 +0200 | [diff] [blame] | 186 | } |
Primiano Tucci | f3837d5 | 2018-01-10 21:12:41 +0000 | [diff] [blame] | 187 | |
Primiano Tucci | fbf4a73 | 2019-12-11 00:32:15 +0000 | [diff] [blame] | 188 | # The CTS code is built (but not ran) also in standalone builds. This is to |
| 189 | # catch refactoring breakages earlier without having to wait for treehugger. |
| 190 | if (is_android && (perfetto_build_standalone || perfetto_build_with_android)) { |
| 191 | all_targets += [ "test/cts:perfetto_cts_deps" ] |
Daniele Di Proietto | 2e6c106 | 2022-09-14 13:52:19 +0000 | [diff] [blame] | 192 | all_targets += [ "test/vts:perfetto_vts_deps" ] |
Primiano Tucci | fbf4a73 | 2019-12-11 00:32:15 +0000 | [diff] [blame] | 193 | } |
| 194 | |
Primiano Tucci | ae2879e | 2017-09-27 11:02:09 +0900 | [diff] [blame] | 195 | group("all") { |
| 196 | testonly = true # allow to build also test targets |
Primiano Tucci | 02c1176 | 2019-08-30 00:57:59 +0200 | [diff] [blame] | 197 | deps = all_targets |
Primiano Tucci | ae2879e | 2017-09-27 11:02:09 +0900 | [diff] [blame] | 198 | } |
| 199 | |
Primiano Tucci | 02c1176 | 2019-08-30 00:57:59 +0200 | [diff] [blame] | 200 | # This target is used when running ninja without any argument (by default would |
| 201 | # build all reachable targets). This is mainly used to prevent the UI being |
| 202 | # built when running ninja -C out/xxx. |
| 203 | # This has effect only in standalone builds, no effect on chromium builds. |
| 204 | # Chromium's "all" target depends on our "all" target above. However chromium's |
| 205 | # "default" target depends on any target that we cause to be discovered by |
| 206 | # depending on other GN files. |
Primiano Tucci | 3faad74 | 2018-05-16 19:30:48 +0100 | [diff] [blame] | 207 | group("default") { |
Primiano Tucci | 02c1176 | 2019-08-30 00:57:59 +0200 | [diff] [blame] | 208 | testonly = true |
Primiano Tucci | 2925e9d | 2020-01-27 10:15:58 +0000 | [diff] [blame] | 209 | deps = [ ":all" ] |
Primiano Tucci | 3faad74 | 2018-05-16 19:30:48 +0100 | [diff] [blame] | 210 | } |
| 211 | |
Primiano Tucci | 02c1176 | 2019-08-30 00:57:59 +0200 | [diff] [blame] | 212 | # +----------------------------------------------------------------------------+ |
| 213 | # | Other definitions: root targets that don't belong to any other subdirectory| |
| 214 | # +----------------------------------------------------------------------------+ |
Primiano Tucci | 3faad74 | 2018-05-16 19:30:48 +0100 | [diff] [blame] | 215 | |
Primiano Tucci | 02c1176 | 2019-08-30 00:57:59 +0200 | [diff] [blame] | 216 | if (enable_perfetto_ui) { |
Mikhail Khokhlov | 8643d1c | 2019-06-04 12:02:47 +0100 | [diff] [blame] | 217 | group("ui") { |
Primiano Tucci | 2925e9d | 2020-01-27 10:15:58 +0000 | [diff] [blame] | 218 | deps = [ "ui" ] |
Mikhail Khokhlov | 8643d1c | 2019-06-04 12:02:47 +0100 | [diff] [blame] | 219 | } |
| 220 | } |
| 221 | |
Daniele Di Proietto | e5a603e | 2022-11-10 09:33:19 +0000 | [diff] [blame] | 222 | if (enable_perfetto_site) { |
| 223 | group("site") { |
| 224 | deps = [ "infra/perfetto.dev:site" ] |
| 225 | } |
| 226 | } |
| 227 | |
Primiano Tucci | 02c1176 | 2019-08-30 00:57:59 +0200 | [diff] [blame] | 228 | # In Android builds, we build the code of traced and traced_probes in one shared |
| 229 | # library that exposes one xxx_main() for each. The executables themselves are |
| 230 | # tiny shells that just invoke their own entry point into the library. |
| 231 | # This is done merely for saving binary size, because the three binaries happen |
| 232 | # to share a lot of code. |
| 233 | # When setting monolithic_binaries=true (only supported in standalone builds) |
| 234 | # it builds more conventional executables, where each binary has the full |
| 235 | # implementation and no shared library dependency. This is to make dev cycles |
| 236 | # on Android faster, avoiding all the LD_LIBRARY_PATH boilerplate. |
| 237 | # libperfetto.so is also used for stuff that is exposed to the rest of the |
| 238 | # Android tree. |
| 239 | if (enable_perfetto_platform_services) { |
Primiano Tucci | f3837d5 | 2018-01-10 21:12:41 +0000 | [diff] [blame] | 240 | if (monolithic_binaries) { |
Primiano Tucci | 098f095 | 2019-09-03 10:21:20 +0100 | [diff] [blame] | 241 | libperfetto_target_type = "static_library" |
Primiano Tucci | f3837d5 | 2018-01-10 21:12:41 +0000 | [diff] [blame] | 242 | } else { |
Primiano Tucci | bdb2a59 | 2018-10-11 15:59:29 +0100 | [diff] [blame] | 243 | libperfetto_target_type = "shared_library" |
Primiano Tucci | f3837d5 | 2018-01-10 21:12:41 +0000 | [diff] [blame] | 244 | } |
| 245 | |
Primiano Tucci | bdb2a59 | 2018-10-11 15:59:29 +0100 | [diff] [blame] | 246 | target(libperfetto_target_type, "libperfetto") { |
Primiano Tucci | 098f095 | 2019-09-03 10:21:20 +0100 | [diff] [blame] | 247 | if (libperfetto_target_type == "static_library") { |
| 248 | complete_static_lib = true |
| 249 | } |
Primiano Tucci | 4e49c02 | 2017-12-21 18:22:44 +0100 | [diff] [blame] | 250 | deps = [ |
| 251 | "gn:default_deps", |
Primiano Tucci | 6067e73 | 2018-01-08 16:19:40 +0000 | [diff] [blame] | 252 | "src/traced/service", |
| 253 | ] |
Primiano Tucci | a7f5a8e | 2021-01-02 17:10:50 +0100 | [diff] [blame] | 254 | if (enable_perfetto_traced_probes) { |
| 255 | deps += [ "src/traced/probes" ] |
| 256 | } |
Primiano Tucci | 6067e73 | 2018-01-08 16:19:40 +0000 | [diff] [blame] | 257 | } |
Primiano Tucci | 02c1176 | 2019-08-30 00:57:59 +0200 | [diff] [blame] | 258 | } |
Oystein Eftevaag | a812a94 | 2018-03-23 11:52:32 -0700 | [diff] [blame] | 259 | |
Primiano Tucci | 7e05fc1 | 2019-08-27 17:29:47 +0200 | [diff] [blame] | 260 | if (!build_with_chromium) { |
Primiano Tucci | 55b4d91 | 2020-01-28 11:17:51 +0000 | [diff] [blame] | 261 | # Client library target exposed to the Android tree. |
Primiano Tucci | 7e05fc1 | 2019-08-27 17:29:47 +0200 | [diff] [blame] | 262 | # Still in experimental stage and not API stable yet. |
| 263 | # See "libperfetto_client_example" (in Android.bp.extras) for an example |
| 264 | # on how to use the Perfetto Client API from the android tree. |
| 265 | static_library("libperfetto_client_experimental") { |
| 266 | complete_static_lib = true |
Primiano Tucci | fbf4a73 | 2019-12-11 00:32:15 +0000 | [diff] [blame] | 267 | public_deps = [ |
Primiano Tucci | 7e05fc1 | 2019-08-27 17:29:47 +0200 | [diff] [blame] | 268 | "gn:default_deps", |
Primiano Tucci | 3feec55 | 2020-02-04 11:14:42 +0000 | [diff] [blame] | 269 | "src/tracing:client_api", |
Primiano Tucci | 10c9e9e | 2021-01-08 13:04:40 +0100 | [diff] [blame] | 270 | "src/tracing:platform_impl", |
Primiano Tucci | 7e05fc1 | 2019-08-27 17:29:47 +0200 | [diff] [blame] | 271 | ] |
Primiano Tucci | 2925e9d | 2020-01-27 10:15:58 +0000 | [diff] [blame] | 272 | sources = [ "include/perfetto/tracing.h" ] |
Primiano Tucci | d4bbac3 | 2024-02-09 16:45:56 +0000 | [diff] [blame] | 273 | assert_no_deps = [ "gn:protobuf_lite" ] |
Primiano Tucci | 4c5efa4 | 2018-10-23 13:15:13 +0100 | [diff] [blame] | 274 | } |
Primiano Tucci | 7e05fc1 | 2019-08-27 17:29:47 +0200 | [diff] [blame] | 275 | } |
| 276 | |
Primiano Tucci | 02c1176 | 2019-08-30 00:57:59 +0200 | [diff] [blame] | 277 | # TODO(primiano): there seem to be two "libperfetto" and one |
| 278 | # "libperfetto_client_experimental" targets defined within this BUILD.gn file. |
| 279 | # Rationalize them with eseckler@. For now seems this one is only used from |
| 280 | # chromium and the other one only from the Android tree. |
Primiano Tucci | 7e05fc1 | 2019-08-27 17:29:47 +0200 | [diff] [blame] | 281 | if (build_with_chromium) { |
Eric Seckler | c77dc1b | 2020-01-21 13:23:35 +0000 | [diff] [blame] | 282 | component("libperfetto") { |
| 283 | public_configs = [ "gn:public_config" ] |
Oystein Eftevaag | 5e8a4eb | 2018-01-09 11:41:58 -0800 | [diff] [blame] | 284 | deps = [ |
Sylwester Blaszczyk | 0430ce8 | 2020-08-07 16:00:51 +0200 | [diff] [blame] | 285 | "src/trace_processor/importers/memory_tracker:graph_processor", |
Eric Seckler | 48d1ab5 | 2020-01-23 09:56:29 +0000 | [diff] [blame] | 286 | "src/tracing:client_api", |
Sami Kyostila | edbf626 | 2023-07-26 08:02:47 +0000 | [diff] [blame] | 287 | "src/tracing:platform_impl", |
Primiano Tucci | c4c063b | 2020-01-27 09:34:46 +0000 | [diff] [blame] | 288 | "src/tracing/core", |
Eric Seckler | c77dc1b | 2020-01-21 13:23:35 +0000 | [diff] [blame] | 289 | ] |
Primiano Tucci | d4bbac3 | 2024-02-09 16:45:56 +0000 | [diff] [blame] | 290 | configs -= [ "//build/config/compiler:chromium_code" ] # nogncheck |
| 291 | configs += [ "//build/config/compiler:no_chromium_code" ] # nogncheck |
Eric Seckler | c77dc1b | 2020-01-21 13:23:35 +0000 | [diff] [blame] | 292 | public_deps = [ |
Sylwester Blaszczyk | 0430ce8 | 2020-08-07 16:00:51 +0200 | [diff] [blame] | 293 | "include/perfetto/ext/trace_processor/importers/memory_tracker", |
Primiano Tucci | 2c5488f | 2019-06-01 03:27:28 +0100 | [diff] [blame] | 294 | "include/perfetto/ext/tracing/core", |
Eric Seckler | 48d1ab5 | 2020-01-23 09:56:29 +0000 | [diff] [blame] | 295 | "include/perfetto/tracing", |
Nicolò Mazzucato | c108446 | 2019-09-24 16:26:06 +0100 | [diff] [blame] | 296 | "protos/perfetto/common:zero", |
Oystein Eftevaag | 6fcedac | 2018-07-02 12:02:55 -0700 | [diff] [blame] | 297 | "protos/perfetto/trace:zero", |
| 298 | "protos/perfetto/trace/chrome:zero", |
Etienne Pierre-Doray | 92f6e18 | 2024-01-10 14:21:24 -0800 | [diff] [blame] | 299 | "protos/perfetto/trace/etw:zero", |
Eric Seckler | d3139b4 | 2019-02-26 13:43:59 +0000 | [diff] [blame] | 300 | "protos/perfetto/trace/interned_data:zero", |
Oystein Eftevaag | ae11620 | 2019-07-11 09:48:42 -0700 | [diff] [blame] | 301 | "protos/perfetto/trace/profiling:zero", |
Piotr Roguski | 1c96e67 | 2020-08-24 16:19:50 +0200 | [diff] [blame] | 302 | "protos/perfetto/trace/ps:zero", |
Eric Seckler | d3139b4 | 2019-02-26 13:43:59 +0000 | [diff] [blame] | 303 | "protos/perfetto/trace/track_event:zero", |
Oystein Eftevaag | a812a94 | 2018-03-23 11:52:32 -0700 | [diff] [blame] | 304 | ] |
Stephen Nusko | bfa6d63 | 2020-01-21 14:10:56 +0000 | [diff] [blame] | 305 | if (enable_perfetto_ipc) { |
Eric Seckler | 05355e0 | 2020-01-27 15:29:50 +0000 | [diff] [blame] | 306 | deps += [ |
| 307 | "src/tracing/ipc/producer", |
| 308 | "src/tracing/ipc/service", |
| 309 | ] |
Stephen Nusko | bfa6d63 | 2020-01-21 14:10:56 +0000 | [diff] [blame] | 310 | public_deps += [ "include/perfetto/ext/tracing/ipc:ipc" ] |
| 311 | } |
Dave Tapuska | f9c47a3 | 2023-01-31 14:12:40 -0500 | [diff] [blame] | 312 | if (!is_nacl) { |
Eric Seckler | 60eff7d | 2020-05-20 13:03:07 +0100 | [diff] [blame] | 313 | deps += [ |
| 314 | "src/trace_processor:export_json", |
| 315 | "src/trace_processor:storage_minimal", |
| 316 | ] |
| 317 | public_deps += [ |
| 318 | "include/perfetto/ext/trace_processor:export_json", |
| 319 | "include/perfetto/trace_processor:storage", |
| 320 | ] |
| 321 | } |
Oystein Eftevaag | 5e8a4eb | 2018-01-09 11:41:58 -0800 | [diff] [blame] | 322 | } |
Alexander Timin | a5e78bf | 2023-11-13 23:43:47 +0000 | [diff] [blame] | 323 | |
Alexander Timin | d9cf07b | 2023-11-16 00:39:10 +0000 | [diff] [blame] | 324 | # TODO(altimin): this is a temp workaround around very strange link failures |
| 325 | # on win-dbg-ng buildbot. |
| 326 | if (!is_win) { |
| 327 | libtrace_processor_target_type = "source_set" |
| 328 | } else { |
| 329 | libtrace_processor_target_type = "component" |
| 330 | } |
| 331 | |
Alexander Timin | a5e78bf | 2023-11-13 23:43:47 +0000 | [diff] [blame] | 332 | # In Chromium, we want to ensure that we don't link dynamically against sqlite |
| 333 | # (as Chromium also uses a more restricted version of sqlite which is actually |
| 334 | # shipped to the users). |
Alexander Timin | 237faee | 2023-11-15 17:14:38 +0000 | [diff] [blame] | 335 | # source_set helps us to achieve that. |
Alexander Timin | d9cf07b | 2023-11-16 00:39:10 +0000 | [diff] [blame] | 336 | target(libtrace_processor_target_type, "libtrace_processor") { |
Mikhail Khokhlov | 2bcfb35 | 2019-12-20 10:19:58 +0000 | [diff] [blame] | 337 | public_configs = [ "gn:public_config" ] |
Primiano Tucci | 2925e9d | 2020-01-27 10:15:58 +0000 | [diff] [blame] | 338 | deps = [ "src/trace_processor:lib" ] |
Primiano Tucci | d4bbac3 | 2024-02-09 16:45:56 +0000 | [diff] [blame] | 339 | configs -= [ "//build/config/compiler:chromium_code" ] # nogncheck |
| 340 | configs += [ "//build/config/compiler:no_chromium_code" ] # nogncheck |
Primiano Tucci | 2925e9d | 2020-01-27 10:15:58 +0000 | [diff] [blame] | 341 | public_deps = [ "include/perfetto/trace_processor" ] |
Eric Seckler | a7870e6 | 2019-11-01 10:11:58 +0000 | [diff] [blame] | 342 | } |
Alexander Timin | dfc4b69 | 2021-02-15 13:32:53 +0000 | [diff] [blame] | 343 | component("perfetto_test_support") { |
| 344 | testonly = true |
| 345 | public_configs = [ "gn:public_config" ] |
Primiano Tucci | d4bbac3 | 2024-02-09 16:45:56 +0000 | [diff] [blame] | 346 | configs -= [ "//build/config/compiler:chromium_code" ] # nogncheck |
| 347 | configs += [ "//build/config/compiler:no_chromium_code" ] # nogncheck |
Alexander Timin | dfc4b69 | 2021-02-15 13:32:53 +0000 | [diff] [blame] | 348 | public_deps = [ "include/perfetto/test:test_support" ] |
| 349 | deps = [ "src/tracing/test:test_support" ] |
| 350 | } |
Oystein Eftevaag | a812a94 | 2018-03-23 11:52:32 -0700 | [diff] [blame] | 351 | } |