Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 27 Mar 2001 14:20:02 -0800 (PST)
From:      Gersh <gersh@sonn.com>
To:        Alfred Perlstein <bright@wintelcom.net>
Cc:        freebsd-hackers@FreeBSD.ORG
Subject:   Re: crash dump speed up patch.
Message-ID:  <Pine.BSF.4.21.0103271415540.26315-100000@tabby.sonn.com>
In-Reply-To: <20010327135341.I9431@fw.wintelcom.net>

next in thread | previous in thread | raw e-mail | index | archive | help


On Tue, 27 Mar 2001, Alfred Perlstein wrote:

> * 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?

Yeah ill make a quick patch up it aswell.

> 
> 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);
> 
that acutally gives alot more output,  The basic idea was
to only print out when it got to certian increments 10, 20
Mainly becasue of the problem with serial connections :/

It looks and feels a bit slower to the human eye but it does
benchmark alot faster.

> 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); 
> 
I did that initally and it did look alot better the problem was 
when going looking at the dump in gdb the \r had really messed things up.

It would look like dump in progress 10% dump in progress 11% ...
and scroll all the way across the screen :/.

> 
> 
> 
> -- 
> -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
> 


To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-hackers" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?Pine.BSF.4.21.0103271415540.26315-100000>