Use of printf's inside a kernel thread

Boris Kochergin spawk at acm.poly.edu
Fri Jul 16 00:46:35 UTC 2010


Patrick Mahan wrote:
>
> Just wondering if there is some constraints to using printf() calls
> inside a kernel thread (created by kthread_create()).  I'm currently
> trying to debug a worker thread but the printf's are coming out
> garbled.  Not entirely sure why this could be occurring.
>
> OS: FreeBSD 7.3 on an Intel Xeon with 8 Gbytes of memory.
>
> Any ideas?
>
> Thanks,
>
> Patrick
>
I don't think printf() output from the kernel is serialized. The 
PRINTF_BUFR_SIZE=128 GENERIC kernel option in 8.x alleviates this to a 
good extent, and there is a reference to it in /usr/src/sys/conf/options 
in 7.3, so it might be available there as well. Try it out.

-Boris


More information about the freebsd-hackers mailing list