From owner-rtl@rtlinux.cs.nmt.edu Sun Jun 20 21:36:36 1999
Message-ID: <19990620141552.A14615@stm.lbl.gov>
Date: Sun, 20 Jun 1999 14:15:52 -0700
From: David Schleef <ds@stm.lbl.gov>
To: rtl <rtl@rtlinux.cs.nmt.edu>
Subject: [rtl] RT-compatible printk() for logging
Mime-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Length: 3830
Lines: 174


Here's a little module I cooked up so that I could use
something like printk() inside RTLinux, and have the message
appear in log files, i.e., dmesg and /var/log/messages.
rtl_printf() in the new betas only prints things to the
console, although it does it in real-time.  This is great
for debugging, but not so great if you aren't at the
console.

How it works:

When you call rt_printk(), the output is buffered in a ring
buffer.  The ring buffer is then printk()'ed in a soft interrupt.
Thus, the output is not written to the console in real-time,
so there is the possibility that the order of printk() and
rt_printk() messages getting scrambled.  The function has the
same prototype as the normal printk()/printf(), which you need
to add to your source file, as there is no rt_printk.h.

This only works with RTLinux 2.2.  If you backport it, send
me the changes.


dave...
