Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 15 Aug 2011 15:59:55 +0300
From:      Andriy Gapon <avg@FreeBSD.org>
To:        Sergey Kandaurov <pluknet@gmail.com>
Cc:        freebsd-current@FreeBSD.org, Navdeep Parhar <nparhar@gmail.com>
Subject:   Re: duplicate output when dumping from ddb
Message-ID:  <4E49184B.7090902@FreeBSD.org>
In-Reply-To: <CAE-mSOJLVdATNdsfhyK20WFHZuPKwnq0X9iYNAaRS%2Bze9BSfgQ@mail.gmail.com>
References:  <CAPFoGT-RyO9ouSTYch2nrhSYaacjg30roTGU1gju1W%2BwUu0g1A@mail.gmail.com> <CAE-mSOJLVdATNdsfhyK20WFHZuPKwnq0X9iYNAaRS%2Bze9BSfgQ@mail.gmail.com>

next in thread | previous in thread | raw e-mail | index | archive | help
on 15/08/2011 13:24 Sergey Kandaurov said the following:
> On 10 August 2011 23:04, Navdeep Parhar <nparhar@gmail.com> wrote:
>> "dump" or "call doadump" from within ddb display duplicate output.
>> This is with a serial console.  I have  console="comconsole,vidconsole"
>> in /boot/loader.conf and  "-D -S115200"  in /boot.config.
>>
>> db> dump
>> Dumping 1883 out of 12255 MB:Dumping 1883 out of 12255
>> MB:..1%..1%..11%..11%..21%..21%..31%..31%..41%..41%..51%..51%..61%..61%..71%..71%..81%..81%..91%..91%
>>
>> Dump complete
>> Dump complete
>> db>
>>
>> Something seems to have changed in the last couple of months or so.
>>
> 
> Just to confirm with my "Same here". I use a serial console with same
> settings, too. I am out of ideas how to fix it though.
> 

Let me try to guess... do you have PRINTF_BUFR_SIZE defined?
If you look at vprintf() in sys/kern/subr_prf.c, then it's possible that one
message is printed by putchar() repeatedly called in kvprintf and the duplicate
message is printed by cnputs() under PRINTF_BUFR_SIZE.

Indeed, pca.flags is set to TOCONS | TOLOG in vprintf(), so putchar() would
output a character (via cnputc) when kdb_active is true and also it would add the
character to a buffer (via putbuf), because TOLOG is set.

Maybe try to add !kdb_active condition for cnputs() call in vprintf().
-- 
Andriy Gapon



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?4E49184B.7090902>