-
-
Notifications
You must be signed in to change notification settings - Fork 8.2k
esp32/modesp32: Implement idf_task_stats(). #12732
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
base: master
Are you sure you want to change the base?
Conversation
This looks pretty neat! The zephyr port already has I think this would be a good (optional) addition. |
1982e18
to
e2316bd
Compare
Thank you for the feedback! I've updated the branch to address them. One thing I'm not sure about is the rather large code snippet (compared to snippets elsewhere in the documentation) that implements the |
It could be added to |
e2316bd
to
8ddc267
Compare
Updated to move the code snippet from the documentation to a separate function in |
8ddc267
to
5842015
Compare
5842015
to
65310c7
Compare
65310c7
to
fa7c95b
Compare
Note: The build failure is due to the linked PR for micropython-lib not being merged, and thus the docs are referring to a file that does not yet exist on the micropython-lib master branch. |
fa7c95b
to
61cd01d
Compare
Signed-off-by: Daniël van de Giessen <daniel@dvdgiessen.nl>
This adds a new function,
esp32.idf_task_stats()
, that can be used to retrieve task statistics which is useful for diagnosing issues where some tasks are using up a lot of CPU time. For example, I originally found #8351 and #12728 using this function.An animated GIF is worth a thousand words:
(See also micropython/micropython-lib#822 which implements the Python function for this.)
By default the functionality is not enabled; it depends on a few extra option to be set. I have the following snippet in my
sdkconfig.board
files:If the required FreeRTOS functionality is available, the
idf_task_stats()
function is automatically enabled.