blob: 9e097900a83166aed90f038e2803c5d76c00434d [file] [log] [blame]
Hector Dearman3e712a02017-12-19 16:39:59 +00001# Copyright (C) 2017 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
Primiano Tuccia7f5a8e2021-01-02 17:10:50 +010015import("../../../gn/perfetto.gni")
Primiano Tucci02c11762019-08-30 00:57:59 +020016import("../../../gn/test.gni")
17
Primiano Tuccia7f5a8e2021-01-02 17:10:50 +010018assert(enable_perfetto_traced_probes)
Primiano Tucci42433ab2020-11-30 18:42:01 +010019
Primiano Tucci02c11762019-08-30 00:57:59 +020020# The unprivileged daemon that is allowed to access tracefs (for ftrace).
21# Registers as a Producer on the traced daemon.
22executable("traced_probes") {
23 deps = [
24 "../../../:libperfetto",
25 "../../../gn:default_deps",
26 "../../../include/perfetto/ext/traced",
27 ]
Primiano Tucci2925e9d2020-01-27 10:15:58 +000028 sources = [ "main.cc" ]
Primiano Tuccie8020f92019-11-26 13:24:01 +000029 assert_no_deps = [ "//gn:protobuf_lite" ]
Primiano Tucci02c11762019-08-30 00:57:59 +020030}
31
32# Contains all the implementation but not the main() entry point. This target
33# is shared both by the executable and tests.
Hector Dearman3e712a02017-12-19 16:39:59 +000034source_set("probes") {
Primiano Tucci2925e9d2020-01-27 10:15:58 +000035 public_deps = [ "../../../include/perfetto/ext/traced" ]
Hector Dearman3e712a02017-12-19 16:39:59 +000036 deps = [
Isabelle Taylord404ea12018-02-19 17:28:01 +000037 ":probes_src",
Hector Dearman3e712a02017-12-19 16:39:59 +000038 "../../../gn:default_deps",
Primiano Tuccic4c063b2020-01-27 09:34:46 +000039 "../../tracing/ipc/producer",
Hector Dearman3e712a02017-12-19 16:39:59 +000040 ]
Primiano Tucci2925e9d2020-01-27 10:15:58 +000041 sources = [ "probes.cc" ]
Hector Dearman3e712a02017-12-19 16:39:59 +000042}
Lalit Maganti0b65b912018-01-12 18:04:31 +000043
Isabelle Taylord404ea12018-02-19 17:28:01 +000044source_set("probes_src") {
Primiano Tucci2925e9d2020-01-27 10:15:58 +000045 public_deps = [ "ftrace" ]
Lalit Maganti0b65b912018-01-12 18:04:31 +000046 deps = [
Primiano Tuccifd8240d2018-08-01 09:34:54 +010047 ":data_source",
Lalit Maganti0b65b912018-01-12 18:04:31 +000048 "../../../gn:default_deps",
Primiano Tucci2c5488f2019-06-01 03:27:28 +010049 "../../../include/perfetto/ext/traced",
Primiano Tucci57dd66b2019-10-15 23:09:04 +010050 "../../../protos/perfetto/config/ftrace:cpp",
Primiano Tuccic4c063b2020-01-27 09:34:46 +000051 "../../../protos/perfetto/trace:zero",
Primiano Tuccic2eb5102018-05-15 10:40:01 +010052 "../../../protos/perfetto/trace/ps:zero",
Lalit Maganti0b65b912018-01-12 18:04:31 +000053 "../../base",
Primiano Tuccic4c063b2020-01-27 09:34:46 +000054 "../../tracing/core",
55 "../../tracing/ipc/producer",
Primiano Tucci64df2ca2019-01-03 22:26:47 +000056 "android_log",
Rafal Slawik8053a682020-04-08 17:26:40 +010057 "common",
Anna Zappone2a6f9042018-03-14 13:26:07 +000058 "filesystem",
Simon MacMullen3d4c54a2020-04-17 16:40:53 +010059 "initial_display_state",
Primiano Tuccib02d8dc2019-06-04 11:46:43 +010060 "metatrace",
Florian Mayer12f0f8e2019-04-02 12:31:13 +010061 "packages_list",
Primiano Tuccib86e9ca2018-12-03 20:20:11 +010062 "power",
Primiano Tuccib6de48b2018-07-26 16:00:44 +010063 "ps",
Primiano Tucci82a8bfd2018-09-19 11:33:04 +010064 "sys_stats",
Rafal Slawikb013a112020-04-03 16:12:02 +010065 "system_info",
Lalit Maganti0b65b912018-01-12 18:04:31 +000066 ]
67 sources = [
Isabelle Taylord404ea12018-02-19 17:28:01 +000068 "probes_producer.cc",
69 "probes_producer.h",
Hector Dearmanebf07c72018-03-13 10:31:05 +000070 ]
71}
72
Primiano Tuccifd8240d2018-08-01 09:34:54 +010073# Base class for data sources in traced_probes.
74# Needs to be a separate target to avoid cyclical deps.
75source_set("data_source") {
76 deps = [
77 "../../../gn:default_deps",
Primiano Tuccic4c063b2020-01-27 09:34:46 +000078 "../../tracing/core",
Primiano Tuccifd8240d2018-08-01 09:34:54 +010079 ]
80 sources = [
81 "probes_data_source.cc",
82 "probes_data_source.h",
83 ]
84}
85
Primiano Tucci02c11762019-08-30 00:57:59 +020086perfetto_unittest_source_set("unittests") {
Hector Dearmanebf07c72018-03-13 10:31:05 +000087 testonly = true
88 deps = [
89 ":probes_src",
90 "../../../gn:default_deps",
Primiano Tucci13ae72f2019-06-06 10:53:02 +010091 "../../../gn:gtest_and_gmock",
Primiano Tuccic4c063b2020-01-27 09:34:46 +000092 "../../tracing/test:test_support",
Primiano Tucci64df2ca2019-01-03 22:26:47 +000093 "android_log:unittests",
Rafal Slawik8053a682020-04-08 17:26:40 +010094 "common:unittests",
Primiano Tuccib6de48b2018-07-26 16:00:44 +010095 "filesystem:unittests",
Simon MacMullen3d4c54a2020-04-17 16:40:53 +010096 "initial_display_state:unittests",
Florian Mayer12f0f8e2019-04-02 12:31:13 +010097 "packages_list:unittests",
Primiano Tuccib6de48b2018-07-26 16:00:44 +010098 "ps:unittests",
Primiano Tucci82a8bfd2018-09-19 11:33:04 +010099 "sys_stats:unittests",
Rafal Slawikb013a112020-04-03 16:12:02 +0100100 "system_info:unittests",
Lalit Maganti0b65b912018-01-12 18:04:31 +0000101 ]
102}