Date: Sat, 09 Apr 2011 21:23:08 -0400 From: dieterbsd@engineer.com To: freebsd-hackers@freebsd.org Subject: Re: *printf(9) and PRINTF_BUFR_SIZE Message-ID: <8CDC534FC00AE72-18FC-4107@web-mmc-m02.sysops.aol.com>
next in thread | raw e-mail | index | archive | help
>> While working on other problems with *printf(9), log(9), etc. >> I stumbled upon: >> >> options PRINTF_BUFR_SIZE=3D128 # Prevent printf output being=20 interspersed. >> >> Question 1: Am I correct in thinking that PRINTF_BUFR_SIZE is=20 supposed >> to prevent this: >> >> ada2: 300.000MB/s transfuhub2: 3 ports with 3 removable, self=20 powered >> ers (SATA 2.x, UDMA6, PIO 8192bytes) >> ada2: Command Queueing enabled >> >> Question 2: Why is vprintf() the only function that does this=20 buffering? >> As far as I can tell, the various functions that call kvprintf()=20 directly >> without going through vprintf() do not get buffered. I'm thinking=20 that >> kvprintf() would be a better place for the buffering. Or would this=20 break >> something? >=20 http://docs.freebsd.org/cgi/mid.cgi?AANLkTinPhcc8Z_BdvoEQUv-ZXlHAYOTQJwlUQ= DVO\ 8iJ9 Thanks, Alex! That was a useful thread, I now know more about the problem and how to fix it. I gather the answer to Q1 is yes. Given that the word "transfers" is broken, I still think this example is most likely due to my changes that use unbuffered kvprintf() rather than buffered vprintf(). So question 2 remains. BTW, I see some threads where people think this is due to SMP. It happens on uniprocessor machines too.
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?8CDC534FC00AE72-18FC-4107>