blob: c55ba0a1dcf9a50df0c2cb95f0b8c2853549f2e7 [file] [log] [blame]
# Copyright 2020 The Pigweed Authors
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may not
# use this file except in compliance with the License. You may obtain a copy of
# the License at
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
# License for the specific language governing permissions and limitations under
# the License.
load(
"//pw_build:pigweed.bzl",
"pw_cc_binary",
"pw_cc_library",
"pw_cc_test",
)
package(default_visibility = ["//visibility:public"])
licenses(["notice"])
# TODO(b/242183155): Need to add support for facades/backends to Bazel.
pw_cc_library(
name = "headers",
hdrs = [
"public/pw_trace_tokenized/config.h",
"public/pw_trace_tokenized/internal/trace_tokenized_internal.h",
"public/pw_trace_tokenized/trace_callback.h",
"public/pw_trace_tokenized/trace_tokenized.h",
"public_overrides/pw_trace_backend/trace_backend.h",
],
includes = [
"public",
"public_overrides",
],
deps = [
"//pw_preprocessor",
"//pw_tokenizer",
],
)
pw_cc_library(
name = "pw_trace_tokenized",
srcs = [
"trace.cc",
],
deps = [
":headers",
"//pw_assert",
"//pw_log",
"//pw_status",
"//pw_tokenizer",
"//pw_trace:facade",
"//pw_varint",
],
)
pw_cc_library(
name = "trace_rpc_service",
srcs = [
"trace_rpc_service_nanopb.cc",
],
hdrs = [
"public/pw_trace_tokenized/trace_rpc_service_nanopb.h",
],
includes = [
"public",
],
deps = [
"//pw_log",
"//pw_trace",
"//pw_trace_tokenized_buffer",
],
)
pw_cc_library(
name = "trace_buffer_headers",
hdrs = [
"public/pw_trace_tokenized/trace_buffer.h",
],
includes = [
"public",
],
deps = [
"//pw_ring_buffer",
"//pw_status",
"//pw_trace_tokenized",
],
)
pw_cc_library(
name = "pw_trace_tokenized_buffer",
srcs = [
"trace_buffer.cc",
],
deps = [
":trace_buffer_headers",
"//pw_ring_buffer",
"//pw_status",
],
)
pw_cc_library(
name = "pw_trace_tokenized_buffer_log",
srcs = [
"trace_buffer_log.cc",
],
hdrs = [
"public/pw_trace_tokenized/trace_buffer_log.h",
],
deps = [
":trace_buffer_headers",
"//pw_base64",
"//pw_log",
"//pw_string",
],
)
proto_library(
name = "protos",
srcs = [
"pw_trace_protos/trace.proto",
"pw_trace_protos/trace_rpc.proto",
],
)
pw_cc_library(
name = "pw_trace_tokenized_fake_time",
srcs = [
"fake_trace_time.cc",
],
deps = [
"//pw_trace",
],
)
pw_cc_test(
name = "trace_tokenized_test",
srcs = [
"trace_test.cc",
],
includes = [
"pw_trace_test",
"pw_trace_test/public_overrides",
],
deps = [
":backend",
":facade",
":pw_trace",
"//pw_preprocessor",
"//pw_unit_test",
],
)
pw_cc_test(
name = "trace_tokenized_buffer_test",
srcs = [
"trace_buffer_test.cc",
],
deps = [
":backend",
":facade",
":pw_trace",
"//pw_preprocessor",
"//pw_unit_test",
],
)
pw_cc_test(
name = "trace_tokenized_buffer_log_test",
srcs = [
"trace_buffer_log_test.cc",
],
deps = [
":backend",
":facade",
":pw_trace_log",
"//pw_preprocessor",
"//pw_unit_test",
],
)
pw_cc_library(
name = "pw_trace_host_trace_time",
srcs = ["host_trace_time.cc"],
includes = ["example/public"],
deps = ["//pw_trace"],
)
pw_cc_library(
name = "pw_trace_example_to_file",
hdrs = ["example/public/pw_trace_tokenized/example/trace_to_file.h"],
includes = ["example/public"],
deps = ["//pw_trace"],
)
pw_cc_binary(
name = "trace_tokenized_example_basic",
srcs = ["example/basic.cc"],
deps = [
":pw_trace_example_to_file",
"//dir_pw_trace",
"//dir_pw_trace:pw_trace_sample_app",
"//pw_log",
],
)
pw_cc_binary(
name = "trace_tokenized_example_trigger",
srcs = ["example/trigger.cc"],
deps = [
":pw_trace_example_to_file",
"//dir_pw_trace",
"//dir_pw_trace:pw_trace_sample_app",
"//pw_log",
],
)
pw_cc_binary(
name = "trace_tokenized_example_filter",
srcs = ["example/filter.cc"],
deps = [
":pw_trace_example_to_file",
"//dir_pw_trace",
"//dir_pw_trace:pw_trace_sample_app",
"//pw_log",
],
)
pw_cc_library(
name = "trace_tokenized_example_rpc",
srcs = ["example/rpc.cc"],
deps = [
":pw_trace_rpc_service",
"//dir_pw_rpc:server",
"//dir_pw_rpc:system_server",
"//dir_pw_trace",
"//dir_pw_trace:pw_trace_sample_app",
"//pw_hdlc",
"//pw_log",
],
)