xref: /aosp_15_r20/external/perfetto/src/trace_processor/metrics/BUILD.gn (revision 6dbdd20afdafa5e3ca9b8809fa73465d530080dc)
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    "../../../protos/perfetto/trace_processor:zero",
49    "../../base",
50    "../../protozero:protozero",
51    "../perfetto_sql/engine",
52    "../perfetto_sql/intrinsics/functions",
53    "../sqlite",
54  ]
55  public_deps = [
56    ":gen_cc_all_chrome_metrics_descriptor",
57    ":gen_cc_all_webview_metrics_descriptor",
58    ":gen_cc_metrics_descriptor",
59    "../util",
60    "../util:descriptors",
61    "sql:gen_amalgamated_sql_metrics",
62  ]
63}
64
65perfetto_unittest_source_set("unittests") {
66  testonly = true
67  sources = [ "metrics_unittest.cc" ]
68  deps = [
69    ":metrics",
70    "..:lib",
71    "../../../gn:default_deps",
72    "../../../gn:gtest_and_gmock",
73    "../../../gn:sqlite",
74    "../../../protos/perfetto/common:zero",
75    "../../../protos/perfetto/trace_processor:metrics_impl_zero",
76    "../../../protos/perfetto/trace_processor:zero",
77    "../../base:test_support",
78    "../../protozero",
79  ]
80}
81