blob: d54e96506f015bb2c39cb15535d53ef7691cc651 [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 Tucci02c11762019-08-30 00:57:59 +020015import("../../../gn/test.gni")
16
Primiano Tucci42433ab2020-11-30 18:42:01 +010017assert(target_os != "win")
18
Primiano Tucci02c11762019-08-30 00:57:59 +020019# The unprivileged daemon that is allowed to access tracefs (for ftrace).
20# Registers as a Producer on the traced daemon.
21executable("traced_probes") {
22 deps = [
23 "../../../:libperfetto",
24 "../../../gn:default_deps",
25 "../../../include/perfetto/ext/traced",
26 ]
Primiano Tucci2925e9d2020-01-27 10:15:58 +000027 sources = [ "main.cc" ]
Primiano Tuccie8020f92019-11-26 13:24:01 +000028 assert_no_deps = [ "//gn:protobuf_lite" ]
Primiano Tucci02c11762019-08-30 00:57:59 +020029}
30
31# Contains all the implementation but not the main() entry point. This target
32# is shared both by the executable and tests.
Hector Dearman3e712a02017-12-19 16:39:59 +000033source_set("probes") {
Primiano Tucci2925e9d2020-01-27 10:15:58 +000034 public_deps = [ "../../../include/perfetto/ext/traced" ]
Hector Dearman3e712a02017-12-19 16:39:59 +000035 deps = [
Isabelle Taylord404ea12018-02-19 17:28:01 +000036 ":probes_src",
Hector Dearman3e712a02017-12-19 16:39:59 +000037 "../../../gn:default_deps",
Primiano Tuccic4c063b2020-01-27 09:34:46 +000038 "../../tracing/ipc/producer",
Hector Dearman3e712a02017-12-19 16:39:59 +000039 ]
Primiano Tucci2925e9d2020-01-27 10:15:58 +000040 sources = [ "probes.cc" ]
Hector Dearman3e712a02017-12-19 16:39:59 +000041}
Lalit Maganti0b65b912018-01-12 18:04:31 +000042
Isabelle Taylord404ea12018-02-19 17:28:01 +000043source_set("probes_src") {
Primiano Tucci2925e9d2020-01-27 10:15:58 +000044 public_deps = [ "ftrace" ]
Lalit Maganti0b65b912018-01-12 18:04:31 +000045 deps = [
Primiano Tuccifd8240d2018-08-01 09:34:54 +010046 ":data_source",
Lalit Maganti0b65b912018-01-12 18:04:31 +000047 "../../../gn:default_deps",
Primiano Tucci2c5488f2019-06-01 03:27:28 +010048 "../../../include/perfetto/ext/traced",
Primiano Tucci57dd66b2019-10-15 23:09:04 +010049 "../../../protos/perfetto/config/ftrace:cpp",
Primiano Tuccic4c063b2020-01-27 09:34:46 +000050 "../../../protos/perfetto/trace:zero",
Primiano Tuccic2eb5102018-05-15 10:40:01 +010051 "../../../protos/perfetto/trace/ps:zero",
Lalit Maganti0b65b912018-01-12 18:04:31 +000052 "../../base",
Primiano Tuccic4c063b2020-01-27 09:34:46 +000053 "../../tracing/core",
54 "../../tracing/ipc/producer",
Primiano Tucci64df2ca2019-01-03 22:26:47 +000055 "android_log",
Rafal Slawik8053a682020-04-08 17:26:40 +010056 "common",
Anna Zappone2a6f9042018-03-14 13:26:07 +000057 "filesystem",
Simon MacMullen3d4c54a2020-04-17 16:40:53 +010058 "initial_display_state",
Primiano Tuccib02d8dc2019-06-04 11:46:43 +010059 "metatrace",
Florian Mayer12f0f8e2019-04-02 12:31:13 +010060 "packages_list",
Primiano Tuccib86e9ca2018-12-03 20:20:11 +010061 "power",
Primiano Tuccib6de48b2018-07-26 16:00:44 +010062 "ps",
Primiano Tucci82a8bfd2018-09-19 11:33:04 +010063 "sys_stats",
Rafal Slawikb013a112020-04-03 16:12:02 +010064 "system_info",
Lalit Maganti0b65b912018-01-12 18:04:31 +000065 ]
66 sources = [
Isabelle Taylord404ea12018-02-19 17:28:01 +000067 "probes_producer.cc",
68 "probes_producer.h",
Hector Dearmanebf07c72018-03-13 10:31:05 +000069 ]
70}
71
Primiano Tuccifd8240d2018-08-01 09:34:54 +010072# Base class for data sources in traced_probes.
73# Needs to be a separate target to avoid cyclical deps.
74source_set("data_source") {
75 deps = [
76 "../../../gn:default_deps",
Primiano Tuccic4c063b2020-01-27 09:34:46 +000077 "../../tracing/core",
Primiano Tuccifd8240d2018-08-01 09:34:54 +010078 ]
79 sources = [
80 "probes_data_source.cc",
81 "probes_data_source.h",
82 ]
83}
84
Primiano Tucci02c11762019-08-30 00:57:59 +020085perfetto_unittest_source_set("unittests") {
Hector Dearmanebf07c72018-03-13 10:31:05 +000086 testonly = true
87 deps = [
88 ":probes_src",
89 "../../../gn:default_deps",
Primiano Tucci13ae72f2019-06-06 10:53:02 +010090 "../../../gn:gtest_and_gmock",
Primiano Tuccic4c063b2020-01-27 09:34:46 +000091 "../../tracing/test:test_support",
Primiano Tucci64df2ca2019-01-03 22:26:47 +000092 "android_log:unittests",
Rafal Slawik8053a682020-04-08 17:26:40 +010093 "common:unittests",
Primiano Tuccib6de48b2018-07-26 16:00:44 +010094 "filesystem:unittests",
Simon MacMullen3d4c54a2020-04-17 16:40:53 +010095 "initial_display_state:unittests",
Florian Mayer12f0f8e2019-04-02 12:31:13 +010096 "packages_list:unittests",
Primiano Tuccib6de48b2018-07-26 16:00:44 +010097 "ps:unittests",
Primiano Tucci82a8bfd2018-09-19 11:33:04 +010098 "sys_stats:unittests",
Rafal Slawikb013a112020-04-03 16:12:02 +010099 "system_info:unittests",
Lalit Maganti0b65b912018-01-12 18:04:31 +0000100 ]
101}