blob: 4bdfba5abf1239d3cdfc19daebcb1c90b5d27da0 [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
17# The unprivileged daemon that is allowed to access tracefs (for ftrace).
18# Registers as a Producer on the traced daemon.
19executable("traced_probes") {
20 deps = [
21 "../../../:libperfetto",
22 "../../../gn:default_deps",
23 "../../../include/perfetto/ext/traced",
24 ]
Primiano Tucci2925e9d2020-01-27 10:15:58 +000025 sources = [ "main.cc" ]
Primiano Tuccie8020f92019-11-26 13:24:01 +000026 assert_no_deps = [ "//gn:protobuf_lite" ]
Primiano Tucci02c11762019-08-30 00:57:59 +020027}
28
29# Contains all the implementation but not the main() entry point. This target
30# is shared both by the executable and tests.
Hector Dearman3e712a02017-12-19 16:39:59 +000031source_set("probes") {
Primiano Tucci2925e9d2020-01-27 10:15:58 +000032 public_deps = [ "../../../include/perfetto/ext/traced" ]
Hector Dearman3e712a02017-12-19 16:39:59 +000033 deps = [
Isabelle Taylord404ea12018-02-19 17:28:01 +000034 ":probes_src",
Hector Dearman3e712a02017-12-19 16:39:59 +000035 "../../../gn:default_deps",
Primiano Tuccic4c063b2020-01-27 09:34:46 +000036 "../../tracing/ipc/producer",
Hector Dearman3e712a02017-12-19 16:39:59 +000037 ]
Davide Pallotti673b5762019-12-05 15:14:46 +010038 if (enable_perfetto_version_gen) {
39 deps += [ "//gn/standalone:gen_git_revision" ]
40 }
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",
Anna Zappone2a6f9042018-03-14 13:26:07 +000057 "filesystem",
Primiano Tuccib02d8dc2019-06-04 11:46:43 +010058 "metatrace",
Florian Mayer12f0f8e2019-04-02 12:31:13 +010059 "packages_list",
Primiano Tuccib86e9ca2018-12-03 20:20:11 +010060 "power",
Primiano Tuccib6de48b2018-07-26 16:00:44 +010061 "ps",
Primiano Tucci82a8bfd2018-09-19 11:33:04 +010062 "sys_stats",
Lalit Maganti0b65b912018-01-12 18:04:31 +000063 ]
64 sources = [
Isabelle Taylord404ea12018-02-19 17:28:01 +000065 "probes_producer.cc",
66 "probes_producer.h",
Hector Dearmanebf07c72018-03-13 10:31:05 +000067 ]
68}
69
Primiano Tuccifd8240d2018-08-01 09:34:54 +010070# Base class for data sources in traced_probes.
71# Needs to be a separate target to avoid cyclical deps.
72source_set("data_source") {
73 deps = [
74 "../../../gn:default_deps",
Primiano Tuccic4c063b2020-01-27 09:34:46 +000075 "../../tracing/core",
Primiano Tuccifd8240d2018-08-01 09:34:54 +010076 ]
77 sources = [
78 "probes_data_source.cc",
79 "probes_data_source.h",
80 ]
81}
82
Primiano Tucci02c11762019-08-30 00:57:59 +020083perfetto_unittest_source_set("unittests") {
Hector Dearmanebf07c72018-03-13 10:31:05 +000084 testonly = true
85 deps = [
86 ":probes_src",
87 "../../../gn:default_deps",
Primiano Tucci13ae72f2019-06-06 10:53:02 +010088 "../../../gn:gtest_and_gmock",
Primiano Tuccic4c063b2020-01-27 09:34:46 +000089 "../../tracing/test:test_support",
Primiano Tucci64df2ca2019-01-03 22:26:47 +000090 "android_log:unittests",
Primiano Tuccib6de48b2018-07-26 16:00:44 +010091 "filesystem:unittests",
Florian Mayer12f0f8e2019-04-02 12:31:13 +010092 "packages_list:unittests",
Primiano Tuccib6de48b2018-07-26 16:00:44 +010093 "ps:unittests",
Primiano Tucci82a8bfd2018-09-19 11:33:04 +010094 "sys_stats:unittests",
Lalit Maganti0b65b912018-01-12 18:04:31 +000095 ]
96}