| # 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/components.gni") |
| import("//build/config.gni") |
| import("//src/sys/core/build/core_shard.gni") |
| import("//third_party/cobalt/metrics_registry.gni") |
| |
| source_set("lib") { |
| sources = [ |
| "debugger.cc", |
| "debugger.h", |
| "high_water.cc", |
| "high_water.h", |
| "logger.cc", |
| "logger.h", |
| "metrics.cc", |
| "metrics.h", |
| "monitor.cc", |
| "monitor.h", |
| "pressure_notifier.cc", |
| "pressure_notifier.h", |
| "pressure_observer.cc", |
| "pressure_observer.h", |
| ] |
| public_deps = [ |
| "//sdk/fidl/fuchsia.feedback:fuchsia.feedback_hlcpp", |
| "//sdk/fidl/fuchsia.hardware.ram.metrics:fuchsia.hardware.ram.metrics_hlcpp", |
| "//sdk/fidl/fuchsia.memory:fuchsia.memory_hlcpp", |
| "//sdk/fidl/fuchsia.memorypressure:fuchsia.memorypressure_hlcpp", |
| "//sdk/fidl/fuchsia.metrics:fuchsia.metrics_hlcpp", |
| "//sdk/lib/sys/cpp", |
| "//sdk/lib/sys/inspect/cpp", |
| "//sdk/lib/syslog/cpp", |
| "//src/developer/memory/metrics", |
| "//zircon/system/ulib/inspect", |
| "//zircon/system/ulib/trace", |
| ] |
| deps = [ |
| ":memory_metrics_registry", |
| "//sdk/fidl/fuchsia.kernel:fuchsia.kernel_cpp_wire", |
| "//sdk/lib/component/incoming/cpp", |
| "//src/devices/lib/amlogic", |
| "//src/lib/cobalt/cpp:metric_event_builder", |
| "//src/lib/fsl", |
| "//src/lib/fxl", |
| "//zircon/system/ulib/async-loop:async-loop-cpp", |
| "//zircon/system/ulib/async-loop:async-loop-default", |
| "//zircon/system/ulib/trace-provider", |
| "//zircon/system/ulib/trace-vthread", |
| ] |
| } |
| |
| metrics_registry("memory_metrics_registry") { |
| # This must match the ID of our Cobalt project as specified in: |
| # third_party/cobalt_config/projects.yaml |
| project_id = 3509424520 |
| namespace = "cobalt_registry" |
| generate_cc = true |
| generate_binarypb = false |
| } |
| |
| executable("bin") { |
| output_name = "memory_monitor" |
| sources = [ "main.cc" ] |
| deps = [ |
| ":lib", |
| "//sdk/fidl/fuchsia.scheduler:fuchsia.scheduler_hlcpp", |
| "//sdk/lib/sys/cpp", |
| "//src/lib/fsl", |
| "//src/lib/fxl", |
| "//zircon/system/ulib/async-default", |
| "//zircon/system/ulib/async-loop:async-loop-cpp", |
| "//zircon/system/ulib/async-loop:async-loop-default", |
| "//zircon/system/ulib/trace-provider", |
| ] |
| } |
| |
| fuchsia_component("component") { |
| component_name = "memory_monitor" |
| manifest = "meta/memory_monitor.cml" |
| deps = [ ":bin" ] |
| } |
| |
| fuchsia_package("monitor") { |
| package_name = "memory_monitor" |
| deps = [ ":component" ] |
| } |
| |
| core_shard("memory_monitor_core_shard") { |
| shard_file = "meta/memory_monitor.core_shard.cml" |
| } |
| |
| config_data("userdebug_config") { |
| for_pkg = "memory_monitor" |
| sources = [ "config/send_critical_pressure_crash_reports" ] |
| outputs = [ "send_critical_pressure_crash_reports" ] |
| } |