On Sat, 30 Oct 2004 15:15:07 +0200 Ingo Molnar wrote: > should have mentioned that in the user-triggered modus you have to do > the latency measurement in userspace. It is only the trace that is > correct, for the time being. This trace shows what i'd expect a jackd > wakeup to look like normally: 13 usecs. > > Ingo > Hi, i thought, why not try to get jack out of the equation first and use a different irq source. So i wrote a small test app for /dev/rtc to see if i see the same erratic behaviour [.cc source file atached. find a small tarball here: http://affenbande.org/~tapas/wakeup.tgz (it has a simple makefile, plus a script which does the chrt thing to make it SCHED_FIFO)]. This program takes two parameters: the desired freq of the rtc and the number of irq's to be measured. Then it polls on the fd of /dev/rtc and takes a cpu cycle count timestamp as soon as poll returns. At the end of the program i tried to gather some [useful ???] statistics of the data: - the mean difference in cycles between two wakeups - the max difference in cycles between two wakeups (and how much this differs from the mean difference) - the min difference in cycles between two wakeups (and how much this differs from the mean difference) - the mean difference from the mean difference :) And alas, wiggling windows screws up the timing on V0.5.6 for this, too. dunno, if this is any useful to you, but i felt the urge to try it :) flo P.S.: don't forget to make your rtc irq SCHED_FIFO with a high priority, too here's a sample output with window wiggling in X (rt_wakeup runs chrt -f 90 wakeup, so make rtc at least prio 91): ~/source/my_projects/wakeup$ ./rt_wakeup 1024 6000 freq: 1024 #: 6000 setting up /dev/rtc... locking memory... turning irq on, beginning measurement (might take a while)... ...measurement done mean cycle difference betweem two wakeups: 1.17845e+06 cycles min. cycle difference betweem two wakeups: 185992 cycles (#: 1563) diff from mean diff: 992461 max. cycle difference betweem two wakeups: 9.73166e+06 cycles (#: 1546) diff from mean diff: 8.5532e+06 ^this is bad i suppose :) mean difference from mean difference: 25279.2 cycles here's one on a rather idle system: ~/source/my_projects/wakeup$ ./rt_wakeup 1024 6000 freq: 1024 #: 6000 setting up /dev/rtc... locking memory... turning irq on, beginning measurement (might take a while)... ...measurement done mean cycle difference betweem two wakeups: 1.16697e+06 cycles min. cycle difference betweem two wakeups: 1.1486e+06 cycles (#: 5492) diff from mean diff: 18379.2 max. cycle difference betweem two wakeups: 1.18439e+06 cycles (#: 5491) diff from mean diff: 17417.8 mean difference from mean difference: 1144.82 cycles ~/source/my_projects/wakeup$