any ideas.
I have a oops message come up but the machine is frozen, is there a way to
get
that message sent to the serial port before the machine freezes.
Then you mean "sychronously", not "atomically".
> I have a oops message come up but the machine is frozen, is there a
> way to get that message sent to the serial port before the machine
> freezes.
I imagine that making printk synchronous would have two big problems:
(a) it would make the kernel thread in question wait on a possibly slow
interface, and (b) it would invite deadlocks, since the function
calling printk (or the function that page-faulted to the oops handler
that then called printk) might be holding a lock that is needed during
some part of the print process.
--
Peter Samuelson
<sampo.creighton.edu!psamuels>
Having exactly the problem Laurent has, I changed
kernel/printk.c to additionally write all messages to one of the
UARTs. This works synchronously, the routine waits after each
character until it is sent. It is even possible to do printk()s
from within interrupt routines, when it *only* writes the message
to the serial port then.
I do not think problem (a) is really a problem, since we are
not talking about a production system, only about a test tool,
where performance should not really be an issue. (b) does not
exist, since only the output to the serial port is synchronous,
and there are of course no locks needed for that.
I am not going to post my changes here because the
implementation is *really* rude, but I will mail them if you
like.
Klaus
--
-----------------------------------------------------------------
Ingenieurbuero Ingo Mohnen Tel +49 (241) 94924-11
Rottstrasse 33 Fax +49 (241) 94924-29
52068 Aachen mailto:kl...@imp.ac.uunet.de
Germany http://members.aol.com/impaachen
> I am not going to post my changes here because the
>implementation is *really* rude, but I will mail them if you
>like.
If you would please. I'm trying to support a proprietary debug
interfance with serial-like characteristics, and I'd like to see how
someone else handled the issues I'm dealing with.
-Mark Langsdorf
> Having exactly the problem Laurent has, I changed
> kernel/printk.c to additionally write all messages to one of the
> UARTs. This works synchronously, the routine waits after each
> character until it is sent. It is even possible to do printk()s
> from within interrupt routines, when it *only* writes the message
> to the serial port then.
> I do not think problem (a) is really a problem, since we are
> not talking about a production system, only about a test tool,
> where performance should not really be an issue. (b) does not
> exist, since only the output to the serial port is synchronous,
> and there are of course no locks needed for that.
> I am not going to post my changes here because the
> implementation is *really* rude, but I will mail them if you
> like.
> Klaus
Do you really need to change the kernel? You can have the output at
more than one device by simply giving more than one "console=..."
parameter to the kernel. The last one will be /dev/console, but all
will get the printk's. All valid at least for 2.2.13, and documented
in /usr/src/linux/Documentation/serial-console.txt.
Peter
[Klaus Elend <kl...@imp.ac.uunet.de>]
> I do not think problem (a) is really a problem, since we are not
> talking about a production system, only about a test tool, where
> performance should not really be an issue.
Right, for testing you can do whatever you want. I was talking about
making kernel changes to distribute or use in general-purpose systems.
Not that the kernel in normal operation does a *lot* of printk's, but
still....
> (b) does not exist, since only the output to the serial port is
> synchronous, and there are of course no locks needed for that.
OK.
--
Peter Samuelson
<sampo.creighton.edu!psamuels>
Having the output written to multiple devices is not my point,
this is indeed possible wihtout kernel modification.
What I needed was synchronous output because I had a bug in my
driver that made the machine crash. So with the last few
printk()-messages left in some buffer at the time of the crash,
I never knew exactly where in my code the bug was.
And this cannot be achieved (to my knowledge) with an unchanged
kernel.
-**** Posted from RemarQ, http://www.remarq.com/?a ****-
Search and Read Usenet Discussions in your Browser - FREE -