-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
xtensa/esp32[|s2|s3]: Fix task backtrace dump #13546
base: master
Are you sure you want to change the base?
Conversation
[Experimental Bot, please feedback here] Squash The Commits: This PR contains 3 Commits. Please Squash the Multiple Commits into a Single Commit. NuttX PR Requirements ReviewThis PR appears to meet the NuttX requirements. Here's a breakdown: Summary:
Impact:
Testing:
Overall: This PR demonstrates a good understanding of NuttX requirements. Adding specific issue references and detailing the testing environment would further strengthen it. |
`CONFIG_XTENSA_INTBACKTRACE` is necessary to enable backtrace dump for the tasks because exceptions are treated like interrupts (even when an exception occurs during a normal task execution). It's now automatically selected when `CONFIG_SCHED_BACKTRACE` is enabled. This commit also removes outdated Kconfig options.
- Fix `MAKE_PC_FROM_RA` macro to consider the instruction region base address; - Add sanity check for calculated PC and SP registers; - Check if the stack pointer is within the interrupt stack to enable backtrace dump if an exception occurs during the ISR; - Update the script for decoding the backtrace dump to consider the syntax of the backtrace format and properly handle the dump when SMP is enabled;
Stack and backtrace dump for Espressif's SoCs (ESP32, ESP32-S2, ESP32-S3, ESP32-C3, ESP32-C6 and ESP32-H2) is now documented in a new section for each chip entry page.
6bb1570
to
a7a4aae
Compare
bool "Full backtrace from interrupts" | ||
default n | ||
depends on XTENSA_DUMPBT_ON_ASSERT | ||
bool |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
how to disable this option if without the prompt string?
@@ -0,0 +1,144 @@ | |||
#!/usr/bin/env bash | |||
############################################################################ | |||
# tools/espressif/btdecode.sh |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
it's a general tool, let's move out of espressif folder
|
||
# Set the appropriate addr2line tool based on the chip | ||
|
||
case $chip in |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
let's support specify toolchain directly
Summary
Documentation: Document stack and backtrace dump for Espressif SoCs
xtensa/esp32[|s2|s3]: Fix task backtrace dump
MAKE_PC_FROM_RA
macro to consider the instruction region base address;xtensa/Kconfig: Fix dependency for backtrace dump on Xtensas
CONFIG_XTENSA_INTBACKTRACE
is necessary to enable backtrace dump for the tasks because exceptions are treated like interrupts (even when an exception occurs during a normal task execution). It's now automatically selected whenCONFIG_SCHED_BACKTRACE
is enabled. This commit also removes outdated Kconfig options.Impact
Fix backtrace dump on assertions considering assertions triggered by tasks or during an interrupt service.
Testing
Internal CI testing with HW on all Xtensa-based devices.
How to Test on ESP32:
Use
esp32-devkitc:nsh
. EnableCONFIG_SCHED_BACKTRACE
andCONFIG_SYSTEM_DUMPSTACK
. On nsh, rundumpstack
:Save this output to a file and use
./tools/espressif/btdecode.sh esp32 /tmp/backtrace.txt
to check the backtrace dump:Before this PR, the output would generate wrong addresses: