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    "../../../gn:default_deps",
70    "../../../include/perfetto/profiling:normalize",
71    "../../base",
72  ]
73  sources = [
74    "proc_utils.cc",
75    "proc_utils.h",
76  ]
77}
78
79source_set("producer_support") {
80  deps = [
81    "../../../gn:default_deps",
82    "../../base",
83    "../../traced/probes/packages_list:packages_list_parser",
84    "../../tracing/core",
85  ]
86  sources = [
87    "producer_support.cc",
88    "producer_support.h",
89  ]
90}
91
92source_set("profiler_guardrails") {
93  deps = [
94    ":proc_utils",
95    "../../../gn:default_deps",
96    "../../../include/perfetto/ext/tracing/core",
97    "../../base",
98  ]
99  sources = [
100    "profiler_guardrails.cc",
101    "profiler_guardrails.h",
102  ]
103}
104
105perfetto_unittest_source_set("unittests") {
106  testonly = true
107  deps = [
108    ":interner",
109    ":proc_utils",
110    ":producer_support",
111    ":profiler_guardrails",
112    "../../../gn:default_deps",
113    "../../../gn:gtest_and_gmock",
114    "../../../include/perfetto/profiling:normalize",
115    "../../base",
116    "../../base:test_support",
117    "../../tracing/core",
118  ]
119  sources = [
120    "interner_unittest.cc",
121    "proc_utils_unittest.cc",
122    "producer_support_unittest.cc",
123    "profiler_guardrails_unittest.cc",
124  ]
125}
126