# Copyright (C) 2018 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/fuzzer.gni")
import("../../gn/perfetto.gni")
import("../../gn/perfetto_cc_proto_descriptor.gni")
import("../../gn/perfetto_host_executable.gni")
import("../../gn/test.gni")
import("../../gn/wasm.gni")

# Prevent that this file is accidentally included in embedder builds.
assert(enable_perfetto_trace_processor)

# The library which eases processing of Perfetto traces by exposing reading
# friendly APIs.
if (enable_perfetto_trace_processor_sqlite) {
  static_library("trace_processor") {
    complete_static_lib = true
    public_deps = [ ":lib" ]
  }
}

if (enable_perfetto_ui) {
  wasm_lib("trace_processor_wasm") {
    name = "trace_processor"
    deps = [
      ":lib",
      "../../gn:default_deps",
      "../base",
      "rpc:wasm_bridge",
    ]
  }
}

# Depended upon by Chrome to do proto -> JSON conversion of traces.
# Must be small binary size as all code here needs to be shipped in
# Chrome.
source_set("export_json") {
  sources = [
    "export_json.cc",
    "export_json.h",
  ]
  deps = [
    ":storage_minimal",
    "../../gn:default_deps",
    "../../include/perfetto/ext/trace_processor:export_json",
    "../base",
    "containers",
    "importers/json:minimal",
    "storage",
    "tables",
    "types",
    "util",
  ]
  public_deps = [ "../../include/perfetto/ext/trace_processor:export_json" ]
}

source_set("metatrace") {
  sources = [
    "tp_metatrace.cc",
    "tp_metatrace.h",
  ]
  deps = [
    "../../gn:default_deps",
    "../../include/perfetto/ext/base",
    "../../include/perfetto/trace_processor",
    "../../protos/perfetto/trace_processor:zero",
  ]
}

# In Bazel builds the ":demangle" target (below) should be a static_library so
# it gets mapped to an actual target (rather than being squashed as a filegroup)
# and can be replaced in Google internal builds via perfetto_cfg.bzl.
# Unfortunately, however, static_library targets seem to break Wasm builds on
# Mac. For this reason we just make it a source_set for all other build types.
if (is_perfetto_build_generator) {
  _demangle_target_type = "static_library"
} else {
  _demangle_target_type = "source_set"
}

target(_demangle_target_type, "demangle") {
  sources = [ "demangle.cc" ]
  deps = [
    "../../gn:default_deps",
    "../../include/perfetto/base",
    "../../include/perfetto/ext/base",
  ]
  public_deps = [ "../../include/perfetto/ext/trace_processor:demangle" ]
  if (enable_perfetto_llvm_demangle) {
    deps += [ "../../gn:llvm_demangle" ]
  }
}

source_set("storage_minimal") {
  sources = [
    "forwarding_trace_parser.cc",
    "forwarding_trace_parser.h",
    "trace_blob.cc",
    "trace_processor_context.cc",
    "trace_processor_storage.cc",
    "trace_processor_storage_impl.cc",
    "trace_processor_storage_impl.h",
    "trace_reader_registry.cc",
    "trace_reader_registry.h",
    "virtual_destructors.cc",
  ]
  deps = [
    "../../gn:default_deps",
    "../base",
    "../protozero",
    "containers",
    "importers/common",
    "importers/common:parser_types",
    "importers/ftrace:minimal",
    "importers/fuchsia:fuchsia_record",
    "importers/memory_tracker:graph_processor",
    "importers/perf:tracker",
    "importers/proto:gen_cc_android_track_event_descriptor",
    "importers/proto:gen_cc_chrome_track_event_descriptor",
    "importers/proto:gen_cc_track_event_descriptor",
    "importers/proto:minimal",
    "importers/systrace:systrace_line",
    "sorter",
    "storage",
    "tables",
    "types",
    "util:descriptors",
    "util:gzip",
    "util:proto_to_args_parser",
    "util:trace_type",
  ]
  public_deps = [ "../../include/perfetto/trace_processor:storage" ]
}

