Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to find out how long it takes the linux kernel to respond to IRQs? [duplicate]

I am trying to measure the jitter in the Interrupt latency for variousLinux kernel ( with RT patch enabled etc). I know the best way is to use a oscilloscope to do this, by generating a interrupt with GPIO pin and toggling another GPIO pin in the interrupt service routine, but i was wondering whether there are any Linux kernel tools to do this, and may be i can do a comparison of the numbers.

like image 364
Nuetrino Avatar asked Nov 22 '22 19:11

Nuetrino


2 Answers

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.

like image 173
davidg Avatar answered Nov 24 '22 08:11

davidg


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

like image 32
Prashant Bhumkar Avatar answered Nov 24 '22 08:11

Prashant Bhumkar