# 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.

source_set("probes") {
  public_deps = [
    "../../../include/perfetto/traced",
  ]
  deps = [
    ":probes_src",
    "../../../gn:default_deps",
    "../../tracing:ipc",
  ]
  sources = [
    "probes.cc",
  ]
}

source_set("probes_src") {
  public_deps = [
    "ftrace",
  ]
  deps = [
    ":data_source",
    "../../../gn:default_deps",
    "../../../include/perfetto/traced",
    "../../../protos/perfetto/trace/ps:zero",
    "../../base",
    "../../tracing:ipc",
    "../../tracing:tracing",
    "android_log",
    "filesystem",
    "packages_list",
    "power",
    "ps",
    "sys_stats",
  ]
  sources = [
    "probes_producer.cc",
    "probes_producer.h",
  ]
}

# Base class for data sources in traced_probes.
# Needs to be a separate target to avoid cyclical deps.
source_set("data_source") {
  deps = [
    "../../../gn:default_deps",
    "../../tracing",
  ]
  sources = [
    "probes_data_source.cc",
    "probes_data_source.h",
  ]
}

source_set("unittests") {
  testonly = true
  deps = [
    ":probes_src",
    "../../../gn:default_deps",
    "../../../gn:gtest_deps",
    "../../tracing:test_support",
    "android_log:unittests",
    "filesystem:unittests",
    "packages_list:unittests",
    "ps:unittests",
    "sys_stats:unittests",
  ]
}