1# Copyright (C) 2018 The Android Open Source Project 2# 3# Licensed under the Apache License, Version 2.0 (the "License"); 4# you may not use this file except in compliance with the License. 5# You may obtain a copy of the License at 6# 7# http://www.apache.org/licenses/LICENSE-2.0 8# 9# Unless required by applicable law or agreed to in writing, software 10# distributed under the License is distributed on an "AS IS" BASIS, 11# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12# See the License for the specific language governing permissions and 13# limitations under the License. 14 15import("../../../gn/perfetto.gni") 16import("../../../gn/perfetto_cc_proto_descriptor.gni") 17import("../../../gn/test.gni") 18 19assert(enable_perfetto_trace_processor_sqlite) 20 21perfetto_cc_proto_descriptor("gen_cc_metrics_descriptor") { 22 descriptor_name = "metrics.descriptor" 23 descriptor_target = "../../../protos/perfetto/metrics:descriptor" 24} 25 26perfetto_cc_proto_descriptor("gen_cc_all_chrome_metrics_descriptor") { 27 descriptor_name = "all_chrome_metrics.descriptor" 28 descriptor_target = "../../../protos/perfetto/metrics/chrome:descriptor" 29} 30 31perfetto_cc_proto_descriptor("gen_cc_all_webview_metrics_descriptor") { 32 descriptor_name = "all_webview_metrics.descriptor" 33 descriptor_target = "../../../protos/perfetto/metrics/webview:descriptor" 34} 35 36source_set("metrics") { 37 sources = [ 38 "metrics.cc", 39 "metrics.h", 40 ] 41 deps = [ 42 "..:metatrace", 43 "../../../gn:default_deps", 44 "../../../gn:sqlite", 45 "../../../include/perfetto/trace_processor", 46 "../../../protos/perfetto/common:zero", 47 "../../../protos/perfetto/trace_processor:metrics_impl_zero", 48 "../../base", 49 "../../protozero:protozero", 50 "../prelude/functions", 51 "../sqlite", 52 ] 53 public_deps = [ 54 ":gen_cc_all_chrome_metrics_descriptor", 55 ":gen_cc_all_webview_metrics_descriptor", 56 ":gen_cc_metrics_descriptor", 57 "../util", 58 "../util:descriptors", 59 "sql:gen_amalgamated_sql_metrics", 60 ] 61} 62 63perfetto_unittest_source_set("unittests") { 64 testonly = true 65 sources = [ "metrics_unittest.cc" ] 66 deps = [ 67 ":metrics", 68 "..:lib", 69 "../../../gn:default_deps", 70 "../../../gn:gtest_and_gmock", 71 "../../../gn:sqlite", 72 "../../../protos/perfetto/common:zero", 73 ] 74} 75