Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add tracing instructions in ESP32 README.md #13722

Merged
merged 5 commits into from
Jan 20, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .github/.wordlist.txt
Original file line number Diff line number Diff line change
Expand Up @@ -988,6 +988,7 @@ TLV
tmp
tngvndl
TODO
tokenized
toolchain
toolchains
topologies
Expand Down
1 change: 1 addition & 0 deletions config/esp32/components/chip/component.mk
Original file line number Diff line number Diff line change
Expand Up @@ -136,6 +136,7 @@ ifeq ($(is_debug),false)
endif
if [[ "$(CONFIG_ENABLE_PW_RPC)" = "y" ]]; then \
echo "chip_build_pw_rpc_lib = true" >> $(OUTPUT_DIR)/args.gn ;\
echo "chip_build_pw_trace_lib = true" >> $(OUTPUT_DIR)/args.gn ;\
echo "remove_default_configs = [\"//third_party/connectedhomeip/third_party/pigweed/repo/pw_build:cpp17\"]" >> $(OUTPUT_DIR)/args.gn ;\
echo "pw_log_BACKEND = \"//third_party/connectedhomeip/third_party/pigweed/repo/pw_log_basic\"" >> $(OUTPUT_DIR)/args.gn ;\
echo "pw_assert_BACKEND = \"//third_party/connectedhomeip/third_party/pigweed/repo/pw_assert_log\"" >> $(OUTPUT_DIR)/args.gn ;\
Expand Down
14 changes: 14 additions & 0 deletions examples/all-clusters-app/esp32/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ control.
- [Flashing app using script](#flashing-app-using-script)
- [Note](#note)
- [Using the RPC console](#using-the-rpc-console)
- [Device Tracing](#device-tracing)

---

Expand Down Expand Up @@ -295,3 +296,16 @@ From within the console you can then invoke rpcs:

rpcs.chip.rpc.Lighting.Get()
rpcs.chip.rpc.Lighting.Set(on=True, level=128, color=protos.chip.rpc.LightingColor(hue=5, saturation=5))

## Device Tracing

Device tracing is available to analyze the device performance. To turn on
tracing, build with RPC enabled. See
[Using the RPC console](#using-the-rpc-console).

Obtain tracing json file.

```
$ ./{PIGWEED_REPO}/pw_trace_tokenized/py/pw_trace_tokenized/get_trace.py -d {PORT} -o {OUTPUT_FILE} \
-t {ELF_FILE} {PIGWEED_REPO}/pw_trace_tokenized/pw_trace_protos/trace_rpc.proto
```
7 changes: 5 additions & 2 deletions src/trace/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,14 @@ declare_args() {
chip_build_pw_trace_lib = false
}

config("config") {
defines = [ "PW_TRACE_BACKEND_SET" ]
}

source_set("trace") {
sources = [ "trace.h" ]

if (chip_build_pw_trace_lib) {
cflags = [ "-DPW_TRACE_BACKEND_SET=1" ]
public_configs = [ ":config" ]
public_deps = [ "${dir_pigweed}/pw_trace" ]
}
}