Are there any kernel tools available to measure interrupt latency with reasonable accuracy?

落爺英雄遲暮 提交于 2019-11-30 21:32:53
davidg

A typical method would be to set up a high-precision clock (such as the CPU's cycle counter) to trigger an interrupt some random-but-known time in the future, and measure in the ISR the difference between the time the clock was set to go off versus the time the ISR was actually reached.

(The "random" part of this is to ensure that you avoid systematically taking measurements during quiet or busy times---for instance, you don't want your timer interrupt to systematically trigger at the same time as a network card interrupt, unfairly pushing your latency numbers up.)

A tool that somewhat implements this is Cyclictest, though it appears to measure time inside a kernel thread instead of the ISR itself, which will push up your measured latency numbers somewhat.

Use "cyclictest" utility to measure latency, I have done research and I am using cyclictest to measure jitter of ported RT linux on powerpc platform.
It is simple yet powerful utility to measure latency

Houcheng

Another way is to connect your target board's one GPIO output to another GPIO input, pull the signal on GPIO output and handle this event in GPIO's ISR routine. Check the time difference of pulling signal and trigger of GPIO input ISR. here is the open source to do this, for Raspberry board:

Linux GPIO IRQ latency test

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!