From owner-freebsd-hackers@FreeBSD.ORG Sat Apr 9 20:36:25 2011 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 1233) id BF3651065672; Sat, 9 Apr 2011 20:36:25 +0000 (UTC) Date: Sat, 9 Apr 2011 20:36:25 +0000 From: Alexander Best To: dieterbsd@engineer.com Message-ID: <20110409203625.GA50231@freebsd.org> References: <8CDC50749BB9940-18FC-38C6@web-mmc-m02.sysops.aol.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <8CDC50749BB9940-18FC-38C6@web-mmc-m02.sysops.aol.com> Cc: freebsd-hackers@freebsd.org Subject: Re: *printf(9) and PRINTF_BUFR_SIZE X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 09 Apr 2011 20:36:25 -0000 On Sat Apr 9 11, dieterbsd@engineer.com wrote: > While working on other problems with *printf(9), log(9), etc. > I stumbled upon: > > options PRINTF_BUFR_SIZE=128 # Prevent printf output being > interspersed. > > Question 1: Am I correct in thinking that PRINTF_BUFR_SIZE is supposed > to prevent this: > > ada2: 300.000MB/s transfuhub2: 3 ports with 3 removable, self powered > ers (SATA 2.x, UDMA6, PIO 8192bytes) > ada2: Command Queueing enabled > > Question 2: Why is vprintf() the only function that does this buffering? > As far as I can tell, the various functions that call kvprintf() > directly > without going through vprintf() do not get buffered. I'm thinking that > kvprintf() would be a better place for the buffering. Or would this > break > something? i remember this issue was discussed a few times before. you might want to take a look at [1]. cheers. alex [1] http://docs.freebsd.org/cgi/mid.cgi?AANLkTinPhcc8Z_BdvoEQUv-ZXlHAYOTQJwlUQDVO8iJ9 > > -- a13x