gpioirqbench: measuring external interrupt latencies
Author
This document was written by Wolfgang Grandegger (wg {at} denx {dot} de).Context
I'm proud to announce "gpioirqbench", a benchmark tool to measure external interrupt latencies. It is derived from Jan's irqbench for the PC. Instead of using the serial or parallel port, it uses GPIO pins on embedded systems. It measures the time between the generation of an interrupt triggered by a GPIO pin and the reply by either the interrupt service routine, a kernel-space task or a user-space task. As reply, another GPIO pin will be toggled. The setup consists of two systems, the log host and the test target. The log host triggers the interrupt on the test target and measures the latency. This benchmark is primarily for Xenomai/RTDM, but it can also be used for plain Linux or even Linux-rt (with the real-time preemption patch). I have done a series of latency measurements with the embedded Power Architecture® evaluation board Icecube-Freescale-MPC5200 and Sequoia-AMCC-440EPx. The results are listed below:Freescale MPC5200 (IceCube)
CPU: | MPC5200 v1.0, Core v1.1 at 396 MHz Bus 132 MHz, IPB 66 MHz, PCI 33 MHz |
OS: | DENX Linux 2.6.24.2 "arch/powerpc" and Xenomai 2.4.2. with ELDK 4.2 and root filesystem via NFS |
Min | Max | |
---|---|---|
Xenomai user space task (-t0) | 13us | 119us |
Xenomai kernel space task (-t1) | 7us | 82us |
Xenomai interrupt handler (-t2) | 2us | 47us |
Plain Linux user space task | 31us | 5749us |
Linux-rt user space task | 61us | 251us |
cyclictest -t1 -p80 -n -i1000 | 11us | 89us |
latency -p1000 | 8us | 92us |
Sequoia - AMCC PPC440EPx Evaluation Board, Rev. F, PCI=33 MHz
CPU: | AMCC PowerPC 440EPx Rev. A at 528 MHz (PLB=132, OPB=66, EBC=66 MHz) |
OS: | DENX Linux 2.6.24.2 "arch/ppc" and Xenomai 2.4.2 with Ubuntu 7.04 on a USB-Disk and with a ATI Radeon 9200 card |
Min | Max | |
---|---|---|
Xenomai user space task (-t0) | 5us | 74us |
Xenomai kernel space task (-t1) | 4us | 49us |
Xenomai interrupt handler (-t2) | 2us | 29us |
Plain Linux user space task | 4us | 1291us |
Freescale i.MX31 (DAVE/DENX Qong EVB LITE)
CPU: | Freescale i.MX31 at 398 MHz on DAVE DENX Qong EVB LITE |
OS: | DENX Linux 2.6.28 and Xenomai 2.5.x with ELDK 4.2 and root filesystem via NFS |
Min | Max | |
---|---|---|
Xenomai user space task (-t0) | 25us | 97us |
Xenomai kernel space task (-t1) | 12us | 62us |
Xenomai interrupt handler (-t2) | 3us | 37us |
while ls; do ls /bin; donein one and
while ./hackbench 10; do ./calibrator 400 32M cali; sleep 30; donein a second telnet session. The tests ran for 1.5 hours, each. We have shown the Sequoia board in action at the Embedded World fair in Nuremberg in February 2008 as an Xenomai demo with an Oscilloscope connected to visualize the interrupt latencies measured with "gpioirqbench". I have attached the "gpioirqbench" distribution. It can be adapted to other embedded system with little effort. For further information, check the README inside.