xref: /aosp_15_r20/external/perfetto/src/profiling/common/BUILD.gn (revision 6dbdd20afdafa5e3ca9b8809fa73465d530080dc)
1# Copyright (C) 2020 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")
16import("../../../gn/test.gni")
17
18source_set("unwind_support") {
19  public_deps = [ "../../../gn:libunwindstack" ]
20  deps = [
21    "../../../gn:default_deps",
22    "../../../src/base",
23  ]
24  sources = [
25    "unwind_support.cc",
26    "unwind_support.h",
27  ]
28}
29
30source_set("callstack_trie") {
31  public_deps = [ ":unwind_support" ]
32  deps = [
33    ":interner",
34    "../../../gn:default_deps",
35    "../../../src/base",
36  ]
37  sources = [
38    "callstack_trie.cc",
39    "callstack_trie.h",
40  ]
41}
42
43source_set("interner") {
44  deps = [
45    "../../../gn:default_deps",
46    "../../../src/base",
47  ]
48  sources = [ "interner.h" ]
49}
50
51source_set("interning_output") {
52  deps = [
53    ":callstack_trie",
54    ":interner",
55    "../../../gn:default_deps",
56    "../../../include/perfetto/ext/tracing/core",
57    "../../../protos/perfetto/trace:zero",
58    "../../../protos/perfetto/trace/interned_data:zero",
59    "../../../protos/perfetto/trace/profiling:zero",
60  ]
61  sources = [
62    "interning_output.cc",
63    "interning_output.h",
64  ]
65}
66
67source_set("proc_utils") {
68  deps = [
69    ":proc_cmdline",
70    "../../../gn:default_deps",
71    "../../base",
72  ]
73  sources = [
74    "proc_utils.cc",
75    "proc_utils.h",
76  ]
77}
78
79source_set("proc_cmdline") {
80  deps = [
81    "../../../gn:default_deps",
82    "../../base",
83  ]
84  sources = [
85    "proc_cmdline.cc",
86    "proc_cmdline.h",
87  ]
88}
89
90source_set("producer_support") {
91  deps = [
92    "../../../gn:default_deps",
93    "../../base",
94    "../../traced/probes/packages_list:packages_list_parser",
95    "../../tracing/core",
96  ]
97  sources = [
98    "producer_support.cc",
99    "producer_support.h",
100  ]
101}
102
103source_set("profiler_guardrails") {
104  deps = [
105    ":proc_utils",
106    "../../../gn:default_deps",
107    "../../../include/perfetto/ext/tracing/core",
108    "../../base",
109  ]
110  sources = [
111    "profiler_guardrails.cc",
112    "profiler_guardrails.h",
113  ]
114}
115
116perfetto_unittest_source_set("unittests") {
117  testonly = true
118  deps = [
119    ":interner",
120    ":proc_cmdline",
121    ":proc_utils",
122    ":producer_support",
123    ":profiler_guardrails",
124    "../../../gn:default_deps",
125    "../../../gn:gtest_and_gmock",
126    "../../base",
127    "../../base:test_support",
128    "../../tracing/core",
129  ]
130  sources = [
131    "interner_unittest.cc",
132    "proc_cmdline_unittest.cc",
133    "proc_utils_unittest.cc",
134    "producer_support_unittest.cc",
135    "profiler_guardrails_unittest.cc",
136  ]
137}
138