blob: 1af5c3dbced369e24c08b65e0506f75945619611 [file] [log] [blame]
# Copyright 2018 The Fuchsia Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
import("//build/package.gni")
gperftools_src_root = "//third_party/gperftools/src/"
if (!is_debug) {
cflags_cc = [ "-DNO_FRAME_POINTER" ]
}
config("headers_config") {
include_dirs = [
"fuchsia",
gperftools_src_root,
"include",
]
}
source_set("profiler_headers") {
public_configs = [ ":headers_config" ]
}
source_set("profiler_lib") {
public_configs = [ ":headers_config" ]
gperftools_sources = [
"base/basictypes.h",
"base/commandlineflags.h",
"base/googleinit.h",
"base/logging.cc",
"base/logging.h",
"base/simple_mutex.h",
"base/spinlock.cc",
"base/spinlock_internal.cc",
"base/sysinfo.cc",
"base/sysinfo.h",
"emergency_malloc_for_stacktrace.cc",
"getpc.h",
"gperftools/profiler.h",
"gperftools/stacktrace.h",
"profile-handler.cc",
"profile-handler.h",
"profiledata.cc",
"profiler.cc",
"stacktrace.cc",
"stacktrace_libunwind-inl.h",
]
additional_sources = [
"fuchsia/profiler_log_listener.cc",
"fuchsia/profiler_log_listener.h",
"fuchsia/thread_interrupter.cc",
"fuchsia/thread_interrupter.h",
]
sources = rebase_path(gperftools_sources, ".", gperftools_src_root) +
additional_sources
deps = [
":profiler_headers",
"//sdk/lib/sys/cpp",
"//src/lib/fsl",
"//src/lib/fxl",
"//src/lib/syslog/cpp",
"//zircon/public/lib/async-loop-cpp",
"//zircon/public/lib/async-loop-default",
"//zircon/system/fidl/fuchsia-logger",
]
}
static_library("profiler_static") {
public_deps = [ ":profiler_lib" ]
}
shared_library("profiler") {
public_deps = [ ":profiler_lib" ]
}