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
Official way to gather CPU load (IDFGH-10025) #11302
Comments
Hi @mickeyl, have you tried the esp-idf/examples/system/freertos/real_time_stats/main/real_time_stats_example_main.c Lines 30 to 44 in 56123c5
You can call this function once a second from some high-priority task, each time it will print the percentage of time spent in each of the tasks over the last second: esp-idf/examples/system/freertos/real_time_stats/main/real_time_stats_example_main.c Lines 157 to 166 in 56123c5
|
@igrr Thanks for responding so quick. The example you're referring to is exactly what I need! One last question before I close this issue: How much is the performance impact of enabling |
Enabling
Thus, the performance overhead of simply maintain the cumulative run time of each task via the However, fetching the run time stats is a different case (e.g., |
Is your feature request related to a problem?
Getting an idea about the system load seems to be very complicated on ESP32. There are multiple approaches out there, some using
vTaskGetRunTimeStats
and friends, some adding custom "idle" and "monitor" tasks, but all in all nothing really works reliably.The problem with
vTaskGetRunTimeStats
is that it gives an accumulated view since reboot, which is not really what we developers need. We need a "live view" of the workload, much like all other desktop and server operating systems provide -- optimally, with high and low watermarks, so that we can judge whether a given processor will be enough to handle our workload in practice.Describe the solution you'd like.
A simple way to enable the measurement via
sdkconfig
plus a global function to get the percentage, and -- if possible - high and low watermarks.Describe alternatives you've considered.
See above.
Additional context.
No response
The text was updated successfully, but these errors were encountered: