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 "../importers/proto:gen_cc_track_event_descriptor", 101 ] 102} 103 104source_set("protozero_to_json") { 105 sources = [ 106 "protozero_to_json.cc", 107 "protozero_to_json.h", 108 ] 109 deps = [ 110 ":descriptors", 111 "../../../gn:default_deps", 112 "../../../protos/perfetto/common:zero", 113 "../../../protos/perfetto/trace/track_event:zero", 114 "../../base", 115 "../../protozero", 116 "../importers/proto:gen_cc_track_event_descriptor", 117 ] 118} 119 120source_set("interned_message_view") { 121 sources = [ "interned_message_view.h" ] 122 public_deps = [ "../../../include/perfetto/trace_processor" ] 123 deps = [ 124 "../../../gn:default_deps", 125 "../../base", 126 ] 127} 128 129source_set("descriptors") { 130 sources = [ 131 "descriptors.cc", 132 "descriptors.h", 133 ] 134 deps = [ 135 ":util", 136 "../../../gn:default_deps", 137 "../../../protos/perfetto/common:zero", 138 "../../../protos/perfetto/trace_processor:zero", 139 "../../base", 140 "../../protozero", 141 "../importers/proto:gen_cc_track_event_descriptor", 142 ] 143} 144 145source_set("proto_to_args_parser") { 146 sources = [ 147 "debug_annotation_parser.cc", 148 "debug_annotation_parser.h", 149 "proto_to_args_parser.cc", 150 "proto_to_args_parser.h", 151 ] 152 deps = [ 153 "../../../gn:default_deps", 154 "../../../protos/perfetto/common:zero", 155 "../../../protos/perfetto/trace/interned_data:zero", 156 "../../../protos/perfetto/trace/profiling:zero", 157 "../../../protos/perfetto/trace/track_event:zero", 158 "../../../protos/perfetto/trace_processor:zero", 159 "../../protozero", 160 "../importers/proto:gen_cc_track_event_descriptor", 161 ] 162 163 public_deps = [ 164 ":descriptors", 165 ":interned_message_view", 166 ":util", 167 "../../base", 168 ] 169} 170 171source_set("zip_reader") { 172 sources = [ 173 "streaming_line_reader.cc", 174 "streaming_line_reader.h", 175 "zip_reader.cc", 176 "zip_reader.h", 177 ] 178 deps = [ 179 ":gzip", 180 "../../../gn:default_deps", 181 "../../base", 182 ] 183 if (enable_perfetto_zlib) { 184 deps += [ "../../../gn:zlib" ] 185 } 186} 187 188source_set("glob") { 189 sources = [ 190 "glob.cc", 191 "glob.h", 192 ] 193 deps = [ 194 "../../../gn:default_deps", 195 "../../base", 196 ] 197} 198 199source_set("regex") { 200 sources = [ "regex.h" ] 201 deps = [ 202 "../../../gn:default_deps", 203 "../../base", 204 ] 205} 206 207source_set("sql_argument") { 208 sources = [ 209 "sql_argument.cc", 210 "sql_argument.h", 211 ] 212 deps = [ 213 "../../../gn:default_deps", 214 "../../../include/perfetto/base", 215 "../../../include/perfetto/ext/base", 216 "../../../include/perfetto/trace_processor", 217 "../containers", 218 ] 219} 220 221source_set("proto_profiler") { 222 sources = [ 223 "proto_profiler.cc", 224 "proto_profiler.h", 225 ] 226 deps = [ 227 ":descriptors", 228 "../../../gn:default_deps", 229 "../../../protos/perfetto/common:zero", 230 "../../../protos/third_party/pprof:zero", 231 "../../base", 232 "../../protozero", 233 ] 234} 235 236source_set("profile_builder") { 237 sources = [ 238 "annotated_callsites.cc", 239 "annotated_callsites.h", 240 "profile_builder.cc", 241 "profile_builder.h", 242 ] 243 deps = [ 244 "../../../gn:default_deps", 245 "../../../include/perfetto/ext/trace_processor:demangle", 246 "../../../include/perfetto/protozero:protozero", 247 "../../../protos/perfetto/trace_processor:zero", 248 "../../../protos/third_party/pprof:zero", 249 "../../base", 250 "../containers", 251 "../storage", 252 "../tables", 253 "../types", 254 ] 255} 256 257source_set("file_buffer") { 258 sources = [ 259 "file_buffer.cc", 260 "file_buffer.h", 261 ] 262 deps = [ 263 "../../../gn:default_deps", 264 "../../../include/perfetto/ext/base", 265 "../../../include/perfetto/trace_processor:storage", 266 ] 267} 268 269source_set("trace_type") { 270 sources = [ 271 "trace_type.cc", 272 "trace_type.h", 273 ] 274 deps = [ 275 "../../../gn:default_deps", 276 "../../../include/perfetto/ext/base", 277 ] 278} 279 280source_set("unittests") { 281 sources = [ 282 "bump_allocator_unittest.cc", 283 "debug_annotation_parser_unittest.cc", 284 "file_buffer_unittest.cc", 285 "glob_unittest.cc", 286 "proto_profiler_unittest.cc", 287 "proto_to_args_parser_unittest.cc", 288 "protozero_to_json_unittests.cc", 289 "protozero_to_text_unittests.cc", 290 "sql_argument_unittest.cc", 291 "streaming_line_reader_unittest.cc", 292 "zip_reader_unittest.cc", 293 ] 294 testonly = true 295 deps = [ 296 ":bump_allocator", 297 ":descriptors", 298 ":file_buffer", 299 ":glob", 300 ":gzip", 301 ":proto_profiler", 302 ":proto_to_args_parser", 303 ":protozero_to_json", 304 ":protozero_to_text", 305 ":sql_argument", 306 ":zip_reader", 307 "..:gen_cc_test_messages_descriptor", 308 "../../../gn:default_deps", 309 "../../../gn:gtest_and_gmock", 310 "../../../protos/perfetto/common:zero", 311 "../../../protos/perfetto/trace:non_minimal_zero", 312 "../../../protos/perfetto/trace/interned_data:zero", 313 "../../../protos/perfetto/trace/profiling:zero", 314 "../../../protos/perfetto/trace/track_event:zero", 315 "../../protozero", 316 "../../protozero:testing_messages_zero", 317 "../importers/proto:gen_cc_track_event_descriptor", 318 "../importers/proto:minimal", 319 "../importers/proto:packet_sequence_state_generation_hdr", 320 "../storage", 321 "../types", 322 ] 323 if (perfetto_build_standalone) { 324 deps += [ 325 "../../../protos/perfetto/metrics/chrome:lite", 326 "../metrics:gen_cc_all_chrome_metrics_descriptor", 327 ] 328 } 329 if (enable_perfetto_zlib) { 330 sources += [ "gzip_utils_unittest.cc" ] 331 deps += [ "../../../gn:zlib" ] 332 } 333} 334 335if (enable_perfetto_benchmarks) { 336 source_set("benchmarks") { 337 testonly = true 338 deps = [ 339 ":glob", 340 "../../../gn:benchmark", 341 "../../../gn:default_deps", 342 "../../../gn:sqlite", 343 "../../base", 344 ] 345 sources = [ "glob_benchmark.cc" ] 346 } 347} 348