• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
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")
16
17sql_files = [
18  "android/android_mem.sql",
19  "android/android_mem_lmk.sql",
20]
21
22config("gen_config") {
23  include_dirs = [ "${root_gen_dir}/${perfetto_root_path}" ]
24}
25
26action("gen_merged_sql_metrics") {
27  script = "../../../tools/gen_merged_sql_metrics.py"
28  generated_header = "${target_gen_dir}/sql_metrics.h"
29  args = rebase_path(sql_files, root_build_dir) + [
30           "--cpp_out",
31           rebase_path(generated_header, root_build_dir),
32         ]
33  inputs = sql_files
34  outputs = [
35    generated_header,
36  ]
37  public_configs = [ ":gen_config" ]
38}
39
40source_set("lib") {
41  sources = [
42    "metrics.cc",
43    "metrics.h",
44  ]
45  deps = [
46    ":gen_merged_sql_metrics",
47    "../../../buildtools:sqlite",
48    "../../../gn:default_deps",
49    "../../../include/perfetto/trace_processor",
50    "../../../protos/perfetto/metrics:zero",
51    "../../../protos/perfetto/metrics/android:zero",
52    "../../protozero:protozero",
53  ]
54}
55