| # Copyright (c) 2023 Project CHIP 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 |
| # |
| # http://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. |
| |
| declare_args() { |
| # Tracing can have a non-zero size impact to binaries. We try to make |
| # the impact minimal (the backends themselves add some size), however |
| # for now tracing is opt-in |
| matter_enable_tracing_support = target_os == "linux" |
| |
| # Defines the trace backend. Current matter tracing splits the logic |
| # into two parts: |
| # - data logging, well defined and using type-safe data |
| # - trace begin/end/instant states for monitoring execution and |
| # checking execution time and performance |
| # For tracing specifically, due to performance constraints, several |
| # backends prefer to be the one and only tracing provider (e.g. |
| # pw_tracing uses tokenization to reduce string sizes and allow |
| # for fast tracing even when the communication channels are slow). |
| # |
| # The setting below controls the destination of the tracing macros |
| # with the following values available: |
| # - "none" makes tracing completely disabled |
| # - "multiplexed" allows using the "backend.h" for tracing, which |
| # will multiplex however will only work on fast backends (e.g. |
| # large systems with fast logging when writing to logs) |
| # - any other value will provide a tracing config, which |
| # MUST include a path to `matter/tracing/macros_impl.h` |
| if (target_os == "linux") { |
| matter_trace_config = "multiplexed" |
| } else { |
| matter_trace_config = "none" |
| } |
| } |