• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1# Copyright (C) 2019 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
15import("../../../gn/perfetto.gni")
16import("../../../gn/perfetto_cc_proto_descriptor.gni")
17import("../../../gn/test.gni")
18import("../../../gn/wasm.gni")
19
20# Prevent that this file is accidentally included in embedder builds.
21assert(enable_perfetto_trace_processor)
22assert(enable_perfetto_trace_processor_sqlite)
23
24# This source_set is used both by WASM (for the function-call-based query
25# interface) and by the :httpd module for the HTTP interface.
26source_set("rpc") {
27  sources = [
28    "query_result_serializer.cc",
29    "rpc.cc",
30    "rpc.h",
31  ]
32  deps = [
33    "..:lib",
34    "..:metatrace",
35    "../../../gn:default_deps",
36    "../../../include/perfetto/trace_processor",
37    "../../../protos/perfetto/trace_processor:zero",
38    "../../base",
39    "../../base:version",
40    "../../protozero",
41    "../../protozero:proto_ring_buffer",
42  ]
43  public_deps = [
44    "../../../include/perfetto/ext/trace_processor/rpc:query_result_serializer",
45  ]
46}
47
48if (is_perfetto_build_generator || perfetto_build_standalone) {
49  # Static library target for RPC code. Needed for BigTrace in Google3.
50  # TODO(b/278208757): remove this when we migrate to using rpc_shell.
51  static_library("trace_processor_rpc") {
52    public_deps = [ ":rpc" ]
53  }
54}
55
56source_set("stdiod") {
57  sources = [
58    "stdiod.cc",
59    "stdiod.h",
60  ]
61  deps = [
62    ":rpc",
63    "..:lib",
64    "../../../gn:default_deps",
65    "../../base",
66  ]
67}
68
69perfetto_unittest_source_set("unittests") {
70  testonly = true
71  sources = [ "query_result_serializer_unittest.cc" ]
72  deps = [
73    ":rpc",
74    "..:lib",
75    "../../../gn:default_deps",
76    "../../../gn:gtest_and_gmock",
77    "../../../protos/perfetto/trace_processor:zero",
78    "../../base",
79    "../../protozero",
80  ]
81}
82
83if (enable_perfetto_trace_processor_httpd) {
84  source_set("httpd") {
85    sources = [
86      "httpd.cc",
87      "httpd.h",
88    ]
89    deps = [
90      ":rpc",
91      "../../../gn:default_deps",
92      "../../../include/perfetto/trace_processor",
93      "../../../protos/perfetto/trace_processor:zero",
94      "../../base",
95      "../../base/http",
96      "../../protozero",
97    ]
98  }
99}
100
101if (enable_perfetto_ui && is_wasm) {
102  source_set("wasm_bridge") {
103    sources = [ "wasm_bridge.cc" ]
104    deps = [
105      ":rpc",
106      "../../../gn:default_deps",
107      "../../../include/perfetto/trace_processor",
108      "../../base",
109    ]
110  }
111}
112
113if (enable_perfetto_benchmarks) {
114  source_set("benchmarks") {
115    testonly = true
116    deps = [
117      ":rpc",
118      "..:lib",
119      "../../../gn:benchmark",
120      "../../../gn:default_deps",
121      "../../../gn:sqlite",
122      "../../base",
123    ]
124    sources = [ "query_result_serializer_benchmark.cc" ]
125  }
126}
127