Logging/printf's in RT env
Martin Pohlack
mp26 at os.inf.tu-dresden.de
Mon Aug 8 21:57:53 CEST 2005
[...]
> Yes, it goes away.
> But I thought that, if you have a real-time application running it will
> not be influenced by some "time-sharing" application as the logserver
> should be.
Just a short answer from me: This is of course only true if you don't
use these services! How should the system protect you if you call a
non-realtime service???
Btw. using the logserver or any other printf-style output inside a
real-time loop is a *very* bad idea. This services ususally use very
slow output devices (serial line, text-mode display).
As a general rule: You must decouple the output between the output
service and you rt-app. Of course, this can not be achieved with
synchronous IPC to a non-rt service ...
One would typically use a memory buffer and either collect the data and
output it *after* the experiment or use a asynchronous memory protocol
to transfer the information to another io service (Note: do not use LOG
here as it also slows down the rt-part of the system as it causes
serious slowdown in hardware IO (Jork once meassured a lot more than one
µs per character !!!).
You might want to have a look in the "rt_mon" or the "grtmon" package,
which have been used with some success in similar situations. Both
packages should have demo applications available and for grtmon there is
a Diploma Thesis (A Generalized Approach to Runtime Monitoring for
Real-Time Systems) available from:
http://os.inf.tu-dresden.de/project/finished/finished.xml.de
Hope this helps ...
Martin Pohlack
More information about the l4-hackers
mailing list