-
Notifications
You must be signed in to change notification settings - Fork 2.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add a trace backend to linux/chip-tool which provides a simple and flexible way to trace chip messages. The backend provides handlers, which can be registered to handle the different types of messages and extract the relevant data needed for test automation. Added additional optional flags to chip-tool which allows turning on these traces and piping them either to a log or file. These flags and tracing are only enabled when tracing is enabled at compile time. Include trace compile with: gn gen out/with_trace/ --args='import("//with_pw_trace.gni")' The trace point is before the encrypt in SecureMessageCodec and only enabled when chip_enable_transport_trace is defined at compile time and a pw_trace backend is configured.
- Loading branch information
Rob Oliver
committed
Dec 9, 2021
1 parent
a7dd25e
commit 7658deb
Showing
16 changed files
with
677 additions
and
21 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
# Copyright (c) 2021 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. | ||
|
||
# add this gni as import in your build args to use pigweed in the example | ||
# 'import("//with_pw_rpc.gni")' | ||
|
||
import("//build_overrides/chip.gni") | ||
|
||
import("${chip_root}/config/standalone/args.gni") | ||
|
||
import("//build_overrides/pigweed.gni") | ||
|
||
cpp_standard = "gnu++17" | ||
|
||
pw_trace_BACKEND = "${chip_root}/examples/platform/linux/pw_trace_chip" | ||
|
||
chip_enable_trace_chip = true | ||
chip_enable_transport_trace = true |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
# Copyright (c) 2021 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. | ||
|
||
import("//build_overrides/pigweed.gni") | ||
|
||
import("//build_overrides/build.gni") | ||
import("//build_overrides/chip.gni") | ||
import("$dir_pw_build/target_types.gni") | ||
import("${chip_root}/src/lib/lib.gni") | ||
|
||
config("default_config") { | ||
include_dirs = [ "." ] | ||
} | ||
|
||
source_set("trace_handlers") { | ||
sources = [ "TraceHandlers.cpp" ] | ||
|
||
deps = [ | ||
"$dir_pw_trace", | ||
"${chip_root}/src/lib", | ||
] | ||
|
||
public_configs = [ ":default_config" ] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
# Trace Handlers | ||
|
||
These are trace message handlers which get registered with pw_trace_chip and | ||
interpret the different CHIP messages to extract the useful information required | ||
for test automation. |
Oops, something went wrong.