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

[Debug Helpers] add esp_backtrace_print_all_tasks function (IDFGH-10315) #11575

Conversation

chipweinberger
Copy link
Contributor

@chipweinberger chipweinberger commented Jun 2, 2023

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.

@chipweinberger chipweinberger force-pushed the user/chip/add-backtrace-print-all-tasks branch 2 times, most recently from e3a1e5f to 7ebfe30 Compare June 2, 2023 01:00
@espressif-bot espressif-bot added the Status: Opened Issue is new label Jun 2, 2023
@github-actions github-actions bot changed the title [Debug Helpers] add esp_backtrace_print_all_tasks function [Debug Helpers] add esp_backtrace_print_all_tasks function (IDFGH-10315) Jun 2, 2023
@chipweinberger chipweinberger force-pushed the user/chip/add-backtrace-print-all-tasks branch 3 times, most recently from 82b40ba to e721d93 Compare June 2, 2023 02:14
@chipweinberger chipweinberger force-pushed the user/chip/add-backtrace-print-all-tasks branch from e721d93 to 517c822 Compare June 2, 2023 02:20
@chipweinberger
Copy link
Contributor Author

@o-marshmallow

@chipweinberger
Copy link
Contributor Author

@o-marshmallow bump

@chipweinberger
Copy link
Contributor Author

@o-marshmallow bump :)

@bdpdx
Copy link

bdpdx commented Jul 22, 2023

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

@o-marshmallow
Copy link
Collaborator

@chipweinberger Sorry for the delay of response, I am going to handle it.

@o-marshmallow o-marshmallow added PR-Sync-Rebase Pull request sync as rebase commit PR-Sync-Update Pull request sync fetch new changes and removed PR-Sync-Rebase Pull request sync as rebase commit PR-Sync-Update Pull request sync fetch new changes labels Jul 24, 2023
@o-marshmallow
Copy link
Collaborator

sha=517c822cf12e8ed892d2de3df0e3959c5a0c501c

@o-marshmallow o-marshmallow added PR-Sync-Rebase Pull request sync as rebase commit and removed PR-Sync-Rebase Pull request sync as rebase commit labels Jul 24, 2023
@chipweinberger
Copy link
Contributor Author

bump =)

@chipweinberger
Copy link
Contributor Author

chipweinberger commented Oct 24, 2023

@Dazza0 I see you're making changes recently about this.

can we still halt the scheduler & merge this?

@espressif-bot espressif-bot added Status: Selected for Development Issue is selected for development and removed Status: Opened Issue is new labels Nov 29, 2023
@espressif-bot espressif-bot added Status: In Progress Work is in progress Status: Reviewing Issue is being reviewed and removed Status: Selected for Development Issue is selected for development Status: In Progress Work is in progress labels Nov 30, 2023
@espressif-bot espressif-bot added Status: Done Issue is done internally Resolution: NA Issue resolution is unavailable and removed Status: Reviewing Issue is being reviewed labels Dec 12, 2023
@chipweinberger
Copy link
Contributor Author

@o-marshmallow awesome!! thank you! =)

jnross pushed a commit to junelife/esp-idf that referenced this pull request Feb 12, 2024
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
jnross pushed a commit to junelife/esp-idf that referenced this pull request Feb 12, 2024
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
jnross pushed a commit to junelife/esp-idf that referenced this pull request Feb 12, 2024
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
mykmelez pushed a commit to junelife/esp-idf that referenced this pull request Aug 9, 2024
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)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
PR-Sync-Rebase Pull request sync as rebase commit Resolution: NA Issue resolution is unavailable Status: Done Issue is done internally
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants