| # 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") | |
| import("//third_party/cobalt/metrics_registry.gni") | |
| source_set("lib") { | |
| sources = [ | |
| "high_water.cc", | |
| "high_water.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.cobalt", | |
| "//sdk/fidl/fuchsia.feedback", | |
| "//sdk/fidl/fuchsia.hardware.ram.metrics", | |
| "//sdk/fidl/fuchsia.memory", | |
| "//sdk/fidl/fuchsia.memorypressure", | |
| "//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_c", | |
| "//src/devices/lib/amlogic", | |
| "//src/lib/cobalt/cpp:cobalt_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:trace-provider-with-fdio", | |
| "//zircon/system/ulib/trace-vthread", | |
| ] | |
| # TODO(fxbug.dev/58162): delete the below and fix compiler warnings | |
| configs += [ "//build/config:Wno-conversion" ] | |
| } | |
| 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", | |
| "//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:trace-provider-with-fdio", | |
| ] | |
| # TODO(fxbug.dev/58162): delete the below and fix compiler warnings | |
| configs += [ "//build/config:Wno-conversion" ] | |
| } | |
| package("monitor") { | |
| package_name = "memory_monitor" | |
| deps = [ ":bin" ] | |
| binaries = [ | |
| { | |
| name = "memory_monitor" | |
| }, | |
| ] | |
| meta = [ | |
| { | |
| path = rebase_path("meta/memory_monitor.cmx") | |
| dest = "memory_monitor.cmx" | |
| }, | |
| ] | |
| } |