Robert Oliver | 21dcf27 | 2020-05-12 15:41:52 -0400 | [diff] [blame] | 1 | # 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 | |
| 15 | load( |
| 16 | "//pw_build:pigweed.bzl", |
Robert Oliver | 6d05de1 | 2020-07-13 15:10:42 -0400 | [diff] [blame] | 17 | "pw_cc_binary", |
Robert Oliver | 21dcf27 | 2020-05-12 15:41:52 -0400 | [diff] [blame] | 18 | "pw_cc_library", |
| 19 | "pw_cc_test", |
| 20 | ) |
| 21 | |
| 22 | package(default_visibility = ["//visibility:public"]) |
| 23 | |
| 24 | licenses(["notice"]) # Apache License 2.0 |
| 25 | |
| 26 | # TODO(pwbug/101): Need to add support for facades/backends to Bazel. |
| 27 | |
| 28 | pw_cc_library( |
| 29 | name = "headers", |
| 30 | hdrs = [ |
Robert Oliver | 19468fb | 2020-10-19 14:56:07 -0400 | [diff] [blame] | 31 | "public/pw_trace_tokenized/config.h", |
Robert Oliver | 21dcf27 | 2020-05-12 15:41:52 -0400 | [diff] [blame] | 32 | "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 | |
| 47 | pw_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 | |
| 63 | pw_cc_library( |
Rob Oliver | 9d66337 | 2021-02-05 11:02:05 -0500 | [diff] [blame] | 64 | name = "trace_rpc_service", |
Nathaniel Brough | a1113be | 2021-03-07 09:05:41 +0800 | [diff] [blame] | 65 | srcs = [ |
| 66 | "trace_rpc_service_nanopb.cc", |
| 67 | ], |
Rob Oliver | 9d66337 | 2021-02-05 11:02:05 -0500 | [diff] [blame] | 68 | hdrs = [ |
| 69 | "public/pw_trace_tokenized/trace_rpc_service_nanopb.h", |
| 70 | ], |
| 71 | includes = [ |
| 72 | "public", |
| 73 | ], |
Rob Oliver | 9d66337 | 2021-02-05 11:02:05 -0500 | [diff] [blame] | 74 | deps = [ |
| 75 | "//pw_log", |
| 76 | "//pw_trace", |
| 77 | "//pw_trace_tokenized_buffer", |
| 78 | ], |
| 79 | ) |
| 80 | |
| 81 | pw_cc_library( |
Robert Oliver | 81e6e3e | 2020-06-25 14:43:40 -0400 | [diff] [blame] | 82 | name = "trace_buffer_headers", |
| 83 | hdrs = [ |
| 84 | "public/pw_trace_tokenized/trace_buffer.h", |
| 85 | ], |
| 86 | includes = [ |
| 87 | "public", |
| 88 | ], |
| 89 | deps = [ |
| 90 | "//pw_ring_buffer", |
| 91 | "//pw_status", |
| 92 | "//pw_trace_tokenized", |
| 93 | ], |
| 94 | ) |
| 95 | |
| 96 | pw_cc_library( |
| 97 | name = "pw_trace_tokenized_buffer", |
| 98 | srcs = [ |
| 99 | "trace_buffer.cc", |
| 100 | ], |
| 101 | deps = [ |
| 102 | ":trace_buffer_headers", |
| 103 | "//pw_ring_buffer", |
| 104 | "//pw_status", |
| 105 | ], |
| 106 | ) |
| 107 | |
| 108 | pw_cc_library( |
Prashanth Swaminathan | 0a9129c | 2020-09-14 16:27:24 -0700 | [diff] [blame] | 109 | name = "pw_trace_tokenized_buffer_log", |
Prashanth Swaminathan | 0a9129c | 2020-09-14 16:27:24 -0700 | [diff] [blame] | 110 | srcs = [ |
| 111 | "trace_buffer_log.cc", |
| 112 | ], |
Nathaniel Brough | a1113be | 2021-03-07 09:05:41 +0800 | [diff] [blame] | 113 | hdrs = [ |
| 114 | "public/pw_trace_tokenized/trace_buffer_log.h", |
| 115 | ], |
Prashanth Swaminathan | 0a9129c | 2020-09-14 16:27:24 -0700 | [diff] [blame] | 116 | deps = [ |
| 117 | ":trace_buffer_headers", |
Nathaniel Brough | a1113be | 2021-03-07 09:05:41 +0800 | [diff] [blame] | 118 | "//pw_base64", |
| 119 | "//pw_log", |
| 120 | "//pw_string", |
Prashanth Swaminathan | 0a9129c | 2020-09-14 16:27:24 -0700 | [diff] [blame] | 121 | ], |
| 122 | ) |
| 123 | |
| 124 | pw_cc_library( |
Robert Oliver | 21dcf27 | 2020-05-12 15:41:52 -0400 | [diff] [blame] | 125 | name = "pw_trace_tokenized_fake_time", |
| 126 | srcs = [ |
| 127 | "fake_trace_time.cc", |
| 128 | ], |
| 129 | deps = [ |
| 130 | "//pw_trace", |
| 131 | ], |
| 132 | ) |
| 133 | |
| 134 | pw_cc_test( |
| 135 | name = "trace_tokenized_test", |
| 136 | srcs = [ |
| 137 | "trace_test.cc", |
| 138 | ], |
| 139 | includes = [ |
| 140 | "pw_trace_test", |
Nathaniel Brough | a1113be | 2021-03-07 09:05:41 +0800 | [diff] [blame] | 141 | "pw_trace_test/public_overrides", |
Robert Oliver | 21dcf27 | 2020-05-12 15:41:52 -0400 | [diff] [blame] | 142 | ], |
| 143 | deps = [ |
| 144 | ":backend", |
| 145 | ":facade", |
| 146 | ":pw_trace", |
| 147 | "//pw_preprocessor", |
| 148 | "//pw_unit_test", |
| 149 | ], |
| 150 | ) |
| 151 | |
Robert Oliver | 81e6e3e | 2020-06-25 14:43:40 -0400 | [diff] [blame] | 152 | pw_cc_test( |
| 153 | name = "trace_tokenized_buffer_test", |
| 154 | srcs = [ |
| 155 | "trace_buffer_test.cc", |
| 156 | ], |
| 157 | deps = [ |
| 158 | ":backend", |
| 159 | ":facade", |
| 160 | ":pw_trace", |
| 161 | "//pw_preprocessor", |
| 162 | "//pw_unit_test", |
| 163 | ], |
| 164 | ) |
| 165 | |
Prashanth Swaminathan | 0a9129c | 2020-09-14 16:27:24 -0700 | [diff] [blame] | 166 | pw_cc_test( |
| 167 | name = "trace_tokenized_buffer_log_test", |
| 168 | srcs = [ |
| 169 | "trace_buffer_log_test.cc", |
| 170 | ], |
| 171 | deps = [ |
| 172 | ":backend", |
| 173 | ":facade", |
| 174 | ":pw_trace_log", |
| 175 | "//pw_preprocessor", |
| 176 | "//pw_unit_test", |
| 177 | ], |
| 178 | ) |
| 179 | |
Robert Oliver | 6d05de1 | 2020-07-13 15:10:42 -0400 | [diff] [blame] | 180 | pw_cc_library( |
| 181 | name = "pw_trace_host_trace_time", |
Nathaniel Brough | a1113be | 2021-03-07 09:05:41 +0800 | [diff] [blame] | 182 | srcs = ["host_trace_time.cc"], |
| 183 | includes = ["example/public"], |
| 184 | deps = ["//pw_trace"], |
Robert Oliver | 6d05de1 | 2020-07-13 15:10:42 -0400 | [diff] [blame] | 185 | ) |
| 186 | |
| 187 | pw_cc_library( |
| 188 | name = "pw_trace_example_to_file", |
Nathaniel Brough | a1113be | 2021-03-07 09:05:41 +0800 | [diff] [blame] | 189 | hdrs = ["example/public/pw_trace_tokenized/example/trace_to_file.h"], |
| 190 | includes = ["example/public"], |
| 191 | deps = ["//pw_trace"], |
Robert Oliver | 6d05de1 | 2020-07-13 15:10:42 -0400 | [diff] [blame] | 192 | ) |
| 193 | |
| 194 | pw_cc_binary( |
| 195 | name = "trace_tokenized_example_basic", |
Nathaniel Brough | a1113be | 2021-03-07 09:05:41 +0800 | [diff] [blame] | 196 | srcs = ["example/basic.cc"], |
Robert Oliver | 6d05de1 | 2020-07-13 15:10:42 -0400 | [diff] [blame] | 197 | deps = [ |
| 198 | ":pw_trace_example_to_file", |
Robert Oliver | 6d05de1 | 2020-07-13 15:10:42 -0400 | [diff] [blame] | 199 | "//dir_pw_trace", |
| 200 | "//dir_pw_trace:pw_trace_sample_app", |
Nathaniel Brough | a1113be | 2021-03-07 09:05:41 +0800 | [diff] [blame] | 201 | "//pw_log", |
Robert Oliver | 6d05de1 | 2020-07-13 15:10:42 -0400 | [diff] [blame] | 202 | ], |
Robert Oliver | 6d05de1 | 2020-07-13 15:10:42 -0400 | [diff] [blame] | 203 | ) |
Robert Oliver | 1914691 | 2020-07-14 10:49:48 -0400 | [diff] [blame] | 204 | |
| 205 | pw_cc_binary( |
| 206 | name = "trace_tokenized_example_trigger", |
Nathaniel Brough | a1113be | 2021-03-07 09:05:41 +0800 | [diff] [blame] | 207 | srcs = ["example/trigger.cc"], |
Robert Oliver | 1914691 | 2020-07-14 10:49:48 -0400 | [diff] [blame] | 208 | deps = [ |
| 209 | ":pw_trace_example_to_file", |
Robert Oliver | 1914691 | 2020-07-14 10:49:48 -0400 | [diff] [blame] | 210 | "//dir_pw_trace", |
| 211 | "//dir_pw_trace:pw_trace_sample_app", |
Nathaniel Brough | a1113be | 2021-03-07 09:05:41 +0800 | [diff] [blame] | 212 | "//pw_log", |
Robert Oliver | 1914691 | 2020-07-14 10:49:48 -0400 | [diff] [blame] | 213 | ], |
Robert Oliver | 1914691 | 2020-07-14 10:49:48 -0400 | [diff] [blame] | 214 | ) |
Robert Oliver | 0cc2075 | 2020-07-14 15:24:22 -0400 | [diff] [blame] | 215 | |
| 216 | pw_cc_binary( |
| 217 | name = "trace_tokenized_example_filter", |
Nathaniel Brough | a1113be | 2021-03-07 09:05:41 +0800 | [diff] [blame] | 218 | srcs = ["example/filter.cc"], |
Robert Oliver | 0cc2075 | 2020-07-14 15:24:22 -0400 | [diff] [blame] | 219 | deps = [ |
| 220 | ":pw_trace_example_to_file", |
Robert Oliver | 0cc2075 | 2020-07-14 15:24:22 -0400 | [diff] [blame] | 221 | "//dir_pw_trace", |
| 222 | "//dir_pw_trace:pw_trace_sample_app", |
Nathaniel Brough | a1113be | 2021-03-07 09:05:41 +0800 | [diff] [blame] | 223 | "//pw_log", |
Robert Oliver | 0cc2075 | 2020-07-14 15:24:22 -0400 | [diff] [blame] | 224 | ], |
Robert Oliver | 0cc2075 | 2020-07-14 15:24:22 -0400 | [diff] [blame] | 225 | ) |
Rob Oliver | 9d66337 | 2021-02-05 11:02:05 -0500 | [diff] [blame] | 226 | |
| 227 | pw_cc_library( |
| 228 | name = "trace_tokenized_example_rpc", |
Nathaniel Brough | a1113be | 2021-03-07 09:05:41 +0800 | [diff] [blame] | 229 | srcs = ["example/rpc.cc"], |
Rob Oliver | 9d66337 | 2021-02-05 11:02:05 -0500 | [diff] [blame] | 230 | deps = [ |
| 231 | ":pw_trace_rpc_service", |
| 232 | "//dir_pw_rpc:server", |
| 233 | "//dir_pw_rpc:system_server", |
Rob Oliver | 9d66337 | 2021-02-05 11:02:05 -0500 | [diff] [blame] | 234 | "//dir_pw_trace", |
| 235 | "//dir_pw_trace:pw_trace_sample_app", |
Nathaniel Brough | a1113be | 2021-03-07 09:05:41 +0800 | [diff] [blame] | 236 | "//pw_hdlc", |
| 237 | "//pw_log", |
Rob Oliver | 9d66337 | 2021-02-05 11:02:05 -0500 | [diff] [blame] | 238 | ], |
Nathaniel Brough | a1113be | 2021-03-07 09:05:41 +0800 | [diff] [blame] | 239 | ) |