I want to track down jitter in a piece of code and I know there are many potential sources ( task switch, system calls, cache misses, moving task to another CPU, cpu throttling, etc ) and I know how to track all of those but the only one I don't know how to track is time the kernel spent servicing interrupts. The data is in /proc/stat but that measures time in soft-irq and irq at a low resolution and I'm looking for something at a much finer resolution.
Is there a way to get the time, down to the nanosecond or at least microsecond, spent by the kernel servicing interrupts?