| # Copyright (C) 2020 The Android Open Source Project | |
| # | |
| # Licensed under the Apache License, Version 2.0 (the "License"); | |
| # you may not use this file except in compliance with the License. | |
| # You may obtain a copy of the License at | |
| # | |
| # http://www.apache.org/licenses/LICENSE-2.0 | |
| # | |
| # Unless required by applicable law or agreed to in writing, software | |
| # distributed under the License is distributed on an "AS IS" BASIS, | |
| # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | |
| # See the License for the specific language governing permissions and | |
| # limitations under the License. | |
| import("../../../gn/perfetto.gni") | |
| import("../../../gn/perfetto_cc_proto_descriptor.gni") | |
| import("../../../gn/perfetto_component.gni") | |
| # Track event args parsing logic here is tentatitively planned to eventually | |
| # move to src/util and will be used to implement writing typed args in console | |
| # interceptor. | |
| # Do not add new dependencies to trace_processor code outside of this directory. | |
| # | |
| # TODO(altimin): Move it to src/util and use it in console interceptor. | |
| source_set("stdlib") { | |
| sources = [ "sql_modules.h" ] | |
| } | |
| source_set("sql_bundle") { | |
| sources = [ "sql_bundle.h" ] | |
| deps = [ | |
| "../../../gn:default_deps", | |
| "../../../include/perfetto/base", | |
| ] | |
| } | |
| if (enable_perfetto_trace_processor_sqlite) { | |
| source_set("sql_module_doc_parser") { | |
| sources = [ | |
| "sql_module_doc_parser.cc", | |
| "sql_module_doc_parser.h", | |
| ] | |
| deps = [ | |
| "../../../gn:default_deps", | |
| "../../base", | |
| "../../perfetto_sql/syntaqlite", | |
| ] | |
| } | |
| } | |
| source_set("bump_allocator") { | |
| sources = [ | |
| "bump_allocator.cc", | |
| "bump_allocator.h", | |
| ] | |
| deps = [ | |
| "../../../gn:default_deps", | |
| "../../base", | |
| ] | |
| } | |
| # Codec-agnostic streaming decompressor (gzip, zstd). Consumers use | |
| # CreateDecompressor() / DecompressToBuffer() from decompressor.h; the concrete | |
| # codec headers are an implementation detail (zip_reader uses GzipDecompressor | |
| # directly for raw-deflate zip entries). | |
| source_set("decompressor") { | |
| sources = [ | |
| "decompressor.cc", | |
| "decompressor.h", | |
| "gzip_decompressor.cc", | |
| "gzip_decompressor.h", | |
| "zstd_decompressor.cc", | |
| "zstd_decompressor.h", | |
| ] | |
| deps = [ | |
| "../../../gn:default_deps", | |
| "../../../include/perfetto/base", | |
| ] | |
| if (enable_perfetto_zlib) { | |
| deps += [ "../../../gn:zlib" ] | |
| } | |
| if (enable_perfetto_zstd) { | |
| deps += [ "../../../gn:zstd" ] | |
| } | |
| } | |
| # One-shot compressors, the counterpart of ":decompressor". Kept separate so the | |
| # decompressor target stays decompression-only. | |
| source_set("compressor") { | |
| sources = [ | |
| "zstd_compressor.cc", | |
| "zstd_compressor.h", | |
| ] | |
| deps = [ | |
| "../../../gn:default_deps", | |
| "../../../include/perfetto/base", | |
| "../../../include/perfetto/ext/base", | |
| ] | |
| if (enable_perfetto_zstd) { | |
| deps += [ "../../../gn:zstd" ] | |
| } | |
| } | |
| perfetto_component("build_id") { | |
| sources = [ | |
| "build_id.cc", | |
| "build_id.h", | |
| ] | |
| deps = [ | |
| "../../../gn:default_deps", | |
| "../../../include/perfetto/ext/base", | |
| ] | |
| } | |
| source_set("blob") { | |
| sources = [ "trace_blob.cc" ] | |
| deps = [ | |
| "../../../gn:default_deps", | |
| "../../../include/perfetto/ext/base", | |
| "../../../include/perfetto/trace_processor:basic_types", | |
| "../../../include/perfetto/trace_processor:util", | |
| "../../../protos/perfetto/common:zero", | |
| ] | |
| } | |
| source_set("clock") { | |
| sources = [ | |
| "clock_synchronizer.cc", | |
| "clock_synchronizer.h", | |
| ] | |
| deps = [ | |
| "../../../gn:default_deps", | |
| "../../../include/perfetto/ext/base", | |
| "../../../protos/perfetto/common:zero", | |
| ] | |
| } | |
| source_set("profiler_util") { | |
| sources = [ | |
| "profiler_util.cc", | |
| "profiler_util.h", | |
| ] | |
| deps = [ | |
| "../../../gn:default_deps", | |
| "../../../include/perfetto/ext/base", | |
| "../../../protos/perfetto/trace/profiling:zero", | |
| "../importers/common:stats_tracker", | |
| "../storage", | |
| ] | |
| } | |
| source_set("protozero_to_text") { | |
| sources = [ | |
| "protozero_to_text.cc", | |
| "protozero_to_text.h", | |
| ] | |
| deps = [ | |
| ":descriptors", | |
| "../../../gn:default_deps", | |
| "../../../protos/perfetto/common:zero", | |
| "../../../protos/perfetto/trace/track_event:zero", | |
| "../../base", | |
| "../../protozero", | |
| ] | |
| } | |
| source_set("protozero_to_json") { | |
| sources = [ | |
| "protozero_to_json.cc", | |
| "protozero_to_json.h", | |
| ] | |
| deps = [ | |
| ":descriptors", | |
| ":json_serializer", | |
| "../../../gn:default_deps", | |
| "../../../protos/perfetto/common:zero", | |
| "../../../protos/perfetto/trace/track_event:zero", | |
| "../../base", | |
| "../../protozero", | |
| "../importers/proto:gen_cc_track_event_descriptor", | |
| ] | |
| } | |
| source_set("interned_message_view") { | |
| sources = [ "interned_message_view.h" ] | |
| public_deps = [ "../../../include/perfetto/trace_processor" ] | |
| deps = [ | |
| "../../../gn:default_deps", | |
| "../../base", | |
| ] | |
| } | |
| source_set("descriptors") { | |
| sources = [ | |
| "descriptors.cc", | |
| "descriptors.h", | |
| ] | |
| deps = [ | |
| "../../../gn:default_deps", | |
| "../../../protos/perfetto/common:zero", | |
| "../../../protos/perfetto/trace_processor:zero", | |
| "../../base", | |
| "../../protozero", | |
| "../importers/proto:gen_cc_track_event_descriptor", | |
| ] | |
| } | |
| source_set("proto_to_args_parser") { | |
| sources = [ | |
| "proto_to_args_parser.cc", | |
| "proto_to_args_parser.h", | |
| ] | |
| deps = [ | |
| "../../../gn:default_deps", | |
| "../../../protos/perfetto/common:zero", | |
| "../../../protos/perfetto/trace/interned_data:zero", | |
| "../../../protos/perfetto/trace/profiling:zero", | |
| "../../../protos/perfetto/trace/track_event:zero", | |
| "../../../protos/perfetto/trace_processor:zero", | |
| "../../protozero", | |
| "../importers/proto:gen_cc_track_event_descriptor", | |
| ] | |
| public_deps = [ | |
| ":descriptors", | |
| ":interned_message_view", | |
| "../../base", | |
| "../containers", | |
| ] | |
| } | |
| source_set("zip_reader") { | |
| sources = [ | |
| "streaming_line_reader.cc", | |
| "streaming_line_reader.h", | |
| "zip_reader.cc", | |
| "zip_reader.h", | |
| ] | |
| deps = [ | |
| ":decompressor", | |
| ":trace_blob_view_reader", | |
| "../../../gn:default_deps", | |
| "../../../include/perfetto/trace_processor:storage", | |
| "../../base", | |
| ] | |
| if (enable_perfetto_zlib) { | |
| deps += [ "../../../gn:zlib" ] | |
| } | |
| } | |
| perfetto_component("cold_sort") { | |
| sources = [ | |
| "cold_sort.cc", | |
| "cold_sort.h", | |
| ] | |
| deps = [ | |
| "../../../gn:default_deps", | |
| "../../../include/perfetto/base", | |
| "../../../include/perfetto/ext/base", | |
| "../../base", | |
| ] | |
| } | |
| source_set("galloping_search") { | |
| sources = [ "galloping_search.h" ] | |
| deps = [ "../../../gn:default_deps" ] | |
| } | |
| source_set("concurrency_stress_test_util") { | |
| testonly = true | |
| sources = [ "concurrency_stress_test_util.h" ] | |
| deps = [ | |
| "../../../gn:default_deps", | |
| "../../../include/perfetto/base", | |
| ] | |
| } | |
| source_set("glob") { | |
| sources = [ | |
| "glob.cc", | |
| "glob.h", | |
| ] | |
| deps = [ | |
| "../../../gn:default_deps", | |
| "../../base", | |
| ] | |
| } | |
| source_set("sql_argument") { | |
| sources = [ | |
| "sql_argument.cc", | |
| "sql_argument.h", | |
| ] | |
| deps = [ | |
| "../../../gn:default_deps", | |
| "../../../include/perfetto/base", | |
| "../../../include/perfetto/ext/base", | |
| "../../../include/perfetto/trace_processor", | |
| "../containers", | |
| ] | |
| } | |
| source_set("owned_sql_value") { | |
| sources = [ "owned_sql_value.h" ] | |
| deps = [ | |
| "../../../gn:default_deps", | |
| "../../../include/perfetto/base", | |
| "../../../include/perfetto/ext/base", | |
| "../../../include/perfetto/trace_processor:basic_types", | |
| ] | |
| } | |
| source_set("args_utils") { | |
| sources = [ | |
| "args_utils.cc", | |
| "args_utils.h", | |
| ] | |
| deps = [ | |
| "../../../gn:default_deps", | |
| "../../../include/perfetto/base", | |
| "../../../include/perfetto/ext/base", | |
| "../containers", | |
| "../core/dataframe", | |
| "../storage", | |
| "../tables", | |
| "../types", | |
| ] | |
| } | |
| # Header only part of the json_parser (just json_parser.h). The old | |
| # json_utils.cc/h files have been removed and replaced by json_args.cc/h. | |
| source_set("json_parser") { | |
| sources = [ "json_parser.h" ] | |
| deps = [ | |
| "../../../gn:default_deps", | |
| "../../../include/perfetto/base", | |
| "../../../include/perfetto/ext/base", | |
| ] | |
| } | |
| # JSON streaming parser. | |
| perfetto_component("simple_json_parser") { | |
| sources = [ | |
| "simple_json_parser.cc", | |
| "simple_json_parser.h", | |
| ] | |
| public_deps = [ ":json_parser" ] | |
| deps = [ | |
| "../../../gn:default_deps", | |
| "../../../include/perfetto/base", | |
| "../../../include/perfetto/ext/base", | |
| ] | |
| } | |
| # JSON args flattening using the streaming parser. | |
| source_set("json_args") { | |
| sources = [ | |
| "json_args.cc", | |
| "json_args.h", | |
| ] | |
| deps = [ | |
| ":json_parser", | |
| ":simple_json_parser", | |
| "../../../gn:default_deps", | |
| "../../../include/perfetto/base", | |
| "../../../include/perfetto/ext/base", | |
| "../containers", | |
| "../importers/common", | |
| "../storage", | |
| "../types", | |
| ] | |
| } | |
| source_set("json_serializer") { | |
| sources = [ "json_serializer.h" ] | |
| deps = [ | |
| "../../../gn:default_deps", | |
| "../../../include/perfetto/ext/base", | |
| ] | |
| } | |
| source_set("simple_json_serializer") { | |
| sources = [ | |
| "simple_json_serializer.cc", | |
| "simple_json_serializer.h", | |
| ] | |
| deps = [ | |
| ":json_serializer", | |
| "../../../gn:default_deps", | |
| ] | |
| } | |
| source_set("json_value") { | |
| sources = [ | |
| "json_value.cc", | |
| "json_value.h", | |
| ] | |
| deps = [ | |
| ":json_parser", | |
| ":json_serializer", | |
| "../../../gn:default_deps", | |
| "../../../include/perfetto/base", | |
| "../../../include/perfetto/ext/base", | |
| ] | |
| } | |
| source_set("proto_profiler") { | |
| sources = [ | |
| "proto_profiler.cc", | |
| "proto_profiler.h", | |
| ] | |
| deps = [ | |
| ":descriptors", | |
| "../../../gn:default_deps", | |
| "../../../protos/perfetto/common:zero", | |
| "../../../protos/third_party/pprof:zero", | |
| "../../base", | |
| "../../protozero", | |
| ] | |
| } | |
| source_set("profile_builder") { | |
| sources = [ | |
| "annotated_callsites.cc", | |
| "annotated_callsites.h", | |
| "profile_builder.cc", | |
| "profile_builder.h", | |
| ] | |
| deps = [ | |
| "../../../gn:default_deps", | |
| "../../../include/perfetto/ext/trace_processor:demangle", | |
| "../../../include/perfetto/protozero", | |
| "../../../protos/perfetto/trace_processor:zero", | |
| "../../../protos/third_party/pprof:zero", | |
| "../../base", | |
| "../containers", | |
| "../core/dataframe", | |
| "../storage", | |
| "../tables", | |
| "../types", | |
| ] | |
| } | |
| source_set("trace_blob_view_reader") { | |
| sources = [ | |
| "trace_blob_view_reader.cc", | |
| "trace_blob_view_reader.h", | |
| ] | |
| deps = [ | |
| "../../../gn:default_deps", | |
| "../../../include/perfetto/ext/base", | |
| "../../../include/perfetto/trace_processor:storage", | |
| ] | |
| } | |
| source_set("trace_type") { | |
| sources = [ | |
| "trace_type.cc", | |
| "trace_type.h", | |
| ] | |
| deps = [ | |
| ":cold_sort", | |
| ":decompressor", | |
| "../../../gn:default_deps", | |
| "../../../include/perfetto/ext/base", | |
| "../../../protos/perfetto/trace:non_minimal_zero", | |
| "../../protozero", | |
| ] | |
| } | |
| source_set("tar_writer") { | |
| sources = [ | |
| "tar_writer.cc", | |
| "tar_writer.h", | |
| ] | |
| deps = [ | |
| "../../../gn:default_deps", | |
| "../../../include/perfetto/base", | |
| "../../../include/perfetto/ext/base", | |
| ] | |
| } | |
| source_set("flatbuffer_writer") { | |
| sources = [ | |
| "flatbuffer_writer.cc", | |
| "flatbuffer_writer.h", | |
| ] | |
| deps = [ | |
| "../../../gn:default_deps", | |
| "../../../include/perfetto/base", | |
| ] | |
| } | |
| source_set("flatbuffer_reader") { | |
| sources = [ | |
| "flatbuffer_reader.cc", | |
| "flatbuffer_reader.h", | |
| ] | |
| deps = [ | |
| "../../../gn:default_deps", | |
| "../../../include/perfetto/base", | |
| ] | |
| } | |
| source_set("unittests") { | |
| sources = [ | |
| "bump_allocator_unittest.cc", | |
| "cold_sort_unittest.cc", | |
| "concurrency_stress_test_util_unittest.cc", | |
| "descriptors_unittest.cc", | |
| "flatbuffer_reader_unittest.cc", | |
| "galloping_search_unittest.cc", | |
| "glob_unittest.cc", | |
| "json_parser_unittest.cc", | |
| "json_serializer_unittest.cc", | |
| "json_value_unittest.cc", | |
| "proto_profiler_unittest.cc", | |
| "proto_to_args_parser_unittest.cc", | |
| "protozero_to_json_unittests.cc", | |
| "protozero_to_text_unittests.cc", | |
| "simple_json_parser_unittest.cc", | |
| "simple_json_serializer_unittest.cc", | |
| "sql_argument_unittest.cc", | |
| "streaming_line_reader_unittest.cc", | |
| "tar_writer_unittest.cc", | |
| "trace_blob_view_reader_unittest.cc", | |
| "zip_reader_unittest.cc", | |
| ] | |
| testonly = true | |
| deps = [ | |
| ":bump_allocator", | |
| ":cold_sort", | |
| ":concurrency_stress_test_util", | |
| ":decompressor", | |
| ":descriptors", | |
| ":flatbuffer_reader", | |
| ":flatbuffer_writer", | |
| ":galloping_search", | |
| ":glob", | |
| ":json_parser", | |
| ":json_serializer", | |
| ":json_value", | |
| ":proto_profiler", | |
| ":proto_to_args_parser", | |
| ":protozero_to_json", | |
| ":protozero_to_text", | |
| ":simple_json_parser", | |
| ":simple_json_serializer", | |
| ":sql_argument", | |
| ":tar_writer", | |
| ":trace_blob_view_reader", | |
| ":zip_reader", | |
| "..:gen_cc_test_messages_descriptor", | |
| "../../../gn:default_deps", | |
| "../../../gn:gtest_and_gmock", | |
| "../../../protos/perfetto/common:zero", | |
| "../../../protos/perfetto/trace:non_minimal_zero", | |
| "../../../protos/perfetto/trace/interned_data:zero", | |
| "../../../protos/perfetto/trace/profiling:zero", | |
| "../../../protos/perfetto/trace/track_event:zero", | |
| "../../base:test_support", | |
| "../../protozero", | |
| "../../protozero:testing_messages_zero", | |
| "../importers/common", | |
| "../importers/proto:gen_cc_track_event_descriptor", | |
| "../importers/proto:minimal", | |
| "../importers/proto:packet_sequence_state_generation_hdr", | |
| "../storage", | |
| "../types", | |
| ] | |
| if (perfetto_build_standalone) { | |
| deps += [ | |
| "../../../protos/perfetto/metrics/chrome:zero", | |
| "../metrics:gen_cc_all_chrome_metrics_descriptor", | |
| ] | |
| } | |
| if (enable_perfetto_zlib) { | |
| sources += [ "gzip_decompressor_unittest.cc" ] | |
| deps += [ "../../../gn:zlib" ] | |
| } | |
| if (enable_perfetto_zstd) { | |
| sources += [ "zstd_decompressor_unittest.cc" ] | |
| deps += [ "../../../gn:zstd" ] | |
| } | |
| if (enable_perfetto_trace_processor_sqlite) { | |
| sources += [ "sql_module_doc_parser_unittest.cc" ] | |
| deps += [ ":sql_module_doc_parser" ] | |
| } | |
| } | |
| if (enable_perfetto_benchmarks) { | |
| source_set("benchmarks") { | |
| testonly = true | |
| deps = [ | |
| ":descriptors", | |
| ":glob", | |
| ":proto_to_args_parser", | |
| "..:gen_cc_test_messages_descriptor", | |
| "../../../gn:benchmark", | |
| "../../../gn:default_deps", | |
| "../../../gn:sqlite", | |
| "../../base", | |
| "../../protozero", | |
| "../../protozero:testing_messages_zero", | |
| "../containers", | |
| ] | |
| sources = [ | |
| "glob_benchmark.cc", | |
| "proto_to_args_parser_benchmark.cc", | |
| ] | |
| } | |
| } |