Home | History | Annotate | Download | only in perfetto_cmd
      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 
     15 import("../../gn/perfetto.gni")
     16 import("../../gn/proto_library.gni")
     17 
     18 source_set("perfetto_cmd") {
     19   public_deps = [
     20     ":protos",
     21     "../../include/perfetto/traced",
     22   ]
     23   deps = [
     24     ":trigger_producer",
     25     "../../buildtools:protobuf_lite",
     26     "../../gn:default_deps",
     27     "../../gn:zlib_deps",
     28     "../../protos/perfetto/common:lite",
     29     "../../protos/perfetto/config:lite",
     30     "../android_internal:headers",
     31     "../base",
     32     "../protozero",
     33     "../tracing:ipc",
     34   ]
     35   sources = [
     36     "config.cc",
     37     "config.h",
     38     "packet_writer.cc",
     39     "packet_writer.h",
     40     "pbtxt_to_pb.cc",
     41     "pbtxt_to_pb.h",
     42     "perfetto_cmd.cc",
     43     "perfetto_cmd.h",
     44     "perfetto_config.descriptor.h",
     45     "rate_limiter.cc",
     46     "rate_limiter.h",
     47   ]
     48   if (perfetto_build_with_android) {
     49     deps += [ "../base:android_task_runner" ]
     50     libs = [
     51       "binder",
     52       "services",
     53       "utils",
     54     ]
     55   }
     56 }
     57 
     58 source_set("trigger_perfetto_cmd") {
     59   public_deps = [
     60     ":protos",
     61     "../../include/perfetto/traced",
     62   ]
     63   deps = [
     64     ":trigger_producer",
     65     "../../gn:default_deps",
     66     "../base",
     67     "../tracing:ipc",
     68   ]
     69   sources = [
     70     "trigger_perfetto.cc",
     71   ]
     72 }
     73 
     74 source_set("trigger_producer") {
     75   sources = [
     76     "trigger_producer.cc",
     77     "trigger_producer.h",
     78   ]
     79   deps = [
     80     "../../buildtools:protobuf_lite",
     81     "../../gn:default_deps",
     82     "../../protos/perfetto/config:lite",
     83     "../base",
     84     "../tracing:ipc",
     85   ]
     86 }
     87 
     88 proto_library("protos") {
     89   generate_python = false
     90   deps = []
     91   sources = [
     92     "perfetto_cmd_state.proto",
     93   ]
     94   proto_in_dir = perfetto_root_path
     95   proto_out_dir = perfetto_root_path
     96 }
     97 
     98 source_set("unittests") {
     99   testonly = true
    100   public_deps = []
    101   deps = [
    102     ":perfetto_cmd",
    103     "../../gn:default_deps",
    104     "../../gn:gtest_deps",
    105     "../../gn:zlib_deps",
    106     "../../include/perfetto/base",
    107     "../../protos/perfetto/config:lite",
    108     "../../protos/perfetto/trace:lite",
    109     "../protozero",
    110     "../tracing",
    111   ]
    112   sources = [
    113     "config_unittest.cc",
    114     "packet_writer_unittest.cc",
    115     "pbtxt_to_pb_unittest.cc",
    116     "rate_limiter_unittest.cc",
    117   ]
    118 }
    119