blob: 4c3175f36137a2e422587f7486a27d9b616ceafd [file] [log] [blame]
Robert Oliver21dcf272020-05-12 15:41:52 -04001# Copyright 2020 The Pigweed Authors
2#
3# Licensed under the Apache License, Version 2.0 (the "License"); you may not
4# use this file except in compliance with the License. You may obtain a copy of
5# the License at
6#
7# https://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, WITHOUT
11# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
12# License for the specific language governing permissions and limitations under
13# the License.
14
15load(
16 "//pw_build:pigweed.bzl",
Robert Oliver6d05de12020-07-13 15:10:42 -040017 "pw_cc_binary",
Robert Oliver21dcf272020-05-12 15:41:52 -040018 "pw_cc_library",
19 "pw_cc_test",
20)
21
22package(default_visibility = ["//visibility:public"])
23
24licenses(["notice"]) # Apache License 2.0
25
26# TODO(pwbug/101): Need to add support for facades/backends to Bazel.
27
28pw_cc_library(
29 name = "headers",
30 hdrs = [
Robert Oliver19468fb2020-10-19 14:56:07 -040031 "public/pw_trace_tokenized/config.h",
Robert Oliver21dcf272020-05-12 15:41:52 -040032 "public/pw_trace_tokenized/internal/trace_tokenized_internal.h",
33 "public/pw_trace_tokenized/trace_callback.h",
34 "public/pw_trace_tokenized/trace_tokenized.h",
35 "public_overrides/pw_trace_backend/trace_backend.h",
36 ],
37 includes = [
38 "public",
39 "public_overrides",
40 ],
41 deps = [
42 "//pw_preprocessor",
43 "//pw_tokenizer",
44 ],
45)
46
47pw_cc_library(
48 name = "pw_trace_tokenized",
49 srcs = [
50 "trace.cc",
51 ],
52 deps = [
53 ":headers",
54 "//pw_assert",
55 "//pw_log",
56 "//pw_status",
57 "//pw_tokenizer",
58 "//pw_trace:facade",
59 "//pw_varint",
60 ],
61)
62
63pw_cc_library(
Robert Oliver81e6e3e2020-06-25 14:43:40 -040064 name = "trace_buffer_headers",
65 hdrs = [
66 "public/pw_trace_tokenized/trace_buffer.h",
67 ],
68 includes = [
69 "public",
70 ],
71 deps = [
72 "//pw_ring_buffer",
73 "//pw_status",
74 "//pw_trace_tokenized",
75 ],
76)
77
78pw_cc_library(
79 name = "pw_trace_tokenized_buffer",
80 srcs = [
81 "trace_buffer.cc",
82 ],
83 deps = [
84 ":trace_buffer_headers",
85 "//pw_ring_buffer",
86 "//pw_status",
87 ],
88)
89
90pw_cc_library(
Prashanth Swaminathan0a9129c2020-09-14 16:27:24 -070091 name = "pw_trace_tokenized_buffer_log",
92 hdrs = [
93 "public/pw_trace_tokenized/trace_buffer_log.h",
94 ],
95 srcs = [
96 "trace_buffer_log.cc",
97 ],
98 deps = [
99 ":trace_buffer_headers",
100 "//pw_base64",
101 "//pw_log",
102 "//pw_string",
103 ],
104)
105
106pw_cc_library(
Robert Oliver21dcf272020-05-12 15:41:52 -0400107 name = "pw_trace_tokenized_fake_time",
108 srcs = [
109 "fake_trace_time.cc",
110 ],
111 deps = [
112 "//pw_trace",
113 ],
114)
115
116pw_cc_test(
117 name = "trace_tokenized_test",
118 srcs = [
119 "trace_test.cc",
120 ],
121 includes = [
122 "pw_trace_test",
123 "pw_trace_test/public_overrides"
124 ],
125 deps = [
126 ":backend",
127 ":facade",
128 ":pw_trace",
129 "//pw_preprocessor",
130 "//pw_unit_test",
131 ],
132)
133
Robert Oliver81e6e3e2020-06-25 14:43:40 -0400134pw_cc_test(
135 name = "trace_tokenized_buffer_test",
136 srcs = [
137 "trace_buffer_test.cc",
138 ],
139 deps = [
140 ":backend",
141 ":facade",
142 ":pw_trace",
143 "//pw_preprocessor",
144 "//pw_unit_test",
145 ],
146)
147
Prashanth Swaminathan0a9129c2020-09-14 16:27:24 -0700148pw_cc_test(
149 name = "trace_tokenized_buffer_log_test",
150 srcs = [
151 "trace_buffer_log_test.cc",
152 ],
153 deps = [
154 ":backend",
155 ":facade",
156 ":pw_trace_log",
157 "//pw_preprocessor",
158 "//pw_unit_test",
159 ],
160)
161
Robert Oliver6d05de12020-07-13 15:10:42 -0400162pw_cc_library(
163 name = "pw_trace_host_trace_time",
164 includes = [ "example/public" ],
165 deps = [ "//pw_trace" ],
166 srcs = [ "host_trace_time.cc" ]
167)
168
169pw_cc_library(
170 name = "pw_trace_example_to_file",
171 includes = [ "example/public" ],
172 deps = [ "//pw_trace" ],
173 hdrs = [ "example/public/pw_trace_tokenized/example/trace_to_file.h" ]
174)
175
176pw_cc_binary(
177 name = "trace_tokenized_example_basic",
178 deps = [
179 ":pw_trace_example_to_file",
180 "//pw_log",
181 "//dir_pw_trace",
182 "//dir_pw_trace:pw_trace_sample_app",
183 ],
184 srcs = [ "example/basic.cc" ]
185)
Robert Oliver19146912020-07-14 10:49:48 -0400186
187pw_cc_binary(
188 name = "trace_tokenized_example_trigger",
189 deps = [
190 ":pw_trace_example_to_file",
191 "//pw_log",
192 "//dir_pw_trace",
193 "//dir_pw_trace:pw_trace_sample_app",
194 ],
195 srcs = [ "example/trigger.cc" ]
196)
Robert Oliver0cc20752020-07-14 15:24:22 -0400197
198pw_cc_binary(
199 name = "trace_tokenized_example_filter",
200 deps = [
201 ":pw_trace_example_to_file",
202 "//pw_log",
203 "//dir_pw_trace",
204 "//dir_pw_trace:pw_trace_sample_app",
205 ],
206 srcs = [ "example/filter.cc" ]
207)