Run-time stats and interrupts

I am using FreeRTOS on an NXP LPC1769. I have enabled run-time stats as detailed in the manual. I can successfully get stats for all my tasks. It seems to me that time spent in interrupts is counted towards the task that happens to be interrupted. Is there a straightforward way to get time spent in interrupts listed separately in the stats? I would like to confirm that my interrupt-driven I/O (buffered serial ports) is not consuming excessive CPU time.

Run-time stats and interrupts

The limitation is that, in general, FreeRTOS doesn’t know when an interrupt occurs. If there is one interrupt in particular that you are interested in, you can add code at the beginning of it to read the high speed timer, and then read it again at the end, take the difference and accumulate it. Note that the end point may need to be just before the interrupt routine reactivates the new task if that operation doesn’t return to the ISR. (I am not familiar with this port and how it handles this operation). This won’t affect the stats from the run-time stats, but will give you a measure of those interrupts so instrumented.