Printing from kernel

Roman Kurakin rik at cronyx.ru
Thu Oct 7 09:35:07 PDT 2004


Greg 'groggy' Lehey wrote:

>On Thursday,  7 October 2004 at  0:31:33 +0400, Roman Kurakin wrote:
>  
>
>>Hi,
>>
>>	I have some problems with printing from kernel.
>>At first I think that my problems was cause I use printf,
>>but changed all of them to log cause it safe to use from
>>interrupt handlers. The situation become better but I still
>>observe system lockup in case I output some debug information
>>from my driver.
>>    
>>
>About the only thing I can think is that you're doing this in some
>area where it's unsafe to print, probably holding a lock that's needed
>in the print routines.
>  
>
I have the same idea but I cant't get which one.

>>	Also I have some problems with system console via com
>>port. Instead of messages from kernel I see the first letter
>>of the month name.
>>
>>	Could anybody comment my observation?
>>    
>>
>Without more detail, it's impossible to help.
>  
>
>>Does anybody saw anything like this?
>>    
>>
>
>No.  printf() is widely used in the kernel.
>  
>
I know. But it seems that log is more safer ...

>>	Oh, I forget to say I observe that with both Current
>>and Releng5, SMP. Also I can't trigger NMI so I can't see the
>>point of lockup.
>>    
>>
>
>Take a look at your code and check what locks you're holding.  Also,
>if this is only for debugging, you should be using the kernel
>debugger.
>  
>
It is used not only for debugging by myself, part of this output is my 
eye on users side.
But for now, most of output is locking debugging.

rik

>Greg
>--
>See complete headers for address and phone numbers.
>  
>





More information about the freebsd-hackers mailing list