# 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")

# 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("util") {
  sources = [ "status_macros.h" ]
  deps = [
    "../../../gn:default_deps",
    "../../../include/perfetto/trace_processor:basic_types",
  ]
}

source_set("stdlib") {
  sources = [ "sql_modules.h" ]
}

source_set("gzip") {
  sources = [
    "gzip_utils.cc",
    "gzip_utils.h",
  ]
  deps = [
    "../../../gn:default_deps",
    "../../../include/perfetto/base",
  ]

  # gzip_utils optionally depends on zlib.
  if (enable_perfetto_zlib) {
    deps += [ "../../../gn:zlib" ]
  }
}

source_set("stack_traces_util") {
  sources = [
    "stack_traces_util.cc",
    "stack_traces_util.h",
  ]
  deps = [
    "../../../gn:default_deps",
    "../../../include/perfetto/ext/base:base",
  ]
}

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",
    "../importers: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 = [
    ":util",
    "../../../gn:default_deps",
    "../../../protos/perfetto/common:zero",
    "../../../protos/perfetto/trace_processor:zero",
    "../../base",
    "../../protozero",
    "../importers:gen_cc_track_event_descriptor",
  ]
}

source_set("proto_to_args_parser") {
  sources = [
    "debug_annotation_parser.cc",
    "debug_annotation_parser.h",
    "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/track_event:zero",
    "../../../protos/perfetto/trace_processor:zero",
    "../../protozero",
    "../importers:gen_cc_track_event_descriptor",
  ]

  public_deps = [
    ":descriptors",
    ":interned_message_view",
    ":util",
    "../../base",
  ]
}

source_set("zip_reader") {
  sources = [
    "streaming_line_reader.cc",
    "streaming_line_reader.h",
    "zip_reader.cc",
    "zip_reader.h",
  ]
  deps = [
    ":gzip",
    "../../../gn:default_deps",
    "../../base",
  ]
  if (enable_perfetto_zlib) {
    deps += [ "../../../gn:zlib" ]
  }
}

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("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:protozero",
    "../../../protos/third_party/pprof:zero",
    "../../base",
    "../containers",
    "../storage",
    "../tables",
    "../types",
  ]
}

source_set("unittests") {
  sources = [
    "debug_annotation_parser_unittest.cc",
    "glob_unittest.cc",
    "proto_profiler_unittest.cc",
    "proto_to_args_parser_unittest.cc",
    "protozero_to_text_unittests.cc",
    "sql_argument_unittest.cc",
    "streaming_line_reader_unittest.cc",
    "zip_reader_unittest.cc",
  ]
  testonly = true
  deps = [
    ":descriptors",
    ":glob",
    ":gzip",
    ":proto_profiler",
    ":proto_to_args_parser",
    ":protozero_to_text",
    ":sql_argument",
    ":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/track_event:zero",
    "../../protozero",
    "../../protozero:testing_messages_zero",
    "../importers:gen_cc_track_event_descriptor",
  ]
  if (enable_perfetto_zlib) {
    sources += [ "gzip_utils_unittest.cc" ]
    deps += [ "../../../gn:zlib" ]
  }
}

if (enable_perfetto_benchmarks) {
  source_set("benchmarks") {
    testonly = true
    deps = [
      ":glob",
      "../../../gn:benchmark",
      "../../../gn:default_deps",
      "../../../gn:sqlite",
      "../../base",
    ]
    sources = [ "glob_benchmark.cc" ]
  }
}
