# Copyright (C) 2017 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/proto_library.gni")
import("../../../../gn/test.gni")

# For use_libfuzzer.
if (perfetto_root_path == "//") {
  import("//gn/standalone/sanitizers/vars.gni")
} else {
  import("//build/config/sanitizers/sanitizers.gni")
}

source_set("test_support") {
  testonly = true
  deps = [
    ":ftrace",
    "../../../../gn:default_deps",
    "../../../base:test_support",
    "../../../protozero",
  ]
  public_deps = [
    "../../../protozero",
  ]

  sources = [
    "test/cpu_reader_support.cc",
    "test/cpu_reader_support.h",
  ]
}

perfetto_unittest_source_set("unittests") {
  testonly = true
  deps = [
    ":format_parser",
    ":ftrace",
    ":test_messages_cpp",
    ":test_messages_lite",
    ":test_messages_zero",
    ":test_support",
    "../../../../gn:default_deps",
    "../../../../gn:gtest_and_gmock",
    "../../../../protos/perfetto/trace:cpp",
    "../../../../protos/perfetto/trace/ftrace:cpp",
    "../../../../protos/perfetto/trace/ftrace:zero",
    "../../../base:test_support",
    "../../../tracing/test:test_support",
  ]
  sources = [
    "cpu_reader_unittest.cc",
    "cpu_stats_parser_unittest.cc",
    "event_info_unittest.cc",
    "format_parser_unittest.cc",
    "ftrace_config_muxer_unittest.cc",
    "ftrace_config_unittest.cc",
    "ftrace_controller_unittest.cc",
    "ftrace_procfs_unittest.cc",
    "proto_translation_table_unittest.cc",
  ]
}

perfetto_proto_library("test_messages_@TYPE@") {
  proto_generators = [
    "cpp",
    "lite",
    "zero",
  ]
  sources = [
    "test/test_messages.proto",
  ]
  proto_path = perfetto_root_path
}

# These tests require access to a real ftrace implementation and must
# run with sudo.
source_set("integrationtests") {
  testonly = true
  deps = [
    ":ftrace",
    ":test_support",
    "../../../../gn:default_deps",
    "../../../../gn:gtest_and_gmock",
    "../../../base",
    "../../../tracing/core",
  ]
  sources = [
    "ftrace_procfs_integrationtest.cc",
  ]
}

source_set("ftrace") {
  public_deps = [
    "../../../../protos/perfetto/config/ftrace:cpp",
    "../../../../protos/perfetto/trace/ftrace:zero",
    "../../../tracing/core",
  ]
  deps = [
    ":format_parser",
    "..:data_source",
    "../../../../gn:default_deps",
    "../../../../include/perfetto/ext/traced",
    "../../../../protos/perfetto/trace:zero",
    "../../../android_internal:lazy_library_loader",
    "../../../base",
    "../../../protozero",
  ]
  sources = [
    "atrace_hal_wrapper.cc",
    "atrace_hal_wrapper.h",
    "atrace_wrapper.cc",
    "atrace_wrapper.h",
    "compact_sched.cc",
    "compact_sched.h",
    "cpu_reader.cc",
    "cpu_reader.h",
    "cpu_stats_parser.cc",
    "cpu_stats_parser.h",
    "event_info.cc",
    "event_info.h",
    "event_info_constants.cc",
    "event_info_constants.h",
    "ftrace_config_muxer.cc",
    "ftrace_config_muxer.h",
    "ftrace_config_utils.cc",
    "ftrace_config_utils.h",
    "ftrace_controller.cc",
    "ftrace_controller.h",
    "ftrace_data_source.cc",
    "ftrace_data_source.h",
    "ftrace_metadata.h",
    "ftrace_procfs.cc",
    "ftrace_procfs.h",
    "ftrace_stats.cc",
    "ftrace_stats.h",
    "proto_translation_table.cc",
    "proto_translation_table.h",
  ]
}

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

if (enable_perfetto_benchmarks) {
  source_set("benchmarks") {
    testonly = true
    deps = [
      ":ftrace",
      ":test_support",
      "../../../../gn:benchmark",
      "../../../../gn:default_deps",
    ]
    sources = [
      "cpu_reader_benchmark.cc",
    ]
  }
}

perfetto_fuzzer_test("cpu_reader_fuzzer") {
  testonly = true
  sources = [
    "cpu_reader_fuzzer.cc",
  ]
  deps = [
    ":ftrace",
    ":test_support",
    "../../../../gn:default_deps",
  ]
}
