-
Notifications
You must be signed in to change notification settings - Fork 7.3k
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
[Debug Helpers] add esp_backtrace_print_all_tasks function (IDFGH-10315) #11575
[Debug Helpers] add esp_backtrace_print_all_tasks function (IDFGH-10315) #11575
Conversation
e3a1e5f
to
7ebfe30
Compare
82b40ba
to
e721d93
Compare
e721d93
to
517c822
Compare
@o-marshmallow bump |
@o-marshmallow bump :) |
Great addition. I based some work off of Chip's PR that can be used to print all task backtraces to a JSON string so it can be logged somewhere other than the console. I don't know that it makes sense to add it to IDF, but here's a gist: https://gist.github.com/bdpdx/376d0dab638227556bf7631d9089e005 |
@chipweinberger Sorry for the delay of response, I am going to handle it. |
sha=517c822cf12e8ed892d2de3df0e3959c5a0c501c |
bump =) |
@Dazza0 I see you're making changes recently about this. can we still halt the scheduler & merge this? |
@o-marshmallow awesome!! thank you! =) |
This commit adds esp_backtrace_print_all_tasks() which prints the backtraces of all tasks at runtime. Closes espressif#9708 CLoses espressif#11575 [Omar Chebib: Prevent task switching while printing backtraces of tasks.] [Omar Chebib: Ensure all task stacks are flushed from register to RAM.] [Omar Chebib: Removed esp_task_snapshot_to_backtrace_frame() as task snapshot is private API.] [Omar Chebib: Added test case for esp_backtrace_print_all_tasks().] Signed-off-by: Omar Chebib <[email protected]> (cherry picked from commit 3686689) # Conflicts: # components/esp_system/port/arch/xtensa/debug_helpers.c # components/esp_system/test_apps/esp_system_unity_tests/main/test_backtrace.c # components/freertos/esp_additions/freertos_tasks_c_additions.h # components/freertos/esp_additions/include/esp_private/freertos_debug.h
This commit adds esp_backtrace_print_all_tasks() which prints the backtraces of all tasks at runtime. Closes espressif#9708 CLoses espressif#11575 [Omar Chebib: Prevent task switching while printing backtraces of tasks.] [Omar Chebib: Ensure all task stacks are flushed from register to RAM.] [Omar Chebib: Removed esp_task_snapshot_to_backtrace_frame() as task snapshot is private API.] [Omar Chebib: Added test case for esp_backtrace_print_all_tasks().] Signed-off-by: Omar Chebib <[email protected]> (cherry picked from commit 3686689) # Conflicts: # components/esp_system/port/arch/xtensa/debug_helpers.c # components/esp_system/test_apps/esp_system_unity_tests/main/test_backtrace.c # components/freertos/esp_additions/freertos_tasks_c_additions.h # components/freertos/esp_additions/include/esp_private/freertos_debug.h
This commit adds esp_backtrace_print_all_tasks() which prints the backtraces of all tasks at runtime. Closes espressif#9708 CLoses espressif#11575 [Omar Chebib: Prevent task switching while printing backtraces of tasks.] [Omar Chebib: Ensure all task stacks are flushed from register to RAM.] [Omar Chebib: Removed esp_task_snapshot_to_backtrace_frame() as task snapshot is private API.] [Omar Chebib: Added test case for esp_backtrace_print_all_tasks().] Signed-off-by: Omar Chebib <[email protected]> (cherry picked from commit 3686689) # Conflicts: # components/esp_system/port/arch/xtensa/debug_helpers.c # components/esp_system/test_apps/esp_system_unity_tests/main/test_backtrace.c # components/freertos/esp_additions/freertos_tasks_c_additions.h # components/freertos/esp_additions/include/esp_private/freertos_debug.h
This commit adds esp_backtrace_print_all_tasks() which prints the backtraces of all tasks at runtime. Closes espressif#9708 CLoses espressif#11575 [Omar Chebib: Prevent task switching while printing backtraces of tasks.] [Omar Chebib: Ensure all task stacks are flushed from register to RAM.] [Omar Chebib: Removed esp_task_snapshot_to_backtrace_frame() as task snapshot is private API.] [Omar Chebib: Added test case for esp_backtrace_print_all_tasks().] Signed-off-by: Omar Chebib <[email protected]> (cherry picked from commit 3686689) (cherry picked from commit ed19aae)
Related Issue: #9708
Lots of people need the ability to print all tasks in order to debug deadlocks, etc.
Also add
esp_backtrace_frame_t esp_task_snapshot_to_backtrace_frame(TaskSnapshot_t snapshot)
, as a helper function.