if (enable_perfetto_trace_processor_sqlite) {
  source_set("lib") {
    sources = [
      "iterator_impl.cc",
      "iterator_impl.h",
      "read_trace.cc",
      "read_trace_internal.cc",
      "read_trace_internal.h",
      "trace_processor.cc",
      "trace_processor_impl.cc",
      "trace_processor_impl.h",
    ]
    deps = [
      ":metatrace",
      ":storage_minimal",
      "../../gn:default_deps",
      "../../protos/perfetto/common:zero",
      "../../protos/perfetto/trace:zero",
      "../../protos/perfetto/trace/perfetto:zero",
      "../../protos/perfetto/trace_processor:zero",
      "../base",
      "../protozero",
      "db",
      "importers/android_bugreport",
      "importers/art_method",
      "importers/common",
      "importers/etw:full",
      "importers/ftrace:full",
      "importers/fuchsia:full",
      "importers/gzip:full",
      "importers/json:full",
      "importers/json:minimal",
      "importers/ninja",
      "importers/perf",
      "importers/perf_text",
      "importers/proto:full",
      "importers/proto:minimal",
      "importers/systrace:full",
      "importers/zip:full",
      "metrics",
      "perfetto_sql/engine",
      "perfetto_sql/intrinsics/functions",
      "perfetto_sql/intrinsics/operators",
      "perfetto_sql/intrinsics/table_functions",
      "perfetto_sql/stdlib",
      "sqlite",
      "storage",
      "tables",
      "types",
      "util",
      "util:gzip",
      "util:protozero_to_json",
      "util:protozero_to_text",
      "util:regex",
      "util:stdlib",
      "util:trace_type",
    ]
    public_deps = [
      "../../gn:sqlite",  # iterator_impl.h includes sqlite3.h.
      "../../include/perfetto/trace_processor",
    ]
    if (enable_perfetto_trace_processor_mac_instruments) {
      deps += [ "importers/instruments" ]
    }
    if (enable_perfetto_trace_processor_json) {
      deps += [ "importers/gecko" ]
    }
  }

  executable("trace_processor_shell") {
    deps = [
      ":lib",
      "../../gn:default_deps",
      "../../gn:protobuf_full",
      "../../protos/perfetto/trace_processor:zero",
      "../../src/profiling:deobfuscator",
      "../../src/profiling/symbolizer",
      "../../src/profiling/symbolizer:symbolize_database",
      "../base",
      "../base:version",
      "metrics",
      "rpc:stdiod",
      "sqlite",
      "util",
      "util:stdlib",
    ]
    if (enable_perfetto_trace_processor_linenoise) {
      deps += [ "../../gn:linenoise" ]
    }
    if (enable_perfetto_trace_processor_httpd) {
      deps += [ "rpc:httpd" ]
    }
    sources = [ "trace_processor_shell.cc" ]
    if ((perfetto_build_standalone || build_with_chromium) &&
        !is_perfetto_build_generator) {
      data_deps = [
        # The diff testing framework depends on these descriptors.
        "../../protos/perfetto/metrics:descriptor",
        "../../protos/perfetto/trace:descriptor",
        "../../protos/perfetto/trace:test_extensions_descriptor",
        "../../protos/perfetto/trace_processor:stack_descriptor",
        "../../protos/third_party/pprof:profile_descriptor",
      ]
    }
  }

  # Shell target which does not link all the extra libraryes linked by
  # trace processor shell (e.g. httpd, libprotobuf etc.). Use for binary size
  # analysis of the trace processor library.
  executable("trace_processor_minimal_shell") {
    deps = [
      ":lib",
      "../../gn:default_deps",
      "util",
    ]
    sources = [ "minimal_shell.cc" ]
  }
}  # if (enable_perfetto_trace_processor_sqlite)

perfetto_unittest_source_set("top_level_unittests") {
  testonly = true

  sources = [
    "forwarding_trace_parser_unittest.cc",
    "ref_counted_unittest.cc",
    "trace_blob_unittest.cc",
  ]
  deps = [
    ":storage_minimal",
    "../../gn:default_deps",
    "../../gn:gtest_and_gmock",
    "../../include/perfetto/trace_processor",
    "util:trace_type",
  ]

  if (enable_perfetto_trace_processor_json && !is_win) {
    # export_json_unittest.cc uses base::TempFile, which is not supported on
    # windows.
    sources += [ "export_json_unittest.cc" ]
    deps += [
      ":export_json",
      "../../gn:jsoncpp",
      "../../include/perfetto/ext/trace_processor:export_json",
      "containers",
      "importers/common",
      "importers/proto:minimal",
      "storage",
      "tables",
      "types",
    ]
  }
}

perfetto_unittest_source_set("unittests") {
  testonly = true

  # Do not add sources to this target: use top_level_unittests
  # instead. This us really just a grouping
  deps = [
    ":top_level_unittests",
    "containers:unittests",
    "db:unittests",
    "db/column:unittests",
    "importers/android_bugreport:unittests",
    "importers/common:unittests",
    "importers/ftrace:unittests",
    "importers/fuchsia:unittests",
    "importers/memory_tracker:unittests",
    "importers/perf:unittests",
    "importers/proto:unittests",
    "importers/syscalls:unittests",
    "importers/systrace:unittests",
    "rpc:unittests",
    "sorter:unittests",
    "tables:unittests",
    "types:unittests",
    "util:unittests",
  ]
  if (enable_perfetto_trace_processor_json) {
    deps += [ "importers/json:unittests" ]
  }
  if (enable_perfetto_trace_processor_sqlite) {
    deps += [
      "perfetto_sql/engine:unittests",
      "perfetto_sql/intrinsics/functions:unittests",
      "perfetto_sql/intrinsics/operators:unittests",
      "perfetto_sql/intrinsics/table_functions:unittests",
      "perfetto_sql/parser:unittests",
      "perfetto_sql/preprocessor:unittests",
      "perfetto_sql/tokenizer:unittests",
      "sqlite:unittests",
    ]
  }
}

perfetto_cc_proto_descriptor("gen_cc_test_messages_descriptor") {
  descriptor_name = "test_messages.descriptor"
  descriptor_target = "../protozero:test_messages_descriptor"
}

source_set("integrationtests") {
  testonly = true
  sources = []
  deps = []
  if (enable_perfetto_trace_processor_sqlite) {
    sources += [
      "read_trace_integrationtest.cc",
      "trace_database_integrationtest.cc",
    ]
    deps += [
      ":lib",
      "../../gn:default_deps",
      "../../gn:gtest_and_gmock",
      "../../protos/perfetto/common:zero",
      "../../protos/perfetto/trace:zero",
      "../../protos/perfetto/trace_processor:zero",
      "../base",
      "../base:test_support",
      "sqlite",
    ]
  }
}

if (enable_perfetto_trace_processor_json) {
  source_set("storage_minimal_smoke_tests") {
    testonly = true
    sources = [ "storage_minimal_smoke_test.cc" ]
    deps = [
      ":export_json",
      ":storage_minimal",
      "../../gn:default_deps",
      "../../gn:gtest_and_gmock",
      "../../gn:gtest_main",
      "../../gn:jsoncpp",
      "../base:test_support",
    ]
  }
}

perfetto_fuzzer_test("trace_processor_fuzzer") {
  testonly = true
  sources = [ "trace_parsing_fuzzer.cc" ]
  deps = [
    ":storage_minimal",
    "../../gn:default_deps",
    "../base",
  ]
}
