| # Copyright 2017 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/components.gni") |
| import("//build/config.gni") |
| import("//third_party/cobalt/metrics_registry.gni") |
| |
| metrics_registry("metrics_registry") { |
| # This must match the ID of our Cobalt project as specified in: |
| # third_party/cobalt_config/projects.yaml |
| project_id = 1334068210 |
| namespace = "fuchsia_system_metrics" |
| generate_cc = true |
| generate_binarypb = false |
| } |
| |
| source_set("system_metrics_daemon_lib") { |
| sources = [ |
| "activity_listener.cc", |
| "activity_listener.h", |
| "cpu_stats_fetcher.h", |
| "cpu_stats_fetcher_impl.cc", |
| "cpu_stats_fetcher_impl.h", |
| "system_metrics_daemon.cc", |
| "system_metrics_daemon.h", |
| ] |
| |
| public_deps = [ |
| ":metrics_registry_cc", |
| "//sdk/fidl/fuchsia.cobalt", |
| "//sdk/fidl/fuchsia.hardware.thermal:fuchsia.hardware.thermal_c", |
| "//sdk/fidl/fuchsia.kernel:fuchsia.kernel_llcpp", |
| "//sdk/fidl/fuchsia.ui.activity", |
| "//sdk/lib/inspect/contrib/cpp:archive_reader", |
| "//sdk/lib/sys/cpp", |
| "//sdk/lib/sys/inspect/cpp", |
| "//sdk/lib/syslog/cpp", |
| "//src/cobalt/bin/utils:clock", |
| "//src/cobalt/bin/utils:status_utils", |
| "//src/lib/cobalt/cpp:cobalt_event_builder", |
| "//src/lib/fsl", |
| "//src/lib/fxl", |
| "//third_party/cobalt/src/lib/client/cpp:buckets_config", |
| "//zircon/system/ulib/abs_clock", |
| "//zircon/system/ulib/async-loop:async-loop-cpp", |
| "//zircon/system/ulib/async-loop:async-loop-default", |
| "//zircon/system/ulib/trace", |
| "//zircon/system/ulib/trace-provider", |
| "//zircon/system/ulib/zx", |
| ] |
| |
| # TODO(fxbug.dev/69585): This target uses raw zx::channel with LLCPP which is deprecated. |
| # Please migrate to typed channel APIs (fidl::ClientEnd<T>, fidl::ServerEnd<T>). |
| # See linked bug for details. |
| configs += [ "//build/cpp:fidl-llcpp-deprecated-raw-channels" ] |
| |
| # TODO(https://fxbug.dev/58162): delete the below and fix compiler warnings |
| configs += [ "//build/config:Wno-conversion" ] |
| } |
| |
| executable("system-metrics") { |
| output_name = "cobalt_system_metrics" |
| |
| sources = [ "system_metrics_main.cc" ] |
| |
| deps = [ |
| ":system_metrics_daemon_lib", |
| "//sdk/lib/sys/cpp", |
| ] |
| } |
| |
| fuchsia_package_with_single_component("cobalt_system_metrics") { |
| manifest = "meta/cobalt_system_metrics.cml" |
| deps = [ ":system-metrics" ] |
| } |
| |
| executable("cobalt_system_metrics_unittests") { |
| testonly = true |
| |
| sources = [ "system_metrics_daemon_test.cc" ] |
| |
| deps = [ |
| ":system_metrics_daemon_lib", |
| "testing:fake_fetchers", |
| "//sdk/fidl/fuchsia.cobalt", |
| "//sdk/lib/inspect/testing/cpp", |
| "//sdk/lib/sys/cpp/testing:unit", |
| "//src/cobalt/bin/testing:fake_clock_lib", |
| "//src/cobalt/bin/testing:fake_logger_lib", |
| "//src/cobalt/bin/utils:clock", |
| "//src/lib/fsl", |
| "//src/lib/fxl/test:gtest_main", |
| "//src/lib/testing/loop_fixture", |
| ] |
| |
| # TODO(67363): Temporarily disable lsan for this target. Reenable once all leaks are fixed. |
| deps += [ "//build/config/sanitizers:suppress-lsan.DO-NOT-USE-THIS" ] |
| } |