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 = [ |
| 31 | "public/pw_trace_tokenized/internal/trace_tokenized_internal.h", |
| 32 | "public/pw_trace_tokenized/trace_callback.h", |
| 33 | "public/pw_trace_tokenized/trace_tokenized.h", |
| 34 | "public_overrides/pw_trace_backend/trace_backend.h", |
| 35 | ], |
| 36 | includes = [ |
| 37 | "public", |
| 38 | "public_overrides", |
| 39 | ], |
| 40 | deps = [ |
| 41 | "//pw_preprocessor", |
| 42 | "//pw_tokenizer", |
| 43 | ], |
| 44 | ) |
| 45 | |
| 46 | pw_cc_library( |
| 47 | name = "pw_trace_tokenized", |
| 48 | srcs = [ |
| 49 | "trace.cc", |
| 50 | ], |
| 51 | deps = [ |
| 52 | ":headers", |
| 53 | "//pw_assert", |
| 54 | "//pw_log", |
| 55 | "//pw_status", |
| 56 | "//pw_tokenizer", |
| 57 | "//pw_trace:facade", |
| 58 | "//pw_varint", |
| 59 | ], |
| 60 | ) |
| 61 | |
| 62 | pw_cc_library( |
Robert Oliver | 81e6e3e | 2020-06-25 14:43:40 -0400 | [diff] [blame] | 63 | name = "trace_buffer_headers", |
| 64 | hdrs = [ |
| 65 | "public/pw_trace_tokenized/trace_buffer.h", |
| 66 | ], |
| 67 | includes = [ |
| 68 | "public", |
| 69 | ], |
| 70 | deps = [ |
| 71 | "//pw_ring_buffer", |
| 72 | "//pw_status", |
| 73 | "//pw_trace_tokenized", |
| 74 | ], |
| 75 | ) |
| 76 | |
| 77 | pw_cc_library( |
| 78 | name = "pw_trace_tokenized_buffer", |
| 79 | srcs = [ |
| 80 | "trace_buffer.cc", |
| 81 | ], |
| 82 | deps = [ |
| 83 | ":trace_buffer_headers", |
| 84 | "//pw_ring_buffer", |
| 85 | "//pw_status", |
| 86 | ], |
| 87 | ) |
| 88 | |
| 89 | pw_cc_library( |
Prashanth Swaminathan | 0a9129c | 2020-09-14 16:27:24 -0700 | [diff] [blame^] | 90 | name = "pw_trace_tokenized_buffer_log", |
| 91 | hdrs = [ |
| 92 | "public/pw_trace_tokenized/trace_buffer_log.h", |
| 93 | ], |
| 94 | srcs = [ |
| 95 | "trace_buffer_log.cc", |
| 96 | ], |
| 97 | deps = [ |
| 98 | ":trace_buffer_headers", |
| 99 | "//pw_base64", |
| 100 | "//pw_log", |
| 101 | "//pw_string", |
| 102 | ], |
| 103 | ) |
| 104 | |
| 105 | pw_cc_library( |
Robert Oliver | 21dcf27 | 2020-05-12 15:41:52 -0400 | [diff] [blame] | 106 | name = "pw_trace_tokenized_fake_time", |
| 107 | srcs = [ |
| 108 | "fake_trace_time.cc", |
| 109 | ], |
| 110 | deps = [ |
| 111 | "//pw_trace", |
| 112 | ], |
| 113 | ) |
| 114 | |
| 115 | pw_cc_test( |
| 116 | name = "trace_tokenized_test", |
| 117 | srcs = [ |
| 118 | "trace_test.cc", |
| 119 | ], |
| 120 | includes = [ |
| 121 | "pw_trace_test", |
| 122 | "pw_trace_test/public_overrides" |
| 123 | ], |
| 124 | deps = [ |
| 125 | ":backend", |
| 126 | ":facade", |
| 127 | ":pw_trace", |
| 128 | "//pw_preprocessor", |
| 129 | "//pw_unit_test", |
| 130 | ], |
| 131 | ) |
| 132 | |
Robert Oliver | 81e6e3e | 2020-06-25 14:43:40 -0400 | [diff] [blame] | 133 | pw_cc_test( |
| 134 | name = "trace_tokenized_buffer_test", |
| 135 | srcs = [ |
| 136 | "trace_buffer_test.cc", |
| 137 | ], |
| 138 | deps = [ |
| 139 | ":backend", |
| 140 | ":facade", |
| 141 | ":pw_trace", |
| 142 | "//pw_preprocessor", |
| 143 | "//pw_unit_test", |
| 144 | ], |
| 145 | ) |
| 146 | |
Prashanth Swaminathan | 0a9129c | 2020-09-14 16:27:24 -0700 | [diff] [blame^] | 147 | pw_cc_test( |
| 148 | name = "trace_tokenized_buffer_log_test", |
| 149 | srcs = [ |
| 150 | "trace_buffer_log_test.cc", |
| 151 | ], |
| 152 | deps = [ |
| 153 | ":backend", |
| 154 | ":facade", |
| 155 | ":pw_trace_log", |
| 156 | "//pw_preprocessor", |
| 157 | "//pw_unit_test", |
| 158 | ], |
| 159 | ) |
| 160 | |
Robert Oliver | 6d05de1 | 2020-07-13 15:10:42 -0400 | [diff] [blame] | 161 | pw_cc_library( |
| 162 | name = "pw_trace_host_trace_time", |
| 163 | includes = [ "example/public" ], |
| 164 | deps = [ "//pw_trace" ], |
| 165 | srcs = [ "host_trace_time.cc" ] |
| 166 | ) |
| 167 | |
| 168 | pw_cc_library( |
| 169 | name = "pw_trace_example_to_file", |
| 170 | includes = [ "example/public" ], |
| 171 | deps = [ "//pw_trace" ], |
| 172 | hdrs = [ "example/public/pw_trace_tokenized/example/trace_to_file.h" ] |
| 173 | ) |
| 174 | |
| 175 | pw_cc_binary( |
| 176 | name = "trace_tokenized_example_basic", |
| 177 | deps = [ |
| 178 | ":pw_trace_example_to_file", |
| 179 | "//pw_log", |
| 180 | "//dir_pw_trace", |
| 181 | "//dir_pw_trace:pw_trace_sample_app", |
| 182 | ], |
| 183 | srcs = [ "example/basic.cc" ] |
| 184 | ) |
Robert Oliver | 1914691 | 2020-07-14 10:49:48 -0400 | [diff] [blame] | 185 | |
| 186 | pw_cc_binary( |
| 187 | name = "trace_tokenized_example_trigger", |
| 188 | deps = [ |
| 189 | ":pw_trace_example_to_file", |
| 190 | "//pw_log", |
| 191 | "//dir_pw_trace", |
| 192 | "//dir_pw_trace:pw_trace_sample_app", |
| 193 | ], |
| 194 | srcs = [ "example/trigger.cc" ] |
| 195 | ) |
Robert Oliver | 0cc2075 | 2020-07-14 15:24:22 -0400 | [diff] [blame] | 196 | |
| 197 | pw_cc_binary( |
| 198 | name = "trace_tokenized_example_filter", |
| 199 | deps = [ |
| 200 | ":pw_trace_example_to_file", |
| 201 | "//pw_log", |
| 202 | "//dir_pw_trace", |
| 203 | "//dir_pw_trace:pw_trace_sample_app", |
| 204 | ], |
| 205 | srcs = [ "example/filter.cc" ] |
| 206 | ) |