blob: 1996c6683287427dcb4963afecf47f4c9ca561f5 [file] [log] [blame]
# 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/perfetto.gni")
group("all") {
testonly = true # allow to build also test targets
deps = [
":perfetto",
":perfetto_tests",
":traced",
":traced_probes",
"src/ipc/protoc_plugin:ipc_plugin($host_toolchain)",
"src/protozero/protoc_plugin($host_toolchain)",
"src/tracing:consumer_cmd",
"tools/ftrace_proto_gen:ftrace_proto_gen",
"tools/proto_to_cpp",
]
if (!build_with_chromium) {
deps += [
":perfetto_benchmarks",
"src/ftrace_reader:ftrace_reader_integrationtests",
]
}
}
executable("perfetto_tests") {
testonly = true
deps = [
"gn:default_deps",
"src/base:base_unittests",
"src/ftrace_reader:ftrace_reader_unittests",
"src/ipc:perfetto_ipc_unittests",
"src/protozero:protozero_unittests",
"src/tracing:tracing_unittests",
]
if (!build_with_chromium) {
deps += [ "tools/sanitizers_unittests" ]
}
}
if (!build_with_chromium) {
executable("perfetto_benchmarks") {
testonly = true
deps = [
"gn:default_deps",
"src/tracing:tracing_benchmarks",
]
}
shared_library("libtraced_shared") {
deps = [
"gn:default_deps",
"src/traced/perfetto_cmd",
"src/traced/probes",
"src/traced/service",
]
if (build_with_android) {
cflags = [ "-DPERFETTO_BUILD_WITH_ANDROID" ]
libs = [ "utils" ]
}
}
# The unprivileged trace daemon that listens for Producer and Consumer
# connections, handles the coordination of the tracing sessions and owns the
# log buffers.
executable("traced") {
deps = [
":libtraced_shared",
"gn:default_deps",
]
sources = [
"src/traced/service/main.cc",
]
}
# The unprivileged daemon that is allowed to access tracefs (for ftrace).
# Registers as a Producer on the traced daemon.
executable("traced_probes") {
deps = [
":libtraced_shared",
"gn:default_deps",
]
sources = [
"src/traced/probes/main.cc",
]
}
# The command line client for Perfetto. Allows to configure / start / stop
# tracing, acting as a Consumer.
executable("perfetto") {
deps = [
":libtraced_shared",
"gn:default_deps",
]
sources = [
"src/traced/perfetto_cmd/main.cc",
]
}
}