From owner-freebsd-hackers Tue Mar 27 13:53:48 2001 Delivered-To: freebsd-hackers@freebsd.org Received: from fw.wintelcom.net (ns1.wintelcom.net [209.1.153.20]) by hub.freebsd.org (Postfix) with ESMTP id 75AFA37B71A for ; Tue, 27 Mar 2001 13:53:42 -0800 (PST) (envelope-from bright@fw.wintelcom.net) Received: (from bright@localhost) by fw.wintelcom.net (8.10.0/8.10.0) id f2RLrgd14060; Tue, 27 Mar 2001 13:53:42 -0800 (PST) Date: Tue, 27 Mar 2001 13:53:42 -0800 From: Alfred Perlstein To: Gersh Cc: freebsd-hackers@FreeBSD.ORG Subject: Re: crash dump speed up patch. Message-ID: <20010327135341.I9431@fw.wintelcom.net> References: Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.2.5i In-Reply-To: ; from gersh@sonn.com on Tue, Mar 27, 2001 at 01:46:40PM -0800 X-all-your-base: are belong to us. Sender: owner-freebsd-hackers@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG * Gersh [010327 13:41] wrote: > Ive writen a quick patch for dev/ata/ata-disk.c:addump under > 4.0-stable (03/26/01) which is considerbally faster. > > I did dumps on a SMP system with 512 megs of ram. > > Old: 201 seconds. > New: 59 seconds. > > What I could gather from talking to people over irc/email about the > problem was that there was a DELAY(1000) in between each printf > to deal with problems with serial connections to the debugger. The > soultion I came up with simply to display a smaller ammount of printf's > the output looks like this: > > Dump in progress, percentage complete: 10 20 30 40 50 60 70 80 100. Done. > > The dump_stats() routine probally belongs in some kern/subr_whatever.c > and should probally be used in the other dump routines for da/ide etc. > > Any thoughts or comments ? Nice! What about adapting it to scsi as well? btw: this is bad: > +int > +dump_stats(count, total, state) > + int count; > + int total; > + int *state; > +{ > + switch (*state) > + { > + case 0: > + if (count > 10) > + *state = 10; > + break; > + > + case 10: it could be replaced with: if (count % 10) printf("%d ", count); inlined? basically you want to print every % right? If you want to make it look "kewl" do this: printf("percentage complete:\n"); while (in loop) if (count % 10) printf("%d%%\r", count); -- -Alfred Perlstein - [bright@wintelcom.net|alfred@freebsd.org] Represent yourself, show up at BABUG http://www.babug.org/ To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-hackers" in the body of the message