Date: Tue, 27 Mar 2001 13:53:42 -0800 From: Alfred Perlstein <bright@wintelcom.net> To: Gersh <gersh@sonn.com> Cc: freebsd-hackers@FreeBSD.ORG Subject: Re: crash dump speed up patch. Message-ID: <20010327135341.I9431@fw.wintelcom.net> In-Reply-To: <Pine.BSF.4.21.0103271335580.3635-200000@tabby.sonn.com>; from gersh@sonn.com on Tue, Mar 27, 2001 at 01:46:40PM -0800 References: <Pine.BSF.4.21.0103271335580.3635-200000@tabby.sonn.com>
index | next in thread | previous in thread | raw e-mail
* Gersh <gersh@sonn.com> [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
help
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20010327135341.I9431>
