# 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",
    ]
  }
}

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("ftrace_descriptors") {
  sources = [
    "importers/ftrace/ftrace_descriptors.cc",
    "importers/ftrace/ftrace_descriptors.h",
  ]
  deps = [
    "../../gn:default_deps",
    "../../include/perfetto/ext/base:base",
    "../protozero",
  ]
}

source_set("storage_minimal") {
  sources = [
    "forwarding_trace_parser.cc",
    "forwarding_trace_parser.h",
    "importers/common/trace_parser.cc",
    "importers/default_modules.cc",
    "importers/default_modules.h",
    "importers/ftrace/ftrace_module.cc",
    "importers/ftrace/ftrace_module.h",
    "importers/fuchsia/fuchsia_trace_utils.h",
    "importers/json/json_utils.cc",
    "importers/json/json_utils.h",
    "importers/ninja/ninja_log_parser.cc",
    "importers/ninja/ninja_log_parser.h",
    "importers/proto/android_camera_event_module.cc",
    "importers/proto/android_camera_event_module.h",
    "importers/proto/async_track_set_tracker.cc",
    "importers/proto/async_track_set_tracker.h",
    "importers/proto/chrome_string_lookup.cc",
    "importers/proto/chrome_string_lookup.h",
    "importers/proto/chrome_system_probes_module.cc",
    "importers/proto/chrome_system_probes_module.h",
    "importers/proto/chrome_system_probes_parser.cc",
    "importers/proto/chrome_system_probes_parser.h",
    "importers/proto/memory_tracker_snapshot_module.cc",
    "importers/proto/memory_tracker_snapshot_module.h",
    "importers/proto/memory_tracker_snapshot_parser.cc",
    "importers/proto/memory_tracker_snapshot_parser.h",
    "importers/proto/metadata_module.cc",
    "importers/proto/metadata_module.h",
    "importers/proto/metadata_tracker.cc",
    "importers/proto/metadata_tracker.h",
    "importers/proto/packet_sequence_state.cc",
    "importers/proto/packet_sequence_state.h",
    "importers/proto/perf_sample_tracker.cc",
    "importers/proto/perf_sample_tracker.h",
    "importers/proto/profile_module.cc",
    "importers/proto/profile_module.h",
    "importers/proto/profile_packet_utils.cc",
    "importers/proto/profile_packet_utils.h",
    "importers/proto/proto_importer_module.cc",
    "importers/proto/proto_importer_module.h",
    "importers/proto/proto_incremental_state.h",
    "importers/proto/proto_trace_parser.cc",
    "importers/proto/proto_trace_parser.h",
    "importers/proto/proto_trace_reader.cc",
    "importers/proto/proto_trace_reader.h",
    "importers/proto/proto_trace_tokenizer.cc",
    "importers/proto/proto_trace_tokenizer.h",

    # XXX: is this the correct place
    "importers/proto/statsd_module.cc",
    "importers/proto/statsd_module.h",
    "importers/proto/track_event_module.cc",
    "importers/proto/track_event_module.h",
    "importers/proto/track_event_parser.cc",
    "importers/proto/track_event_parser.h",
    "importers/proto/track_event_tokenizer.cc",
    "importers/proto/track_event_tokenizer.h",
    "importers/proto/track_event_tracker.cc",
    "importers/proto/track_event_tracker.h",
    "importers/proto/translation_table_module.cc",
    "importers/proto/translation_table_module.h",
    "importers/syscalls/syscall_tracker.h",
    "parser_types.h",
    "trace_blob.cc",
    "trace_processor_context.cc",
    "trace_processor_storage.cc",
    "trace_processor_storage_impl.cc",
    "trace_processor_storage_impl.h",
    "trace_sorter.cc",
    "trace_sorter.h",
    "trace_sorter_internal.h",
    "trace_sorter_queue.h",
    "virtual_destructors.cc",
  ]
  deps = [
    "../../gn:default_deps",
    "../base",
    "../protozero",
    "containers",
    "importers:gen_cc_chrome_track_event_descriptor",
    "importers:gen_cc_statsd_atoms_descriptor",
    "importers:gen_cc_track_event_descriptor",
    "importers/common",
    "importers/fuchsia:fuchsia_record",
    "importers/memory_tracker:graph_processor",
    "importers/proto:storage_minimal",
    "importers/systrace:systrace_line",
    "storage",
    "tables",
    "types",
    "util",
    "util:descriptors",
    "util:gzip",
    "util:interned_message_view",
    "util:proto_to_args_parser",
    "util:stack_traces_util",
    "views",
  ]
  public_deps = [
    "../../include/perfetto/trace_processor:storage",
    "../../protos/perfetto/common:zero",
    "../../protos/perfetto/config:zero",
    "../../protos/perfetto/trace:zero",
    "../../protos/perfetto/trace/android:zero",
    "../../protos/perfetto/trace/chrome:zero",
    "../../protos/perfetto/trace/ftrace:zero",
    "../../protos/perfetto/trace/interned_data:zero",
    "../../protos/perfetto/trace/perfetto:zero",
    "../../protos/perfetto/trace/power:zero",
    "../../protos/perfetto/trace/profiling:zero",
    "../../protos/perfetto/trace/ps:zero",
    "../../protos/perfetto/trace/statsd:zero",
    "../../protos/perfetto/trace/sys_stats:zero",
    "../../protos/perfetto/trace/system_info:zero",
    "../../protos/perfetto/trace/track_event:zero",
    "../../protos/perfetto/trace/translation:zero",
    "../../src/kernel_utils:syscall_table",
  ]

  # json_utils optionally depends on jsoncpp.
  if (enable_perfetto_trace_processor_json) {
    deps += [ "../../gn:jsoncpp" ]
  }
}

