• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1# Copyright (C) 2020 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")
17
18# Track event args parsing logic here is tentatitively planned to eventually
19# move to src/util and will be used to implement writing typed args in console
20# interceptor.
21# Do not add new dependencies to trace_processor code outside of this directory.
22#
23# TODO(altimin): Move it to src/util and use it in console interceptor.
24
25source_set("util") {
26  sources = [ "status_macros.h" ]
27  deps = [
28    "../../../gn:default_deps",
29    "../../../include/perfetto/trace_processor:basic_types",
30  ]
31}
32
33source_set("stdlib") {
34  sources = [ "sql_modules.h" ]
35}
36
37source_set("bump_allocator") {
38  sources = [
39    "bump_allocator.cc",
40    "bump_allocator.h",
41  ]
42  deps = [
43    "../../../gn:default_deps",
44    "../../base",
45  ]
46}
47
48source_set("gzip") {
49  sources = [
50    "gzip_utils.cc",
51    "gzip_utils.h",
52  ]
53  deps = [
54    "../../../gn:default_deps",
55    "../../../include/perfetto/base",
56  ]
57
58  # gzip_utils optionally depends on zlib.
59  if (enable_perfetto_zlib) {
60    deps += [ "../../../gn:zlib" ]
61  }
62}
63
64source_set("build_id") {
65  sources = [
66    "build_id.cc",
67    "build_id.h",
68  ]
69  deps = [
70    "../../../gn:default_deps",
71    "../../../include/perfetto/ext/base:base",
72  ]
73}
74
75source_set("profiler_util") {
76  sources = [
77    "profiler_util.cc",
78    "profiler_util.h",
79  ]
80  deps = [
81    "../../../gn:default_deps",
82    "../../../include/perfetto/ext/base:base",
83    "../../../protos/perfetto/trace/profiling:zero",
84    "../storage:storage",
85  ]
86}
87
88source_set("protozero_to_text") {
89  sources = [
90    "protozero_to_text.cc",
91    "protozero_to_text.h",
92  ]
93  deps = [
94    ":descriptors",
95    "../../../gn:default_deps",
96    "../../../protos/perfetto/common:zero",
97    "../../../protos/perfetto/trace/track_event:zero",
98    "../../base",
99    "../../protozero",
100  ]
101}
102
103source_set("protozero_to_json") {
104  sources = [
105    "protozero_to_json.cc",
106    "protozero_to_json.h",
107  ]
108  deps = [
109    ":descriptors",
110    "../../../gn:default_deps",
111    "../../../protos/perfetto/common:zero",
112    "../../../protos/perfetto/trace/track_event:zero",
113    "../../base",
114    "../../protozero",
115    "../importers/proto:gen_cc_track_event_descriptor",
116  ]
117}
118
119source_set("interned_message_view") {
120  sources = [ "interned_message_view.h" ]
121  public_deps = [ "../../../include/perfetto/trace_processor" ]
122  deps = [
123    "../../../gn:default_deps",
124    "../../base",
125  ]
126}
127
128source_set("descriptors") {
129  sources = [
130    "descriptors.cc",
131    "descriptors.h",
132  ]
133  deps = [
134    ":util",
135    "../../../gn:default_deps",
136    "../../../protos/perfetto/common:zero",
137    "../../../protos/perfetto/trace_processor:zero",
138    "../../base",
139    "../../protozero",
140    "../importers/proto:gen_cc_track_event_descriptor",
141  ]
142}
143
144source_set("proto_to_args_parser") {
145  sources = [
146    "debug_annotation_parser.cc",
147    "debug_annotation_parser.h",
148    "proto_to_args_parser.cc",
149    "proto_to_args_parser.h",
150  ]
151  deps = [
152    "../../../gn:default_deps",
153    "../../../protos/perfetto/common:zero",
154    "../../../protos/perfetto/trace/interned_data:zero",
155    "../../../protos/perfetto/trace/profiling:zero",
156    "../../../protos/perfetto/trace/track_event:zero",
157    "../../../protos/perfetto/trace_processor:zero",
158    "../../protozero",
159    "../importers/proto:gen_cc_track_event_descriptor",
160  ]
161
162  public_deps = [
163    ":descriptors",
164    ":interned_message_view",
165    ":util",
166    "../../base",
167  ]
168}
169
170source_set("zip_reader") {
171  sources = [
172    "streaming_line_reader.cc",
173    "streaming_line_reader.h",
174    "zip_reader.cc",
175    "zip_reader.h",
176  ]
177  deps = [
178    ":gzip",
179    ":trace_blob_view_reader",
180    ":util",
181    "../../../gn:default_deps",
182    "../../../include/perfetto/trace_processor:storage",
183    "../../base",
184  ]
185  if (enable_perfetto_zlib) {
186    deps += [ "../../../gn:zlib" ]
187  }
188}
189
190source_set("glob") {
191  sources = [
192    "glob.cc",
193    "glob.h",
194  ]
195  deps = [
196    "../../../gn:default_deps",
197    "../../base",
198  ]
199}
200
201source_set("regex") {
202  sources = [ "regex.h" ]
203  deps = [
204    "../../../gn:default_deps",
205    "../../base",
206  ]
207}
208
209source_set("sql_argument") {
210  sources = [
211    "sql_argument.cc",
212    "sql_argument.h",
213  ]
214  deps = [
215    "../../../gn:default_deps",
216    "../../../include/perfetto/base",
217    "../../../include/perfetto/ext/base",
218    "../../../include/perfetto/trace_processor",
219    "../containers",
220  ]
221}
222
223source_set("proto_profiler") {
224  sources = [
225    "proto_profiler.cc",
226    "proto_profiler.h",
227  ]
228  deps = [
229    ":descriptors",
230    "../../../gn:default_deps",
231    "../../../protos/perfetto/common:zero",
232    "../../../protos/third_party/pprof:zero",
233    "../../base",
234    "../../protozero",
235  ]
236}
237
238source_set("profile_builder") {
239  sources = [
240    "annotated_callsites.cc",
241    "annotated_callsites.h",
242    "profile_builder.cc",
243    "profile_builder.h",
244  ]
245  deps = [
246    "../../../gn:default_deps",
247    "../../../include/perfetto/ext/trace_processor:demangle",
248    "../../../include/perfetto/protozero:protozero",
249    "../../../protos/perfetto/trace_processor:zero",
250    "../../../protos/third_party/pprof:zero",
251    "../../base",
252    "../containers",
253    "../db/column",
254    "../storage",
255    "../tables",
256    "../types",
257  ]
258}
259
260source_set("trace_blob_view_reader") {
261  sources = [
262    "trace_blob_view_reader.cc",
263    "trace_blob_view_reader.h",
264  ]
265  deps = [
266    "../../../gn:default_deps",
267    "../../../include/perfetto/ext/base",
268    "../../../include/perfetto/trace_processor:storage",
269  ]
270}
271
272source_set("trace_type") {
273  sources = [
274    "trace_type.cc",
275    "trace_type.h",
276  ]
277  deps = [
278    "../../../gn:default_deps",
279    "../../../include/perfetto/ext/base",
280    "../../../protos/perfetto/trace:non_minimal_zero",
281    "../../protozero",
282    "../importers/android_bugreport:android_dumpstate_event",
283    "../importers/android_bugreport:android_log_event",
284    "../importers/perf_text:perf_text_sample_line_parser",
285  ]
286}
287
288source_set("winscope_proto_mapping") {
289  sources = [ "winscope_proto_mapping.h" ]
290  deps = [
291    "../../../gn:default_deps",
292    "../../../include/perfetto/ext/base:base",
293    "../db",
294    "../storage:storage",
295    "../tables",
296  ]
297}
298
299source_set("unittests") {
300  sources = [
301    "bump_allocator_unittest.cc",
302    "debug_annotation_parser_unittest.cc",
303    "glob_unittest.cc",
304    "proto_profiler_unittest.cc",
305    "proto_to_args_parser_unittest.cc",
306    "protozero_to_json_unittests.cc",
307    "protozero_to_text_unittests.cc",
308    "sql_argument_unittest.cc",
309    "streaming_line_reader_unittest.cc",
310    "trace_blob_view_reader_unittest.cc",
311    "zip_reader_unittest.cc",
312  ]
313  testonly = true
314  deps = [
315    ":bump_allocator",
316    ":descriptors",
317    ":glob",
318    ":gzip",
319    ":proto_profiler",
320    ":proto_to_args_parser",
321    ":protozero_to_json",
322    ":protozero_to_text",
323    ":sql_argument",
324    ":trace_blob_view_reader",
325    ":zip_reader",
326    "..:gen_cc_test_messages_descriptor",
327    "../../../gn:default_deps",
328    "../../../gn:gtest_and_gmock",
329    "../../../protos/perfetto/common:zero",
330    "../../../protos/perfetto/trace:non_minimal_zero",
331    "../../../protos/perfetto/trace/interned_data:zero",
332    "../../../protos/perfetto/trace/profiling:zero",
333    "../../../protos/perfetto/trace/track_event:zero",
334    "../../base:test_support",
335    "../../protozero",
336    "../../protozero:testing_messages_zero",
337    "../importers/proto:gen_cc_track_event_descriptor",
338    "../importers/proto:minimal",
339    "../importers/proto:packet_sequence_state_generation_hdr",
340    "../storage",
341    "../types",
342  ]
343  if (perfetto_build_standalone) {
344    deps += [
345      "../../../protos/perfetto/metrics/chrome:lite",
346      "../metrics:gen_cc_all_chrome_metrics_descriptor",
347    ]
348  }
349  if (enable_perfetto_zlib) {
350    sources += [ "gzip_utils_unittest.cc" ]
351    deps += [ "../../../gn:zlib" ]
352  }
353}
354
355if (enable_perfetto_benchmarks) {
356  source_set("benchmarks") {
357    testonly = true
358    deps = [
359      ":glob",
360      "../../../gn:benchmark",
361      "../../../gn:default_deps",
362      "../../../gn:sqlite",
363      "../../base",
364    ]
365    sources = [ "glob_benchmark.cc" ]
366  }
367}
368