I have implemented measurement of the CPU load thanks to traceTASK_SWITCHED_IN(), traceTASK_SWITCHED_OUT() macros and a high frequency free running timer as proposed in freertos_Percentage_use_of_the_CPU_180e5758j.html and in measuring-cpu-usage/177
This works fine but it is not clear to me if this takes time spent into ISR into account or not. I’ve carried out some testing and I believe that time spent in ISR which interrupt the idle task is counted as idle time which is not correct. Can someone confirm this or suggest a reliable way to verify it?