source_set("export_json") {
  sources = [
    "export_json.cc",
    "export_json.h",
  ]
  deps = [
    ":storage_minimal",
    "../../gn:default_deps",
    "../base",
    "storage",
    "types",
  ]
  public_deps = [ "../../include/perfetto/ext/trace_processor:export_json" ]
  if (enable_perfetto_trace_processor_json) {
    deps += [ "../../gn:jsoncpp" ]
  }
}

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",
      "../../gn:default_deps",
      "../../protos/perfetto/trace/ftrace:zero",
      "../base",
      "../protozero",
      "analysis",
      "db",
      "dynamic",
      "importers:importers_full",
      "importers/android_bugreport",
      "importers/common",
      "metrics",
      "sqlite",
      "sqlite/functions",
      "stdlib:gen_amalgamated_stdlib",
      "storage",
      "tables",
      "types",
      "util",
      "util:gzip",
      "util:protozero_to_text",
      "util:stdlib",
      "views",
    ]
    public_deps = [
      "../../gn:sqlite",  # iterator_impl.h includes sqlite3.h.
      "../../include/perfetto/trace_processor",
    ]
    if (enable_perfetto_trace_processor_json) {
      deps += [ "../../gn:jsoncpp" ]
    }
  }

  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",
      "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",
      "util/proto_to_json.cc",
      "util/proto_to_json.h",
    ]
    if (perfetto_build_standalone && !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",
      ]
    }
  }
}  # if (enable_perfetto_trace_processor_sqlite)

perfetto_unittest_source_set("unittests") {
  testonly = true
  sources = [
    "forwarding_trace_parser_unittest.cc",
    "importers/ftrace/binder_tracker_unittest.cc",
    "importers/ftrace/sched_event_tracker_unittest.cc",
    "importers/ftrace/thread_state_tracker_unittest.cc",
    "importers/fuchsia/fuchsia_parser_unittest.cc",
    "importers/fuchsia/fuchsia_trace_utils_unittest.cc",
    "importers/memory_tracker/graph_processor_unittest.cc",
    "importers/memory_tracker/graph_unittest.cc",
    "importers/memory_tracker/raw_process_memory_node_unittest.cc",
    "importers/proto/async_track_set_tracker_unittest.cc",
    "importers/proto/perf_sample_tracker_unittest.cc",
    "importers/proto/proto_trace_parser_unittest.cc",
    "importers/syscalls/syscall_tracker_unittest.cc",
    "importers/systrace/systrace_parser_unittest.cc",
    "ref_counted_unittest.cc",
    "trace_sorter_queue_unittest.cc",
    "trace_sorter_unittest.cc",
  ]
  deps = [
    ":gen_cc_test_messages_descriptor",
    "../../gn:default_deps",
    "../../gn:gtest_and_gmock",
    "../../protos/perfetto/common:cpp",
    "../../protos/perfetto/common:zero",
    "../../protos/perfetto/trace:cpp",
    "../../protos/perfetto/trace:minimal_zero",
    "../../protos/perfetto/trace:zero",
    "../../protos/perfetto/trace/android:zero",
    "../../protos/perfetto/trace/chrome:zero",
    "../../protos/perfetto/trace/ftrace:zero",
    "../../protos/perfetto/trace/gpu:zero",
    "../../protos/perfetto/trace/interned_data:zero",
    "../../protos/perfetto/trace/profiling:cpp",
    "../../protos/perfetto/trace/ps:zero",
    "../../protos/perfetto/trace/sys_stats:zero",
    "../../protos/perfetto/trace/track_event:zero",
    "../base",
    "../protozero",
    "../protozero:testing_messages_zero",
    "containers",
    "containers:unittests",
    "db:unittests",
    "dynamic",
    "importers:importers_full",
    "importers/android_bugreport:unittests",
    "importers/common",
    "importers/common:unittests",
    "importers/memory_tracker:graph_processor",
    "importers/proto:storage_minimal",
    "importers/proto:unittests",
    "rpc:unittests",
    "sqlite/functions:unittests",
    "storage",
    "tables:unittests",
    "types",
    "types:unittests",
    "util:descriptors",
    "util:unittests",
    "views",
    "views:unittests",
  ]

  if (enable_perfetto_trace_processor_sqlite) {
    deps += [
      ":lib",
      "../../gn:sqlite",
      "dynamic:unittests",
      "sqlite:unittests",
    ]
  }

  if (enable_perfetto_trace_processor_json) {
    sources += [
      "importers/json/json_trace_tokenizer_unittest.cc",
      "importers/json/json_utils_unittest.cc",
    ]
    deps += [ "../../gn:jsoncpp" ]

    if (!is_win) {
      # export_json_unittest.cc uses base::TempFile, which is not supported on
      # windows.
      sources += [ "export_json_unittest.cc" ]
      deps += [
        ":export_json",
        "../../include/perfetto/ext/trace_processor:export_json",
      ]
    }
  }
}

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) {
      deps += [ "../../gn:jsoncpp" ]
    }
  }
}

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 = [
    "../../gn:default_deps",
    "../base",
    "importers:importers_full",
  ]
}
