Hi,
to all of those that want measure jitter and have a Pentium machine, it
is simple. I assume you have available the function "long long
rdtsc(void)",
you can find it in the linux kernel and in rtl patches.
Then do:
t0 = rdtsc(); // just once the first time you enter your periodic
function;
int avrj = 0;
int maxj = 0;
and:
t = rdtsc(); // each time you enter your periodic function followed by:
dt = (int)(t - t0);
if (dt < 0 ) dt = -dt;
avrj = (avrj + dt)>>1;
if (dt > maxj) maxj = dt;
t0 = t;
then dt is your actual period jitter in cpu frequency units, avrj is the
average and maxj the maximum. Now you can check the differences with
your nominal period and that is the jitter.
I know that somebody will not accept such a definition but the more
correct
way of measuring it in absolute time using the cpu clock requires you to
know the clock frequency very very precisely, otherwise you get long
term false indications from the drift.
I can assure you that period variations above give substantially the
same results you get if you measure the jitter using a scope, at almost
no cost, so that you can keep it during actual operation to monitor if
you are loosing interrupts of whatever else.
To get it displayed you can use fifos or be annoyed by printk now and
then, say not more than 1-200 hz, from within the periodic real time
function.
Ciao, Paolo.
--- [rtl] ---
To unsubscribe:
echo "unsubscribe rtl" | mail [EMAIL PROTECTED] OR
echo "unsubscribe rtl <Your_email>" | mail [EMAIL PROTECTED]
----
For more information on Real-Time Linux see:
http://www.rtlinux.org/~rtlinux/