Cluttered trace messages on Genode/OKL4v2

Frank Kaiser frank.kaiser at ...24...
Mon Aug 30 15:20:50 CEST 2010


Hello

 

In my environment running Genode on top of OKL4 V2.1 I occasionally
observed cluttered debug output on the serial console, sometimes
accompanied by a roottask page fault. A close inspection of the system
showed that this happens when core writes debug output messages on its
own while in parallel debug messages are sent by other protection
domains. In core debug messages processed by Genode::printf() and
Genode::vprintf() are processed by Okl4_console::vprintf() which infact
is the call of the base class methode Console::vprintf(). The
implementation in the files okl4_console.cc and console.cc shows that
there is no lock to serialize trace output from different sources. The
outcome is that core's trace server and any other core thread can
concurrently write to OKL4's character-oriented debug interface leading
to the mix-up of two debug messages.

I could solve the problem by simply copying the solution from the class
Log_console used by the other protection domains:

*       Adding a Lock object to the class Okl4_console
      private:
             Lock _lock;

*       Substituting the call of the base class method
Console::vprintf() by providing a dedicated method
Okl4_console::vprintf()
      public:
             inline void vprintf(const char *format, va_list list)
             {
                   Lock::Guard lock_guard(_lock);
                   Console::vprintf(format, list);
             }

These two changes fix the problem w/o affecting any caller code using
Okl4_console::vprintf(). It leaves the base class methode
Console::vprintf() unmodified so that its usage in different derived
classes is not compromised.

I'd appreciate if this or an equivalent fix could find its way into one
of the next Genode baselines on Sourceforge.

 

Regards

Frank

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.genode.org/pipermail/users/attachments/20100830/55f51afd/attachment.html>


More information about the users mailing list