• 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/test.gni")
17import("../../../gn/wasm.gni")
18
19# Prevent that this file is accidentally included in embedder builds.
20assert(enable_perfetto_trace_processor)
21
22# This source_set is used both by WASM (for the function-call-based query
23# interface) and by the :httpd module for the HTTP interface.
24source_set("rpc") {
25  sources = [
26    "proto_ring_buffer.cc",
27    "proto_ring_buffer.h",
28    "query_result_serializer.cc",
29    "query_result_serializer.h",
30    "rpc.cc",
31    "rpc.h",
32  ]
33  deps = [
34    "..:lib",
35    "..:metatrace",
36    "../../../gn:default_deps",
37    "../../../include/perfetto/trace_processor",
38    "../../../protos/perfetto/trace_processor:zero",
39    "../../base",
40    "../../protozero",
41  ]
42}
43
44perfetto_unittest_source_set("unittests") {
45  testonly = true
46  sources = [
47    "proto_ring_buffer_unittest.cc",
48    "query_result_serializer_unittest.cc",
49  ]
50  deps = [
51    ":rpc",
52    "..:lib",
53    "../../../gn:default_deps",
54    "../../../gn:gtest_and_gmock",
55    "../../../protos/perfetto/trace_processor:zero",
56    "../../base",
57    "../../protozero",
58  ]
59}
60
61if (enable_perfetto_trace_processor_httpd) {
62  source_set("httpd") {
63    sources = [
64      "httpd.cc",
65      "httpd.h",
66    ]
67    deps = [
68      ":rpc",
69      "../../../gn:default_deps",
70      "../../../include/perfetto/trace_processor",
71      "../../../protos/perfetto/trace_processor:zero",
72      "../../base",
73      "../../base:unix_socket",
74      "../../protozero",
75    ]
76  }
77}
78
79if (enable_perfetto_ui && is_wasm) {
80  source_set("wasm_bridge") {
81    sources = [ "wasm_bridge.cc" ]
82    deps = [
83      ":rpc",
84      "../../../gn:default_deps",
85      "../../../include/perfetto/trace_processor",
86      "../../base",
87    ]
88  }
89}
90
91if (enable_perfetto_benchmarks) {
92  source_set("benchmarks") {
93    testonly = true
94    deps = [
95      ":rpc",
96      "..:lib",
97      "../../../gn:benchmark",
98      "../../../gn:default_deps",
99      "../../../gn:sqlite",
100      "../../base",
101    ]
102    sources = [ "query_result_serializer_benchmark.cc" ]
103  }
104}
105